Closed
Description
fn x<'a>(x: &mut 'a i32){}
Expected result: a diagnostic suggests placing 'a
before mut
Actual diagnostic output:
Compiling playground v0.0.1 (/playground)
error: lifetime in trait object type must be followed by `+`
--> src/lib.rs:1:18
|
1 | fn x<'a>(x: &mut 'a i32){}
| ^^
error: expected one of `:`, `@`, or `|`, found `)`
--> src/lib.rs:1:24
|
1 | fn x<'a>(x: &mut 'a i32){}
| ^ expected one of `:`, `@`, or `|`
|
= note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
help: if this was a parameter name, give it a type
|
1 | fn x<'a>(x: &mut 'a i32: TypeName){}
| ^^^^^^^^^^^^^
help: if this is a type, explicitly ignore the parameter name
|
1 | fn x<'a>(x: &mut 'a _: i32){}
| ^^^^^^
error: expected one of `)` or `,`, found `i32`
--> src/lib.rs:1:21
|
1 | fn x<'a>(x: &mut 'a i32){}
| -^^^ expected one of `)` or `,`
| |
| help: missing `,`
warning: trait objects without an explicit `dyn` are deprecated
--> src/lib.rs:1:18
|
1 | fn x<'a>(x: &mut 'a i32){}
| ^^ help: use `dyn`: `dyn 'a`
|
= note: `#[warn(bare_trait_objects)]` on by default
error[E0224]: at least one trait is required for an object type
--> src/lib.rs:1:18
|
1 | fn x<'a>(x: &mut 'a i32){}
| ^^
error: aborting due to 4 previous errors; 1 warning emitted
For more information about this error, try `rustc --explain E0224`.
error: could not compile `playground`.
To learn more, run the command again with --verbose.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsCategory: This is a bug.Diagnostics: Confusing error or lint that should be reworked.Diagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: Too much output caused by a single piece of incorrect code.High priorityPerformance or correctness regression from one stable version to another.