]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-98170.stderr
Rollup merge of #105216 - GuillaumeGomez:rm-unused-gui-test, r=notriddle
[rust.git] / src / test / ui / nll / issue-98170.stderr
1 error: lifetime may not live long enough
2   --> $DIR/issue-98170.rs:7:9
3    |
4 LL | impl MyStruct<'_> {
5    |               -- lifetime `'1` appears in the `impl`'s self type
6 LL |     pub fn new<'a>(field: &'a [u32]) -> MyStruct<'a> {
7    |                -- lifetime `'a` defined here
8 LL |         Self { field }
9    |         ^^^^^^^^^^^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
10
11 error: lifetime may not live long enough
12   --> $DIR/issue-98170.rs:7:16
13    |
14 LL | impl MyStruct<'_> {
15    |               -- lifetime `'1` appears in the `impl`'s self type
16 LL |     pub fn new<'a>(field: &'a [u32]) -> MyStruct<'a> {
17    |                -- lifetime `'a` defined here
18 LL |         Self { field }
19    |                ^^^^^ this usage requires that `'a` must outlive `'1`
20
21 error: lifetime may not live long enough
22   --> $DIR/issue-98170.rs:19:9
23    |
24 LL | impl<'a> Trait<'a> for MyStruct<'_> {
25    |      --                         -- lifetime `'1` appears in the `impl`'s self type
26    |      |
27    |      lifetime `'a` defined here
28 LL |     fn new(field: &'a [u32]) -> MyStruct<'a> {
29 LL |         Self { field }
30    |         ^^^^^^^^^^^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
31
32 error: lifetime may not live long enough
33   --> $DIR/issue-98170.rs:19:16
34    |
35 LL | impl<'a> Trait<'a> for MyStruct<'_> {
36    |      --                         -- lifetime `'1` appears in the `impl`'s self type
37    |      |
38    |      lifetime `'a` defined here
39 LL |     fn new(field: &'a [u32]) -> MyStruct<'a> {
40 LL |         Self { field }
41    |                ^^^^^ this usage requires that `'a` must outlive `'1`
42
43 error: aborting due to 4 previous errors
44