Files
rust/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
345 B
Rust
Raw Normal View History

2022-05-22 02:05:15 -04:00
// revisions: base nll
// ignore-compare-mode-nll
//[nll] compile-flags: -Z borrowck=mir
2017-08-06 04:09:43 +05:30
trait Foo {
fn foo<'a>(x: &mut Vec<&u8>, y: &u8);
}
2017-08-06 04:09:43 +05:30
impl Foo for () {
fn foo(x: &mut Vec<&u8>, y: &u8) {
2022-05-22 02:05:15 -04:00
x.push(y);
//[base]~^ ERROR lifetime mismatch
//[nll]~^^ ERROR lifetime may not live long enough
2017-08-06 04:09:43 +05:30
}
}
fn main() {}