Skip to content

Conversation

@JonathanBrouwer
Copy link
Contributor

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 21, 2025
@rust-log-analyzer

This comment has been minimized.

@JonathanBrouwer JonathanBrouwer added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Oct 21, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 25, 2025
…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`
rust-timer added a commit that referenced this pull request Oct 25, 2025
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`
@JonathanBrouwer JonathanBrouwer force-pushed the cfg_macro branch 2 times, most recently from c4a74e6 to c8d68a9 Compare October 29, 2025 21:22
@JonathanBrouwer JonathanBrouwer marked this pull request as ready for review October 29, 2025 21:22
@rustbot
Copy link
Collaborator

rustbot commented Oct 29, 2025

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 29, 2025
@JonathanBrouwer JonathanBrouwer removed the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Oct 29, 2025
#[derive(Copy, Clone)]
pub enum ParsedDescription {
Attribute,
Macro,
Copy link
Contributor

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

@jdonszelmann
Copy link
Contributor

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 3, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 3, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
@rustbot
Copy link
Collaborator

rustbot commented Nov 3, 2025

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.

@JonathanBrouwer
Copy link
Contributor Author

@bors r=jdonszelmann rollup

@bors
Copy link
Collaborator

bors commented Nov 3, 2025

📌 Commit a628e71 has been approved by jdonszelmann

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 3, 2025
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 3, 2025
…zelmann

Port `cfg!()` macro to the new attribute parsing system

r? `@jdonszelmann`
bors added a commit that referenced this pull request Nov 3, 2025
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
@bors bors merged commit 049092a into rust-lang:master Nov 4, 2025
11 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Nov 4, 2025
rust-timer added a commit that referenced this pull request Nov 4, 2025
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)`
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants