2017-12-10 22:47:55 +03:00
|
|
|
error[E0106]: missing lifetime specifier
|
2019-05-28 14:46:13 -04:00
|
|
|
--> $DIR/issue-26638.rs:1:62
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2019-05-28 14:46:13 -04:00
|
|
|
LL | fn parse_type(iter: Box<dyn Iterator<Item=&str>+'static>) -> &str { iter.next() }
|
2020-01-27 16:13:45 -08:00
|
|
|
| ------------------------------------ ^ expected named lifetime parameter
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2020-01-27 16:13:45 -08: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-16 22:05:31 -08:00
|
|
|
help: consider introducing a named lifetime parameter
|
2020-01-15 18:35:48 -08:00
|
|
|
|
|
2022-06-05 18:33:09 +02:00
|
|
|
LL | fn parse_type<'a>(iter: Box<dyn Iterator<Item=&'a str>+'static>) -> &'a str { iter.next() }
|
|
|
|
|
| ++++ ++ ++
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
|
|
|
error[E0106]: missing lifetime specifier
|
2024-03-19 20:58:37 +00:00
|
|
|
--> $DIR/issue-26638.rs:4:40
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() }
|
2020-04-16 21:33:42 -07:00
|
|
|
| ^ expected named lifetime parameter
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2022-06-05 18:33:09 +02:00
|
|
|
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
|
2023-11-14 20:36:49 +00:00
|
|
|
help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`
|
2020-04-16 21:33:42 -07:00
|
|
|
|
|
|
|
|
|
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &'static str { iter() }
|
2022-06-05 18:33:09 +02:00
|
|
|
| +++++++
|
2023-11-14 20:36:49 +00:00
|
|
|
help: instead, you are more likely to want to change the argument to be borrowed...
|
|
|
|
|
|
|
|
|
|
|
LL | fn parse_type_2(iter: &fn(&u8)->&u8) -> &str { iter() }
|
|
|
|
|
| +
|
2023-11-14 22:41:45 +00:00
|
|
|
help: ...or alternatively, you might want to return an owned value
|
2023-11-14 20:36:49 +00:00
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() }
|
|
|
|
|
LL + fn parse_type_2(iter: fn(&u8)->&u8) -> String { iter() }
|
|
|
|
|
|
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
|
|
|
error[E0106]: missing lifetime specifier
|
2025-03-03 05:14:52 +00:00
|
|
|
--> $DIR/issue-26638.rs:8:22
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | fn parse_type_3() -> &str { unimplemented!() }
|
2020-04-16 21:33:42 -07:00
|
|
|
| ^ expected named lifetime parameter
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
|
|
|
|
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
|
2023-11-14 20:36:49 +00:00
|
|
|
help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`
|
2020-04-16 21:33:42 -07:00
|
|
|
|
|
|
|
|
|
LL | fn parse_type_3() -> &'static str { unimplemented!() }
|
2022-06-05 18:33:09 +02:00
|
|
|
| +++++++
|
2023-11-14 20:36:49 +00:00
|
|
|
help: instead, you are more likely to want to return an owned value
|
|
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - fn parse_type_3() -> &str { unimplemented!() }
|
|
|
|
|
LL + fn parse_type_3() -> String { unimplemented!() }
|
|
|
|
|
|
|
2022-06-05 18:33:09 +02:00
|
|
|
|
|
|
|
|
error[E0061]: this function takes 1 argument but 0 arguments were supplied
|
2024-03-19 20:58:37 +00:00
|
|
|
--> $DIR/issue-26638.rs:4:47
|
2022-06-05 18:33:09 +02:00
|
|
|
|
|
|
|
|
|
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() }
|
2024-05-12 16:40:59 +09:00
|
|
|
| ^^^^-- argument #1 of type `&u8` is missing
|
2022-06-05 18:33:09 +02:00
|
|
|
|
|
|
|
|
|
help: provide the argument
|
|
|
|
|
|
|
2025-02-20 23:05:38 +00:00
|
|
|
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter(/* &u8 */) }
|
|
|
|
|
| +++++++++
|
2022-06-05 18:33:09 +02:00
|
|
|
|
2025-03-03 05:14:52 +00:00
|
|
|
error: aborting due to 4 previous errors
|
2017-12-10 22:47:55 +03:00
|
|
|
|
2025-03-03 05:14:52 +00:00
|
|
|
Some errors have detailed explanations: E0061, E0106.
|
2022-06-05 18:33:09 +02:00
|
|
|
For more information about an error, try `rustc --explain E0061`.
|