rust/tests/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs

12 lines
209 B
Rust
Raw Normal View History

2017-08-25 11:51:22 +05:30
trait Foo<'a> {}
impl<'a, T> Foo<'a> for T {}
fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T)
where i32: Foo<'a>,
u32: Foo<'b>
{
2017-11-20 13:13:27 +01:00
x.push(y); //~ ERROR explicit lifetime required
2017-08-25 11:51:22 +05:30
}
fn main() {
}