]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/where_clauses_in_structs.stderr
Rollup merge of #103644 - catlee:catlee/option-question-mark-docs, r=workingjubilee
[rust.git] / src / test / ui / nll / where_clauses_in_structs.stderr
1 error: lifetime may not live long enough
2   --> $DIR/where_clauses_in_structs.rs:11:11
3    |
4 LL | fn bar<'a, 'b>(x: Cell<&'a u32>, y: Cell<&'b u32>) {
5    |        --  -- lifetime `'b` defined here
6    |        |
7    |        lifetime `'a` defined here
8 LL |     Foo { x, y };
9    |           ^ this usage requires that `'a` must outlive `'b`
10    |
11    = help: consider adding the following bound: `'a: 'b`
12    = note: requirement occurs because of the type `Cell<&u32>`, which makes the generic argument `&u32` invariant
13    = note: the struct `Cell<T>` is invariant over the parameter `T`
14    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
15
16 error: aborting due to previous error
17