rust/tests/ui/nll/where_clauses_in_structs.stderr

18 lines
722 B
Plaintext
Raw Normal View History

2018-12-11 15:49:40 -06:00
error: lifetime may not live long enough
2022-04-01 12:13:25 -05:00
--> $DIR/where_clauses_in_structs.rs:11:11
2018-08-08 07:28:26 -05:00
|
LL | fn bar<'a, 'b>(x: Cell<&'a u32>, y: Cell<&'b u32>) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
LL | Foo { x, y };
| ^ this usage requires that `'a` must outlive `'b`
2018-11-28 15:05:36 -06:00
|
2019-10-27 09:39:14 -05:00
= help: consider adding the following bound: `'a: 'b`
2022-04-02 17:32:39 -05:00
= note: requirement occurs because of the type `Cell<&u32>`, which makes the generic argument `&u32` invariant
= note: the struct `Cell<T>` is invariant over the parameter `T`
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
2018-11-28 15:05:36 -06:00
2018-08-08 07:28:26 -05:00
error: aborting due to previous error