Skip to content

Port rustc_reservation_impl to the new attribute parser#152180

Open
jdonszelmann wants to merge 1 commit intorust-lang:mainfrom
jdonszelmann:port-rustc-reservation-impl
Open

Port rustc_reservation_impl to the new attribute parser#152180
jdonszelmann wants to merge 1 commit intorust-lang:mainfrom
jdonszelmann:port-rustc-reservation-impl

Conversation

@jdonszelmann
Copy link
Contributor

@rustbot
Copy link
Collaborator

rustbot commented Feb 5, 2026

Some changes occurred in compiler/rustc_attr_parsing

cc @JonathanBrouwer

Some changes occurred in compiler/rustc_hir/src/attrs

cc @JonathanBrouwer

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @JonathanBrouwer

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 5, 2026
RustcReallocator,

/// Represents `#[rustc_reservation_impl]`
RustcReservationImpl(Span, Option<Symbol>),
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the argument for this should be optional, the template is template!(NameValueStr: "reservation message") and I don't see it used without an argument anywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the template is wrong (and I updated it), old code assumes its optional (which was never checked) and some tests do use it without

Copy link
Contributor

@JonathanBrouwer JonathanBrouwer Feb 5, 2026

Choose a reason for hiding this comment

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

I think the only place that still uses it optionally is a random rust-analyzer test, from what I can find.

I have some doubts about how correct the logic in rustc_trait_selection is if we don't have a message, there the attribute seems to be ignored if it has no message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm, it looked like that was only for diagnostics, but fair lemme make it required

@JonathanBrouwer
Copy link
Contributor

@rustbot author

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 5, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 5, 2026

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

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 5, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 6, 2026

☔ The latest upstream changes (presumably #152213) made this pull request unmergeable. Please resolve the merge conflicts.

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-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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants