2022-05-22 02:05:15 -04:00
|
|
|
// revisions: base nll
|
|
|
|
|
// ignore-compare-mode-nll
|
|
|
|
|
//[nll] compile-flags: -Z borrowck=mir
|
|
|
|
|
|
2019-05-28 14:46:13 -04:00
|
|
|
fn foo(x:Box<dyn Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
|
2022-05-22 02:05:15 -04:00
|
|
|
y.push(z);
|
|
|
|
|
//[base]~^ ERROR lifetime mismatch
|
|
|
|
|
//[nll]~^^ ERROR lifetime may not live long enough
|
|
|
|
|
//[nll]~| ERROR cannot borrow
|
2017-09-12 18:22:22 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() { }
|