Skip to content
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

Merged
merged 1 commit into from
Oct 13, 2022

Conversation

est31
Copy link
Member

@est31 est31 commented Oct 12, 2022

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 #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.

@rust-highfive
Copy link
Collaborator

r? @jyn514

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 12, 2022
Copy link
Member

@jyn514 jyn514 left a 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 :)

Entry::Occupied(e) => {
tidy_error!(
bad,
"{}:{} feature {name} already specified with level '{}'",
Copy link
Member

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.

Suggested change
"{}:{} feature {name} already specified with level '{}'",
"{}:{} feature {name} already specified with status '{}'",

Copy link
Member Author

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.

@rust-log-analyzer

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.
@est31 est31 force-pushed the tidy_duplicate_lang_features branch from 6f0bed1 to c278700 Compare October 12, 2022 21:09
@jyn514
Copy link
Member

jyn514 commented Oct 12, 2022

@bors r+

Thanks!

@bors
Copy link
Contributor

bors commented Oct 12, 2022

📌 Commit c278700 has been approved by jyn514

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 12, 2022
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Oct 12, 2022
…, 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.
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 13, 2022
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
@bors bors merged commit 18b1342 into rust-lang:master Oct 13, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants