-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
tidy: error if a lang feature is already present #102971
Conversation
r? @jyn514 (rust-highfive has picked a reviewer for you, use r? to override) |
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.
Thanks! This looks good to me with one nit :)
src/tools/tidy/src/features.rs
Outdated
Entry::Occupied(e) => { | ||
tidy_error!( | ||
bad, | ||
"{}:{} feature {name} already specified with level '{}'", |
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.
"level" is a weird thing to call this IMO.
"{}:{} feature {name} already specified with level '{}'", | |
"{}:{} feature {name} already specified with status '{}'", |
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.
I guess it comes from "stabilization level" or something, and the variable names already exist in the code, but I will change it.
This comment has been minimized.
This comment has been minimized.
If a lang feature gets declared twice, like for example as a result of a mistake during stabilization, emit an error in tidy. Library features already have this logic.
6f0bed1
to
c278700
Compare
@bors r+ Thanks! |
…, r=jyn514 tidy: error if a lang feature is already present If a lang feature gets declared twice, like for example as a result of a mistake during stabilization, emit an error in tidy. Library features already have this logic. Inspired by a mistake done during `half_open_range_patterns` stabilization: https://github.com/rust-lang/rust/pull/102275/files#r991292215 The PR requires rust-lang#102883 to be merged before CI turns green because the check is doing its job. For reviewers, I suggest [turning off whitespace changes](https://github.com/rust-lang/rust/pull/102971/files?w=1) in the diff by adding `?w=1` to the url, as a large part of the diff is just about removing one level of indentation.
Rollup of 7 pull requests Successful merges: - rust-lang#102641 (Support casting boxes to dyn*) - rust-lang#102836 (rustc_target: Fix json target specs using LLD linker flavors in link args) - rust-lang#102949 (should-skip-this: add missing backslash) - rust-lang#102967 (Add test for issue 102964) - rust-lang#102971 (tidy: error if a lang feature is already present) - rust-lang#102974 (Fix small word dupe typos) - rust-lang#102980 (rustdoc: merge separate `.item-info` CSS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
If a lang feature gets declared twice, like for example as a result of a mistake during stabilization, emit an error in tidy. Library features already have this logic.
Inspired by a mistake done during
half_open_range_patterns
stabilization: https://github.com/rust-lang/rust/pull/102275/files#r991292215The PR requires #102883 to be merged before CI turns green because the check is doing its job.
For reviewers, I suggest turning off whitespace changes in the diff by adding
?w=1
to the url, as a large part of the diff is just about removing one level of indentation.