summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/return-without-lifetime.stderr
blob: 5028e8d628f270a69ed48bafae4046cb96dc82db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
error[E0106]: missing lifetime specifier
  --> $DIR/return-without-lifetime.rs:2:16
   |
LL | struct Foo<'a>(&usize);
   |                ^ expected named lifetime parameter
   |
help: consider using the `'a` lifetime
   |
LL | struct Foo<'a>(&'a usize);
   |                 ++

error[E0106]: missing lifetime specifier
  --> $DIR/return-without-lifetime.rs:5:34
   |
LL | fn func1<'a>(_arg: &'a Thing) -> &() { unimplemented!() }
   |                    ---------     ^ expected named lifetime parameter
   |
   = 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
help: consider using the `'a` lifetime
   |
LL | fn func1<'a>(_arg: &'a Thing) -> &'a () { unimplemented!() }
   |                                   ++

error[E0106]: missing lifetime specifier
  --> $DIR/return-without-lifetime.rs:7:35
   |
LL | fn func2<'a>(_arg: &Thing<'a>) -> &() { unimplemented!() }
   |                    ----------     ^ expected named lifetime parameter
   |
   = 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
help: consider using the `'a` lifetime
   |
LL | fn func2<'a>(_arg: &Thing<'a>) -> &'a () { unimplemented!() }
   |                                    ++

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0106`.