-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
provide suggestion for incorrect deprecated syntax #56896
Conversation
I'd r+, but I'm worried about anyone out there incorrectly using I'll do a crater run to make sure we don't blow anything up, otherwise happy with the change. If there's lots of usage in the wild, this will have to be changed to be a deprecation lint (like #55373). @bors try |
⌛ Trying commit d4aea02 with merge bad365140e1e8233b42b21af70a407f14ce5fec5... |
💥 Test timed out |
@craterbot run start=master#adbfec229ce07ff4b2a7bf2d6dec2d13cb224980 end=try#bad365140e1e8233b42b21af70a407f14ce5fec5 mode=check-only |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
@euclio It seems like we'll have to turn it into a warning or (ideally) lint, and reach out to |
Sorry for the problems :-|. I've released a fix for that. But going through the crater report randomly, it seems there are other ones too. |
@vorner no need to apologize, if we didn't want you to write the attribute that way we should have made it a hard error :) @euclio do you think you'll be able to turn this into a lint? That way we can merge it as allow by default, and a few releases down the line enable it as warn and finally deny by default. |
Hmm... Even tho it wasn't mandated by an RFC, given that cc @rust-lang/lang @rust-lang/libs |
Not only is it harmless, I think this is the only reasonable option-- lots of code has used (note: not all code is checked by crater, either-- this change would break several crates inside of Fuchsia that were previously using |
I would prefer going with a future-incompat lint here instead of deviating from the RFC. As an aside, attribute parsing is extremely lax in various places in the compiler. I think that we should require stricter parsing tests for stabilization of new attributes to avoid this situation in the future. |
@Centril I would still like to add it as a lint, so that individual projects can require the newer syntax at will. I don't think we could change this to deny-by-default until the next epoch. |
I would be OK with an
I don't think we should change it even in Rust 2021. |
To be clear, I don't think we should error either. I'm arguing for a warn-by-default future-incompat lint. |
A warn-by-default |
Yes, that would be my intention. Likely in the next edition. |
Right; what I'm saying is that I don't think we should make it an error ever because the churn doesn't seem worth it and doing it in an edition would make it even more complicated than supporting it. :) |
Either way I'd rather warn and fix it automatically via |
@euclio My preference is that |
I understand, but I'd prefer to stick with the syntax specified in the RFC. I'll defer to the Lang team's decision, however. |
If I may add my humble 2 cents, there's something good on „one correct way to do things“ so if the |
I'd be happy with keeping the deprecated syntax for deprecated, and treating it as the note, as long as we have a warn-by-default lint for the very specific case where the value looks like a semver. |
@joshtriplett That seems fine to me tho I wonder if it will arise in practice? |
☔ The latest upstream changes (presumably #57321) made this pull request unmergeable. Please resolve the merge conflicts. |
How does this fit in with #57321 and the |
Discussed briefly in the @rust-lang/lang meeting today. All present agreed that we might as well "retcon" the |
Ok, I'll close this PR and open an implementation of the "retcon" within a few days, then. Thanks for the input, everyone! |
…rochenkov allow shorthand syntax for deprecation reason Fixes rust-lang#48271. Created based on discussion in rust-lang#56896.
…rochenkov allow shorthand syntax for deprecation reason Fixes rust-lang#48271. Created based on discussion in rust-lang#56896.
…rochenkov allow shorthand syntax for deprecation reason Fixes rust-lang#48271. Created based on discussion in rust-lang#56896.
Fixes #48271.
r? @estebank