Warn on redundant --cfg directive when revisions are used#131925
Merged
bors merged 1 commit intorust-lang:masterfrom Oct 20, 2024
Merged
Warn on redundant --cfg directive when revisions are used#131925bors merged 1 commit intorust-lang:masterfrom
--cfg directive when revisions are used#131925bors merged 1 commit intorust-lang:masterfrom
Conversation
Collaborator
jieyouxu
approved these changes
Oct 19, 2024
Member
jieyouxu
left a comment
There was a problem hiding this comment.
Thanks, you can r=me after addressing the nit.
src/tools/compiletest/src/runtest.rs
Outdated
| let normalized_revision = normalize_revision(revision); | ||
| cmd.args(&["--cfg", &normalized_revision]); | ||
| let cfg_arg = ["--cfg", &normalized_revision]; | ||
| if self.props.compile_flags.windows(2).any(|args| args == cfg_arg) { |
Member
There was a problem hiding this comment.
Remark: IIRC, the compile_flags splitting is naive above (e.g. --meow="foo bar" -> -meow="foo and bar" but it's better than nothing here.
Member
There was a problem hiding this comment.
The flag splitter knows how to handle '--meow=foo bar', but in all other cases it will naïvely split on whitespace yeah.
Urgau
reviewed
Oct 19, 2024
Member
At the moment the directive handling is neigh untestable, which is why I am still figuring out a design to rework it. I'm okay with YOLOing this change in before that is possible, though. |
e39b7ae to
7cc7974
Compare
7cc7974 to
d82a21f
Compare
jieyouxu
approved these changes
Oct 19, 2024
Contributor
Author
|
@bors r=jieyouxu |
Collaborator
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Oct 19, 2024
…r=jieyouxu Warn on redundant `--cfg` directive when revisions are used r? `@jieyouxu` Fixes rust-lang#131390 Not sure of the best way to test this
This was referenced Oct 19, 2024
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 19, 2024
…iaskrgr Rollup of 12 pull requests Successful merges: - rust-lang#116863 (warn less about non-exhaustive in ffi) - rust-lang#127675 (Remove invalid help diagnostics for const pointer) - rust-lang#131772 (Remove `const_refs_to_static` TODO in proc_macro) - rust-lang#131789 (Make sure that outer opaques capture inner opaques's lifetimes even with precise capturing syntax) - rust-lang#131795 (Stop inverting expectation in normalization errors) - rust-lang#131920 (Add codegen test for branchy bool match) - rust-lang#131921 (replace STATX_ALL with (STATX_BASIC_STATS | STATX_BTIME) as former is deprecated) - rust-lang#131925 (Warn on redundant `--cfg` directive when revisions are used) - rust-lang#131931 (Remove unnecessary constness from `lower_generic_args_of_path`) - rust-lang#131932 (use tracked_path in rustc_fluent_macro) - rust-lang#131936 (feat(rustdoc-json-types): introduce rustc-hash feature) - rust-lang#131939 (Get rid of `OnlySelfBounds`) Failed merges: - rust-lang#131181 (Compiletest: Custom differ) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 20, 2024
Rollup merge of rust-lang#131925 - clubby789:redundant-revision-cfg, r=jieyouxu Warn on redundant `--cfg` directive when revisions are used r? ``@jieyouxu`` Fixes rust-lang#131390 Not sure of the best way to test this
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
r? @jieyouxu
Fixes #131390
Not sure of the best way to test this