]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/return-without-lifetime.stderr
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / return-without-lifetime.stderr
1 error[E0106]: missing lifetime specifier
2   --> $DIR/return-without-lifetime.rs:2:16
3    |
4 LL | struct Foo<'a>(&usize);
5    |                ^ expected named lifetime parameter
6    |
7 help: consider using the `'a` lifetime
8    |
9 LL | struct Foo<'a>(&'a usize);
10    |                 ++
11
12 error[E0106]: missing lifetime specifier
13   --> $DIR/return-without-lifetime.rs:5:34
14    |
15 LL | fn func1<'a>(_arg: &'a Thing) -> &() { unimplemented!() }
16    |                    ---------     ^ expected named lifetime parameter
17    |
18    = help: this function's return type contains a borrowed value, but the signature does not say which one of `_arg`'s 2 lifetimes it is borrowed from
19 help: consider using the `'a` lifetime
20    |
21 LL | fn func1<'a>(_arg: &'a Thing) -> &'a () { unimplemented!() }
22    |                                   ++
23
24 error[E0106]: missing lifetime specifier
25   --> $DIR/return-without-lifetime.rs:7:35
26    |
27 LL | fn func2<'a>(_arg: &Thing<'a>) -> &() { unimplemented!() }
28    |                    ----------     ^ expected named lifetime parameter
29    |
30    = help: this function's return type contains a borrowed value, but the signature does not say which one of `_arg`'s 2 lifetimes it is borrowed from
31 help: consider using the `'a` lifetime
32    |
33 LL | fn func2<'a>(_arg: &Thing<'a>) -> &'a () { unimplemented!() }
34    |                                    ++
35
36 error: aborting due to 3 previous errors
37
38 For more information about this error, try `rustc --explain E0106`.