-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Port cfg!() macro to the new attribute parsing system
#147945
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
Conversation
This comment has been minimized.
This comment has been minimized.
e4bea66 to
58efee4
Compare
…lmann Improvements to attribute suggestions Changes in commit 1: - Add `AcceptContext::suggestions`, which retrieves the suggestions for the currently parsing attribute - This happens to fix a bug in the way `#[macro_export`]. Closes rust-lang#147987 Changes in commit 2: - Add a check to the suggestions function so the suggestions for attributes in cfg_attr are nicer. Fixes rust-lang#147693 This is also part (but not all) of the changes needed to unblock rust-lang#147945 r? `@jdonszelmann`
Rollup merge of #148000 - JonathanBrouwer:wipnew2, r=jdonszelmann Improvements to attribute suggestions Changes in commit 1: - Add `AcceptContext::suggestions`, which retrieves the suggestions for the currently parsing attribute - This happens to fix a bug in the way `#[macro_export`]. Closes #147987 Changes in commit 2: - Add a check to the suggestions function so the suggestions for attributes in cfg_attr are nicer. Fixes #147693 This is also part (but not all) of the changes needed to unblock #147945 r? `@jdonszelmann`
c4a74e6 to
c8d68a9
Compare
|
Some changes occurred in compiler/rustc_attr_parsing |
| #[derive(Copy, Clone)] | ||
| pub enum ParsedDescription { | ||
| Attribute, | ||
| Macro, |
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.
could you comment on the reason why this is needed? It's not obvious that we're using an attribute parser for non-attributes. r=me after that
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
c8d68a9 to
a628e71
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r=jdonszelmann rollup |
…zelmann Port `cfg!()` macro to the new attribute parsing system r? `@jdonszelmann`
Rollup of 7 pull requests Successful merges: - #147141 (Suggest making binding `mut` on `&mut` reborrow) - #147945 (Port `cfg!()` macro to the new attribute parsing system ) - #147951 (Add check for `+=` typo in let chains) - #148004 (fix: Only special case single line item attribute suggestions) - #148264 (reflect that type and const parameter can be intermixed) - #148363 (Fix `wasm_import_module` attribute cross-crate) - #148447 (Tweak E0401) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #147945 - JonathanBrouwer:cfg_macro, r=jdonszelmann Port `cfg!()` macro to the new attribute parsing system r? ``@jdonszelmann``
| | ^^^^^^^^--^ | ||
| | | | | ||
| | | expected a single argument here | ||
| | help: must be of the form: `cfg(predicate)` |
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.
this should be cfg!(predicate), right?
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.
True! Good spot, I'll make sure to fix it
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.
r? @jdonszelmann