Diagnostic hints emitted on unresolved method calls that suggest qualified associated function calls don't account for more complex self types #120379
Labels
A-associated-items
Area: Associated items (types, constants & functions)
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Uplifted from #118911 (comment) and further noticed while reviewing #119957.
With “more complex self types” I mean self types like
Box<Self>
,Rc<Self>
etc. &feature(arbitrary_self_types)
, basically anything other thanSelf
,&&...Self
and&mut &mut... Self
.Given:
We currently output:
However,
<Box<S> as $Trait>::f(Box::new(S))
is not correct ($Trait
∊ {TraitA
,TraitB
}).We should either suggest
or
Given:
We should output the following:
The text was updated successfully, but these errors were encountered: