Skip to content

Simplify parse_limited#155447

Draft
JonathanBrouwer wants to merge 2 commits intorust-lang:mainfrom
JonathanBrouwer:simplify-parse-limited
Draft

Simplify parse_limited#155447
JonathanBrouwer wants to merge 2 commits intorust-lang:mainfrom
JonathanBrouwer:simplify-parse-limited

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

No description provided.

@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 Apr 17, 2026
Comment thread compiler/rustc_attr_parsing/src/interface.rs Outdated
@JonathanBrouwer JonathanBrouwer changed the title Simplify parse_limited and cleanup more attribute parsing Simplify parse_limited Apr 17, 2026
@JonathanBrouwer JonathanBrouwer force-pushed the simplify-parse-limited branch from 25d63eb to 8bc2d3c Compare April 17, 2026 15:31
{
// `UnknownDiagnosticAttribute` is emitted in rustc_resolve/macros.rs
return;
}
Copy link
Copy Markdown
Contributor

@mejrs mejrs Apr 17, 2026

Choose a reason for hiding this comment

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

There are a couple of rustc_resolve types that have a pub on_unknown_attr: Option<OnUnknownData> field.

This change makes it so they can be Some even if the feature is not used. The reason you aren't noticing it is because of this check at the use site:

let (message, label, notes) = if self.tcx.features().diagnostic_on_unknown()
&& let Some(directive) = errors[0].1.on_unknown_attr.as_ref().map(|a| &a.directive)
{

I'm on the fence whether it's worth the effort to "fix" this. But I would like some comments here and there to document whatever we end up with.

View changes since the review

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.

4 participants