-
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
Rename some Rust 2021 lints to better names #86717
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Apparently, yes:
(Seems like this already happened a while ago, and I just missed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I'm only wondering if reserved_prefixes
is the right name. If we add f""
or z""
or k#yeet
later in Rust 2021, then these aren't really 'reserved' prefixes. Just prefixes that have a meaning in Rust 2021 and not before.
Maybe rust_2021_incompatible_prefix
or just rust_2021_prefix
? Or something. Not sure.
This comment has been minimized.
This comment has been minimized.
|
To me Edit: or |
Suggestions (from above and from me):
I'm sympathetic to @petrochenkov's concern about "prefix" being pretty generic, but I do worry that "token_prefix" is too jargon filled. |
"Token" is a pretty central terminology for the proc macro API which is stable and public. |
I don't think it's worth stressing too much about "prefixes" vs "token prefixes" -- isn't this an "allow by default" lint? Few people will ever name it explicitly. I do like "rust_2021_incompatible" instead of "reserved". I think that's a good convention for "allow by default" lints. |
@rylev I guess your thinking with "rust_2021_token_prefixes" is that this only warns on things that became a prefix in Rust 2021 (e.g., That makes sense to me, I can run live with it. |
I was previously in favor of @m-ou-se had a counter argument though:
I'm unsure that I agree with the argument "deny(rust_2021_prefixes) makes it sound like that'd deny f"" in Rust 2021", but as @danielhenrymantilla mentioned, there's no real penalty for being verbose, but there could be for being too terse. With this in mind, @m-ou-se suggested |
@nikomatsakis the two remaining questions:
|
That works for me.
As a rename? This one is (iirc) warn by default, so the name is more likely to be something users are exposed to. Still, I think it's name is not wrong -- it just fails to describe the edition-dependent nature of it? I think we can leave it personally. |
Leaving |
☔ The latest upstream changes (presumably #86231) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors delegate+ |
✌️ @rylev can now approve this pull request |
@bors r+ |
📌 Commit d4e384b has been approved by |
Rollup of 8 pull requests Successful merges: - rust-lang#80918 (Add Integer::log variants) - rust-lang#86717 (Rename some Rust 2021 lints to better names ) - rust-lang#86819 (Clean up rustdoc IDs) - rust-lang#86880 (Test ManuallyDrop::clone_from.) - rust-lang#86906 (Replace deprecated compare_and_swap and fix typo in core::sync::atomic::{fence, compiler_fence} docs) - rust-lang#86907 (Migrate `cpu-usage-over-time.py` to Python 3) - rust-lang#86916 (rewrote documentation for thread::yield_now()) - rust-lang#86919 (Update books) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 8 pull requests Successful merges: - rust-lang#80918 (Add Integer::log variants) - rust-lang#86717 (Rename some Rust 2021 lints to better names ) - rust-lang#86819 (Clean up rustdoc IDs) - rust-lang#86880 (Test ManuallyDrop::clone_from.) - rust-lang#86906 (Replace deprecated compare_and_swap and fix typo in core::sync::atomic::{fence, compiler_fence} docs) - rust-lang#86907 (Migrate `cpu-usage-over-time.py` to Python 3) - rust-lang#86916 (rewrote documentation for thread::yield_now()) - rust-lang#86919 (Update books) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Updated changelog for 1.55 This has again been a bit of work, but I'm happy to notice that my English is still improving, and I'm getting faster at these things. That's a very nice side effect of contributing and getting feedback on reviews 😊 Moving on, there were a few things that I was unsure about: * The PR rust-lang/rust#86717 changes an old entry in the change log, is this worth mentioning? I've left it out for now. * The stabilization of `cargo clippy --fix` is quite awesome and important IMO. It sadly gets a bit lost in the *Other* entry, as it's the last one. Do we maybe want to move it somewhere else or change the headline order for this release? * I've listed the introduction of the new `suspicious` group under the *Moves and Deprecations* section. Is this alright, or should it be moved to the *Other* section as well? * Last but definitely not least, some fun! I've used the 🎉 emoji in the `cargo clippy --fix` entry, is this okay? Sorry for the bombardment of questions xD --- The PR already includes the entries for the new metadata collection and website updates. These are not merged yet, but should probably be to make this correct. This might also require the commit hashes to be updated (Not sure on this, though). It would actually be super fitting to get this into this release as we also stabilize `--fix`. TODOs: * [x] Merge metadata collection PRs: 1. #7279 2. #7298 3. #7420 (Hope to not get any merge conflicts) --- [Rendered 📰](https://github.com/xFrednet/rust-clippy/blob/changelog-1-55/CHANGELOG.md) r? `@flip1995` changelog: none
Based on conversation in #85894.
Rename a bunch of Rust 2021 related lints:
Lints that are officially renamed because they are already in beta or stable:
disjoint_capture_migration
=>rust_2021_incompatible_closure_captures
or_patterns_back_compat
=>rust_2021_incompatible_or_patterns
non_fmt_panic
=>non_fmt_panics
Lints that are renamed but don't require any back -compat work since they aren't yet in stable:
future_prelude_collision
=>rust_2021_prelude_collisions
reserved_prefix
=>rust_2021_token_prefixes
Lints that have been discussed but that I did not rename:
non_fmt_panic
andbare_trait_object
: is making this plural worth the headache we might cause users?array_into_iter
: I'm unsure of a good name and whether bothering users with a name change is worth it.r? @nikomatsakis