2018-12-11 21:49:40 +00:00
|
|
|
error: lifetime may not live long enough
|
2022-04-01 17:13:25 +00:00
|
|
|
--> $DIR/where_clauses_in_structs.rs:11:11
|
2018-08-08 12:28:26 +00: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 };
|
2021-09-06 21:59:24 +00:00
|
|
|
| ^ this usage requires that `'a` must outlive `'b`
|
2018-11-28 21:05:36 +00:00
|
|
|
|
|
2019-10-27 14:39:14 +00:00
|
|
|
= help: consider adding the following bound: `'a: 'b`
|
2022-04-02 22:32:39 +00: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`
|
2021-09-28 01:22:44 +00:00
|
|
|
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
|
2018-11-28 21:05:36 +00:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2018-08-08 12:28:26 +00:00
|
|
|
|