]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | // Test that Cell is considered invariant with respect to its |
2 | // type. | |
223e47cc | 3 | |
1a4d82fc | 4 | use std::cell::Cell; |
223e47cc | 5 | |
1a4d82fc JJ |
6 | struct Foo<'a> { |
7 | x: Cell<Option<&'a isize>>, | |
223e47cc LB |
8 | } |
9 | ||
1a4d82fc JJ |
10 | fn use_<'short,'long>(c: Foo<'short>, |
11 | s: &'short isize, | |
12 | l: &'long isize, | |
13 | _where:Option<&'short &'long ()>) { | |
04454e1e | 14 | let _: Foo<'long> = c; |
923072b8 | 15 | //~^ ERROR lifetime may not live long enough |
223e47cc LB |
16 | } |
17 | ||
18 | fn main() { | |
19 | } |