-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Incorrect suggestion for function parameter of type str
#82820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Assigning |
I've bisected to this nightly range: +nightly-2020-07-12-x86_64-unknown-linux-gnu (I cannot bisect further because in between of that range I cannot install nightlies 🤷♂️ ) |
Funny enough, when using
|
This seems to be fixed on nighlty, but not on beta... somewhere between 5a4ab26...9d9c2c9 Fixed in 9d9c2c9 Fixed by #84313 So this can be closed @camelid 🎉 |
But, as a sidenote: How could this ever be commited to master? I mean, it's obviosly wrong so say I hope, that in the future the review process can be improved to detect such errors early on. The error was introduced in #78152, where the test has been adapted to match the wrong syntax, but nobody has seen this :( Let's hope in the future it will get noticed right away 😊 |
It looks like that PR caused a bunch of small diagnostics changes, so the reviewers probably just missed that bug. |
Assigning myself for adding a test. @rustbot claim |
This is a regression test for rust-lang#82820. This test case is included in more general tests, but I think the error regressed because there were a bunch of other diagnostic changes in the test that obscured this regression. Hopefully, having a test specific to the suggestion, and running rustfix for the test, will prevent this error from regressing in the future.
(Playground)
Errors:
Applying the suggestion leads to yet more errors. The new errors do suggest using
&str
, but they still suggest invalid code:After applying the new suggestions, I get:
This seems likely to send new users in circles.
The text was updated successfully, but these errors were encountered: