Suggest using a struct's name instead of Self #102840
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3c81ead494d0897d6cd49f20d51302df
The current output is:
Ideally the output should look like:
Using
Self
instead of the struct name whenself
and the return type of the method only differs in lifetimes will never work, and the user must write the returned struct value with the struct name, without referring toSelf
. The help note for thereborrow_explicit_lts
is especially egregious because adding the bound'a: 'w
actually makes the method completely defeat its own purpose of returning the same value with a shorter lifetime.The text was updated successfully, but these errors were encountered: