- Notifications
You must be signed in to change notification settings - Fork 13.9k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTP-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Code
impl<TkCanvas<Inst>> Deref for ChartDisplay<Inst> { // Note the incorrect `<TkCanvas<Inst>>` type Target = TkCanvas<Inst>; fn deref(&self) -> &Self::Target { &self.hull } }Current output
error: expected `::`, found `Deref` --> src/lib.rs:6:22 | 6 | impl<TkCanvas<Inst>> Deref for ChartDisplay<Inst> { | ^^^^^ expected `::`Desired output
error: expected type parameter, found path `TkCanvas<Inst>` --> src/lib.rs:6:22 | 6 | impl<TkCanvas<Inst>> Deref for ChartDisplay<Inst> { | ^^^^^^^^^^^^^^ expected type parameter, found path | help: you might have meant to bind a type parameter to a trait | 6 | impl<T: TkCanvas<Inst>> Deref for ChartDisplay<Inst> { | ++ help: alternatively, you might have meant to introduce type parameter | 6 | impl<Inst> Deref for ChartDisplay<Inst> { | ++++Rationale and extra context
Found in the wild at https://users.rust-lang.org/t/help-me-understand-this-compiler-error/134753
Other cases
Rust Version
1.90.0Anything else?
No response
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTP-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.