]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-26638.stderr
Auto merge of #78066 - bugadani:wat, r=jonas-schievink
[rust.git] / src / test / ui / issues / issue-26638.stderr
1 error[E0106]: missing lifetime specifier
2   --> $DIR/issue-26638.rs:1:62
3    |
4 LL | fn parse_type(iter: Box<dyn Iterator<Item=&str>+'static>) -> &str { iter.next() }
5    |                     ------------------------------------     ^ expected named lifetime parameter
6    |
7    = help: this function's return type contains a borrowed value, but the signature does not say which one of `iter`'s 2 lifetimes it is borrowed from
8 help: consider introducing a named lifetime parameter
9    |
10 LL | fn parse_type<'a>(iter: Box<dyn Iterator<Item=&str>+'static>) -> &'a str { iter.next() }
11    |              ^^^^                                                ^^^
12
13 error[E0106]: missing lifetime specifier
14   --> $DIR/issue-26638.rs:4:40
15    |
16 LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() }
17    |                                        ^ expected named lifetime parameter
18    |
19    = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
20 help: consider using the `'static` lifetime
21    |
22 LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &'static str { iter() }
23    |                                        ^^^^^^^^
24
25 error[E0106]: missing lifetime specifier
26   --> $DIR/issue-26638.rs:7:22
27    |
28 LL | fn parse_type_3() -> &str { unimplemented!() }
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 parse_type_3() -> &'static str { unimplemented!() }
35    |                      ^^^^^^^^
36
37 error: aborting due to 3 previous errors
38
39 For more information about this error, try `rustc --explain E0106`.