summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr
blob: d07754879559a7c50713144adfafc6c87bc8e571 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
error[E0106]: missing lifetime specifier
  --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:2:11
   |
LL | fn f() -> &isize {
   |           ^ expected named lifetime parameter
   |
   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
help: consider using the `'static` lifetime
   |
LL | fn f() -> &'static isize {
   |            +++++++

error[E0106]: missing lifetime specifier
  --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:7:33
   |
LL | fn g(_x: &isize, _y: &isize) -> &isize {
   |          ------      ------     ^ expected named lifetime parameter
   |
   = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `_x` or `_y`
help: consider introducing a named lifetime parameter
   |
LL | fn g<'a>(_x: &'a isize, _y: &'a isize) -> &'a isize {
   |     ++++      ++             ++            ++

error[E0106]: missing lifetime specifier
  --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:17:19
   |
LL | fn h(_x: &Foo) -> &isize {
   |          ----     ^ expected named lifetime parameter
   |
   = help: this function's return type contains a borrowed value, but the signature does not say which one of `_x`'s 2 lifetimes it is borrowed from
help: consider introducing a named lifetime parameter
   |
LL | fn h<'a>(_x: &'a Foo<'a>) -> &'a isize {
   |     ++++      ++    ++++      ++

error[E0106]: missing lifetime specifier
  --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:21:20
   |
LL | fn i(_x: isize) -> &isize {
   |                    ^ expected named lifetime parameter
   |
   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
help: consider using the `'static` lifetime
   |
LL | fn i(_x: isize) -> &'static isize {
   |                     +++++++

error[E0106]: missing lifetime specifier
  --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:34:24
   |
LL | fn j(_x: StaticStr) -> &isize {
   |                        ^ expected named lifetime parameter
   |
   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
help: consider using the `'static` lifetime
   |
LL | fn j(_x: StaticStr) -> &'static isize {
   |                         +++++++

error[E0106]: missing lifetime specifier
  --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:40:49
   |
LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &isize {
   |                                                 ^ expected named lifetime parameter
   |
   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
help: consider using the `'a` lifetime
   |
LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &'a isize {
   |                                                  ++

error: aborting due to 6 previous errors

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