|
| 1 | +error[E0106]: missing lifetime specifier |
| 2 | + --> $DIR/return-elided-lifetime.rs:6:12 |
| 3 | + | |
| 4 | +LL | fn f1() -> &i32 { loop {} } |
| 5 | + | ^ expected named lifetime parameter |
| 6 | + | |
| 7 | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from |
| 8 | +help: consider using the `'static` lifetime |
| 9 | + | |
| 10 | +LL | fn f1() -> &'static i32 { loop {} } |
| 11 | + | ^^^^^^^^ |
| 12 | + |
| 13 | +error[E0106]: missing lifetime specifier |
| 14 | + --> $DIR/return-elided-lifetime.rs:8:14 |
| 15 | + | |
| 16 | +LL | fn f1_() -> (&i32, &i32) { loop {} } |
| 17 | + | ^ expected named lifetime parameter |
| 18 | + | |
| 19 | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from |
| 20 | +help: consider using the `'static` lifetime |
| 21 | + | |
| 22 | +LL | fn f1_() -> (&'static i32, &i32) { loop {} } |
| 23 | + | ^^^^^^^^ |
| 24 | + |
| 25 | +error[E0106]: missing lifetime specifier |
| 26 | + --> $DIR/return-elided-lifetime.rs:8:20 |
| 27 | + | |
| 28 | +LL | fn f1_() -> (&i32, &i32) { loop {} } |
| 29 | + | ^ expected named lifetime parameter |
| 30 | + | |
| 31 | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from |
| 32 | +help: consider using the `'static` lifetime |
| 33 | + | |
| 34 | +LL | fn f1_() -> (&i32, &'static i32) { loop {} } |
| 35 | + | ^^^^^^^^ |
| 36 | + |
| 37 | +error[E0106]: missing lifetime specifier |
| 38 | + --> $DIR/return-elided-lifetime.rs:12:26 |
| 39 | + | |
| 40 | +LL | fn f2(a: i32, b: i32) -> &i32 { loop {} } |
| 41 | + | ^ expected named lifetime parameter |
| 42 | + | |
| 43 | + = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments |
| 44 | +help: consider using the `'static` lifetime |
| 45 | + | |
| 46 | +LL | fn f2(a: i32, b: i32) -> &'static i32 { loop {} } |
| 47 | + | ^^^^^^^^ |
| 48 | + |
| 49 | +error[E0106]: missing lifetime specifier |
| 50 | + --> $DIR/return-elided-lifetime.rs:14:28 |
| 51 | + | |
| 52 | +LL | fn f2_(a: i32, b: i32) -> (&i32, &i32) { loop {} } |
| 53 | + | ^ expected named lifetime parameter |
| 54 | + | |
| 55 | + = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments |
| 56 | +help: consider using the `'static` lifetime |
| 57 | + | |
| 58 | +LL | fn f2_(a: i32, b: i32) -> (&'static i32, &i32) { loop {} } |
| 59 | + | ^^^^^^^^ |
| 60 | + |
| 61 | +error[E0106]: missing lifetime specifier |
| 62 | + --> $DIR/return-elided-lifetime.rs:14:34 |
| 63 | + | |
| 64 | +LL | fn f2_(a: i32, b: i32) -> (&i32, &i32) { loop {} } |
| 65 | + | ^ expected named lifetime parameter |
| 66 | + | |
| 67 | + = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments |
| 68 | +help: consider using the `'static` lifetime |
| 69 | + | |
| 70 | +LL | fn f2_(a: i32, b: i32) -> (&i32, &'static i32) { loop {} } |
| 71 | + | ^^^^^^^^ |
| 72 | + |
| 73 | +error[E0106]: missing lifetime specifier |
| 74 | + --> $DIR/return-elided-lifetime.rs:19:17 |
| 75 | + | |
| 76 | +LL | fn f3(s: &S) -> &i32 { loop {} } |
| 77 | + | -- ^ expected named lifetime parameter |
| 78 | + | |
| 79 | + = help: this function's return type contains a borrowed value, but the signature does not say which one of `s`'s 3 lifetimes it is borrowed from |
| 80 | +help: consider introducing a named lifetime parameter |
| 81 | + | |
| 82 | +LL | fn f3<'a>(s: &'a S) -> &'a i32 { loop {} } |
| 83 | + | ^^^^ ^^^^^ ^^^ |
| 84 | + |
| 85 | +error[E0106]: missing lifetime specifier |
| 86 | + --> $DIR/return-elided-lifetime.rs:21:26 |
| 87 | + | |
| 88 | +LL | fn f3_(s: &S, t: &S) -> (&i32, &i32) { loop {} } |
| 89 | + | -- -- ^ expected named lifetime parameter |
| 90 | + | |
| 91 | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from one of `s`'s 3 lifetimes or one of `t`'s 3 lifetimes |
| 92 | +help: consider introducing a named lifetime parameter |
| 93 | + | |
| 94 | +LL | fn f3_<'a>(s: &'a S, t: &'a S) -> (&'a i32, &i32) { loop {} } |
| 95 | + | ^^^^ ^^^^^ ^^^^^ ^^^ |
| 96 | + |
| 97 | +error[E0106]: missing lifetime specifier |
| 98 | + --> $DIR/return-elided-lifetime.rs:21:32 |
| 99 | + | |
| 100 | +LL | fn f3_(s: &S, t: &S) -> (&i32, &i32) { loop {} } |
| 101 | + | -- -- ^ expected named lifetime parameter |
| 102 | + | |
| 103 | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from one of `s`'s 3 lifetimes or one of `t`'s 3 lifetimes |
| 104 | +help: consider introducing a named lifetime parameter |
| 105 | + | |
| 106 | +LL | fn f3_<'a>(s: &'a S, t: &'a S) -> (&i32, &'a i32) { loop {} } |
| 107 | + | ^^^^ ^^^^^ ^^^^^ ^^^ |
| 108 | + |
| 109 | +error[E0106]: missing lifetime specifier |
| 110 | + --> $DIR/return-elided-lifetime.rs:25:42 |
| 111 | + | |
| 112 | +LL | fn f4<'a, 'b>(a: &'a i32, b: &'b i32) -> &i32 { loop {} } |
| 113 | + | ------- ------- ^ expected named lifetime parameter |
| 114 | + | |
| 115 | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b` |
| 116 | +note: these named lifetimes are available to use |
| 117 | + --> $DIR/return-elided-lifetime.rs:25:7 |
| 118 | + | |
| 119 | +LL | fn f4<'a, 'b>(a: &'a i32, b: &'b i32) -> &i32 { loop {} } |
| 120 | + | ^^ ^^ |
| 121 | +help: consider using one of the available lifetimes here |
| 122 | + | |
| 123 | +LL | fn f4<'a, 'b>(a: &'a i32, b: &'b i32) -> &'lifetime i32 { loop {} } |
| 124 | + | ^^^^^^^^^^ |
| 125 | + |
| 126 | +error[E0106]: missing lifetime specifier |
| 127 | + --> $DIR/return-elided-lifetime.rs:27:44 |
| 128 | + | |
| 129 | +LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&i32, &i32) { loop {} } |
| 130 | + | ------- ------- ^ expected named lifetime parameter |
| 131 | + | |
| 132 | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b` |
| 133 | +note: these named lifetimes are available to use |
| 134 | + --> $DIR/return-elided-lifetime.rs:27:8 |
| 135 | + | |
| 136 | +LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&i32, &i32) { loop {} } |
| 137 | + | ^^ ^^ |
| 138 | +help: consider using one of the available lifetimes here |
| 139 | + | |
| 140 | +LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&'lifetime i32, &i32) { loop {} } |
| 141 | + | ^^^^^^^^^^ |
| 142 | + |
| 143 | +error[E0106]: missing lifetime specifier |
| 144 | + --> $DIR/return-elided-lifetime.rs:27:50 |
| 145 | + | |
| 146 | +LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&i32, &i32) { loop {} } |
| 147 | + | ------- ------- ^ expected named lifetime parameter |
| 148 | + | |
| 149 | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b` |
| 150 | +note: these named lifetimes are available to use |
| 151 | + --> $DIR/return-elided-lifetime.rs:27:8 |
| 152 | + | |
| 153 | +LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&i32, &i32) { loop {} } |
| 154 | + | ^^ ^^ |
| 155 | +help: consider using one of the available lifetimes here |
| 156 | + | |
| 157 | +LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&i32, &'lifetime i32) { loop {} } |
| 158 | + | ^^^^^^^^^^ |
| 159 | + |
| 160 | +error[E0106]: missing lifetime specifier |
| 161 | + --> $DIR/return-elided-lifetime.rs:31:35 |
| 162 | + | |
| 163 | +LL | fn f5<'a>(a: &'a i32, b: &i32) -> &i32 { loop {} } |
| 164 | + | ------- ---- ^ expected named lifetime parameter |
| 165 | + | |
| 166 | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b` |
| 167 | +help: consider using the `'a` lifetime |
| 168 | + | |
| 169 | +LL | fn f5<'a>(a: &'a i32, b: &i32) -> &'a i32 { loop {} } |
| 170 | + | ^^^ |
| 171 | + |
| 172 | +error[E0106]: missing lifetime specifier |
| 173 | + --> $DIR/return-elided-lifetime.rs:33:37 |
| 174 | + | |
| 175 | +LL | fn f5_<'a>(a: &'a i32, b: &i32) -> (&i32, &i32) { loop {} } |
| 176 | + | ------- ---- ^ expected named lifetime parameter |
| 177 | + | |
| 178 | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b` |
| 179 | +help: consider using the `'a` lifetime |
| 180 | + | |
| 181 | +LL | fn f5_<'a>(a: &'a i32, b: &i32) -> (&'a i32, &i32) { loop {} } |
| 182 | + | ^^^ |
| 183 | + |
| 184 | +error[E0106]: missing lifetime specifier |
| 185 | + --> $DIR/return-elided-lifetime.rs:33:43 |
| 186 | + | |
| 187 | +LL | fn f5_<'a>(a: &'a i32, b: &i32) -> (&i32, &i32) { loop {} } |
| 188 | + | ------- ---- ^ expected named lifetime parameter |
| 189 | + | |
| 190 | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b` |
| 191 | +help: consider using the `'a` lifetime |
| 192 | + | |
| 193 | +LL | fn f5_<'a>(a: &'a i32, b: &i32) -> (&i32, &'a i32) { loop {} } |
| 194 | + | ^^^ |
| 195 | + |
| 196 | +error: aborting due to 15 previous errors |
| 197 | + |
| 198 | +For more information about this error, try `rustc --explain E0106`. |
0 commit comments