-
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
Don't allow test revisions that conflict with built in cfgs #131930
Conversation
rustbot has assigned @Mark-Simulacrum. Use |
Some changes occurred in src/tools/compiletest cc @jieyouxu |
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 LGTM with one suggestion.
src/tools/compiletest/src/common.rs
Outdated
pub target_cfgs: OnceLock<TargetCfgs>, | ||
pub builtin_cfgs: OnceLock<Vec<String>>, |
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.
Remark: I feel like this is kinda overkill, but I'll see if this is even needed during the rework
Hi @clubby789, its fine. The issue didn't had any comment of anyone working on it, so I thought its up for grabs. |
8f61970
to
51a138e
Compare
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, you can r=me once PR CI is green.
51a138e
to
3b99cbe
Compare
@heysujal |
This is already covered by the deny-by-default What is the advantage over the native check in rustc? Also the |
I could see that error getting easily lost in a compile-fail test. test could make sense to remove though |
The preset handling in compiletest is such that revisions are handled as early props but compile flagd are handled at late props. Revisions set cfgs of revision names implicitly and its very confusing for the end user seeing the lint fire only when the test is about to run, I would like revision names that share same name as builtin cfg names to get rejected earlier so it's obvious it's an invalid revision name. |
Default::default(), | ||
) | ||
.lines() | ||
.map(|l| if let Some((name, _)) = l.split_once('=') { name.to_string() } else { l.to_string() }) |
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.
Just a FWIW, this parsing is quite primitive, it doesn't handle the --print=check-cfg
specifics, fortunately this is only collecting names and shouldn't be in any specific case so it should always work.
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.
Yeah, this is only querying for the cfg name, otherwise this can't be used
Also @Urgau good point about |
☔ The latest upstream changes (presumably #131948) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors r- (needs a rebase and explicitly adding |
3b99cbe
to
2e3091d
Compare
@bors r=jieyouxu |
Rollup of 10 pull requests Successful merges: - rust-lang#130225 (Rename Receiver -> LegacyReceiver) - rust-lang#131169 (Fix `target_vendor` in QNX Neutrino targets) - rust-lang#131623 (misc cleanups) - rust-lang#131756 (Deeply normalize `TypeTrace` when reporting type error in new solver) - rust-lang#131898 (minor `*dyn` cast cleanup) - rust-lang#131909 (Prevent overflowing enum cast from ICEing) - rust-lang#131930 (Don't allow test revisions that conflict with built in cfgs) - rust-lang#131956 (coverage: Pass coverage mappings to LLVM as separate structs) - rust-lang#132076 (HashStable for rustc_feature::Features: stop hashing compile-time constant) - rust-lang#132088 (Print safety correctly in extern static items) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#131930 - clubby789:revision-cfg-collide, r=jieyouxu Don't allow test revisions that conflict with built in cfgs Fixes rust-lang#128964 Sorry `@heysujal` I started working on this about 1 minute before your comment by complete coincidence 😅
Fixes #128964
Sorry @heysujal I started working on this about 1 minute before your comment by complete coincidence 😅