2017-12-10 13:47:55 -06:00
|
|
|
error[E0106]: missing lifetime specifier
|
2019-05-28 13:46:13 -05:00
|
|
|
--> $DIR/issue-26638.rs:1:62
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2019-05-28 13:46:13 -05:00
|
|
|
LL | fn parse_type(iter: Box<dyn Iterator<Item=&str>+'static>) -> &str { iter.next() }
|
2020-01-27 18:13:45 -06:00
|
|
|
| ------------------------------------ ^ expected named lifetime parameter
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2020-01-27 18:13:45 -06:00
|
|
|
= 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
|
2020-01-17 00:05:31 -06:00
|
|
|
help: consider introducing a named lifetime parameter
|
2020-01-15 20:35:48 -06:00
|
|
|
|
|
2022-06-05 11:33:09 -05:00
|
|
|
LL | fn parse_type<'a>(iter: Box<dyn Iterator<Item=&'a str>+'static>) -> &'a str { iter.next() }
|
|
|
|
| ++++ ++ ++
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
|
|
error[E0106]: missing lifetime specifier
|
2022-06-05 11:33:09 -05:00
|
|
|
--> $DIR/issue-26638.rs:5:40
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() }
|
2020-04-16 23:33:42 -05:00
|
|
|
| ^ expected named lifetime parameter
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2022-06-05 11:33:09 -05:00
|
|
|
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
|
2020-04-17 12:46:22 -05:00
|
|
|
help: consider using the `'static` lifetime
|
2020-04-16 23:33:42 -05:00
|
|
|
|
|
|
|
|
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &'static str { iter() }
|
2022-06-05 11:33:09 -05:00
|
|
|
| +++++++
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
|
|
error[E0106]: missing lifetime specifier
|
2022-06-05 11:33:09 -05:00
|
|
|
--> $DIR/issue-26638.rs:10:22
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | fn parse_type_3() -> &str { unimplemented!() }
|
2020-04-16 23:33:42 -05:00
|
|
|
| ^ expected named lifetime parameter
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
|
|
|
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
|
2020-04-17 12:46:22 -05:00
|
|
|
help: consider using the `'static` lifetime
|
2020-04-16 23:33:42 -05:00
|
|
|
|
|
|
|
|
LL | fn parse_type_3() -> &'static str { unimplemented!() }
|
2022-06-05 11:33:09 -05:00
|
|
|
| +++++++
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/issue-26638.rs:1:69
|
|
|
|
|
|
|
|
|
LL | fn parse_type(iter: Box<dyn Iterator<Item=&str>+'static>) -> &str { iter.next() }
|
2023-01-02 20:00:33 -06:00
|
|
|
| ---- ^^^^^^^^^^^ expected `&str`, found `Option<&str>`
|
2022-06-05 11:33:09 -05:00
|
|
|
| |
|
2023-02-03 17:21:56 -06:00
|
|
|
| expected `&str` because of return type
|
2022-06-05 11:33:09 -05:00
|
|
|
|
|
2023-02-03 17:21:56 -06:00
|
|
|
= note: expected reference `&str`
|
2022-06-05 11:33:09 -05:00
|
|
|
found enum `Option<&str>`
|
|
|
|
|
|
|
|
error[E0061]: this function takes 1 argument but 0 arguments were supplied
|
|
|
|
--> $DIR/issue-26638.rs:5:47
|
|
|
|
|
|
|
|
|
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() }
|
|
|
|
| ^^^^-- an argument of type `&u8` is missing
|
|
|
|
|
|
|
|
|
help: provide the argument
|
|
|
|
|
|
|
|
|
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter(/* &u8 */) }
|
2022-09-01 21:17:44 -05:00
|
|
|
| ~~~~~~~~~~~
|
2022-06-05 11:33:09 -05:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/issue-26638.rs:5:47
|
|
|
|
|
|
|
|
|
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() }
|
2023-01-02 20:00:33 -06:00
|
|
|
| ---- ^^^^^^ expected `&str`, found `&u8`
|
2022-06-05 11:33:09 -05:00
|
|
|
| |
|
|
|
|
| expected `&'static str` because of return type
|
|
|
|
|
|
|
|
|
= note: expected reference `&'static str`
|
|
|
|
found reference `&u8`
|
2017-12-10 13:47:55 -06:00
|
|
|
|
2022-06-05 11:33:09 -05:00
|
|
|
error: aborting due to 6 previous errors
|
2017-12-10 13:47:55 -06:00
|
|
|
|
2022-06-05 11:33:09 -05:00
|
|
|
Some errors have detailed explanations: E0061, E0106, E0308.
|
|
|
|
For more information about an error, try `rustc --explain E0061`.
|