You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Misleading error when using fully qualified trait syntax without trait #98565
error[E0576]: cannot find method or associated constant `trim` in `str`
--> src/lib.rs:6:24
|
6 | <Self as str>::trim(self);
| ^^^^ not found in `str`
For more information about this error, try `rustc --explain E0576`.
However, str is not a trait, therefore the fully-qualified trait syntax should be simply invalid in this case - therefore, the error would better say the real problem ("str is not a trait"), probably with the help message suggesting the commented-out line.
error[E0576]: cannot find method or associated constant `trim` in `str`
--> src/lib.rs:6:24
|
6 | <Self as str>::trim(self);
| ^^^^ `str` is not a trait
For more information about this error, try `rustc --explain E0576`.
Not sure, to be honest. This might even better not be E0576, since the problem is not that "something wasn't found for the type" - it's "there's no type to search in".
Activity
lyming2007 commentedon Jul 12, 2022
Did you mean the ideal output should like:
?
Cerber-Ursi commentedon Jul 12, 2022
Not sure, to be honest. This might even better not be E0576, since the problem is not that "something wasn't found for the type" - it's "there's no type to search in".
estebank commentedon Oct 4, 2024
Current output:
jannden commentedon Oct 20, 2024
I would like to give it a try and add the test for this.
@rustbot claim
jannden commentedon Oct 21, 2024
@rustbot review
rustbot commentedon Oct 21, 2024
Error: The "Ready" shortcut only works on pull requests.
Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.
Rollup merge of rust-lang#131991 - jannden:issue-98565-test, r=jieyouxu
Auto merge of rust-lang#132005 - matthiaskrgr:rollup-ced4upi, r=matth…
Unrolled build for rust-lang#131991