blob: 3df58d66d1f8e34a94edd61b741c60260dd99c68 [file] [log] [blame]
error[E0106]: missing lifetime specifier
--> $DIR/issue-26638.rs:1:62
|
LL | fn parse_type(iter: Box<dyn Iterator<Item=&str>+'static>) -> &str { iter.next() }
| ------------------------------------ ^ expected named lifetime parameter
|
= 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
help: consider introducing a named lifetime parameter
|
LL | fn parse_type<'a>(iter: Box<dyn Iterator<Item=&str>+'static>) -> &'a str { iter.next() }
| ^^^^ ^^^
error[E0106]: missing lifetime specifier
--> $DIR/issue-26638.rs:4:40
|
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() }
| ^ expected named lifetime parameter
|
= help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
help: consider using the `'static` lifetime
|
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &'static str { iter() }
| ^^^^^^^^
error[E0106]: missing lifetime specifier
--> $DIR/issue-26638.rs:7:22
|
LL | fn parse_type_3() -> &str { unimplemented!() }
| ^ 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 parse_type_3() -> &'static str { unimplemented!() }
| ^^^^^^^^
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0106`.