-
Notifications
You must be signed in to change notification settings - Fork 13k
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
driver: Disallow predicates in --cfg specs #31499
Conversation
r? @brson |
(rust_highfive has picked a reviewer for you, use r? to override) |
} | ||
|
||
if sopts.cfg.iter().any(|item| is_meta_list(&*item)) { | ||
early_error(output, "predicates are not allowed in --cfg"); |
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.
Not sure about error message, or if we should print the offending flags as well. Input welcome!
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.
How about something "invalid predicate in --cfg command line argument: foo(whatever)", printing the actual argument. That mirrors the in-source error a little better and says where the error is.
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.
Sounds good. I'll make the change after finding out how to print more than one error, since the user could have passed multiple offending flags. (This is my first time in the compiler's code.)
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.
Done in kamalmarhubi@c32c7c2
A spec like `#[cfg(foo(bar))]` is not allowed as an attribute. This makes the same spec be rejected by the compiler if passed in as a `--cfg` argument. Fixes rust-lang#31495
db425a4
to
6d2c866
Compare
@brson any thoughts on whether the check should be in the |
@kamalmarhubi early. @bors r+ Thanks! |
📌 Commit c32c7c2 has been approved by |
A spec like `#[cfg(foo(bar))]` is not allowed as an attribute. This makes the same spec be rejected by the compiler if passed in as a `--cfg` argument. Fixes #31495
A spec like
#[cfg(foo(bar))]
is not allowed as an attribute. Thismakes the same spec be rejected by the compiler if passed in as a
--cfg
argument.Fixes #31495