rust/src/test/ui/nll/where_clauses_in_structs.rs
2019-01-17 20:39:06 -06:00

18 lines
287 B
Rust

// compile-flags: -Z borrowck=mir
#![allow(dead_code)]
use std::cell::Cell;
struct Foo<'a: 'b, 'b> {
x: Cell<&'a u32>,
y: Cell<&'b u32>,
}
fn bar<'a, 'b>(x: Cell<&'a u32>, y: Cell<&'b u32>) {
Foo { x, y };
//~^ ERROR lifetime may not live long enough
}
fn main() {}