Skip to content

Port #[path] to the new attribute parsing infrastructure #143344

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

Merged
merged 2 commits into from
Jul 7, 2025

Conversation

JonathanBrouwer
Copy link
Contributor

@JonathanBrouwer JonathanBrouwer commented Jul 2, 2025

Ports #[path] to the new attribute parsing infrastructure for #131229 (comment)

This PR duplicates a change from #143237
Draft until that one is merged

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 2, 2025
@JonathanBrouwer JonathanBrouwer changed the title Path parser Port #[path] to the new attribute parsing infrastructure Jul 2, 2025
@@ -267,6 +267,36 @@ pub fn check_builtin_meta_item(
deny_unsafety: bool,
) {
if !is_attr_template_compatible(&template, &meta.kind) {
// attrs with new parsers are locally validated so excluded here
Copy link
Contributor Author

@JonathanBrouwer JonathanBrouwer Jul 2, 2025

Choose a reason for hiding this comment

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

This move is in a separate commit for reviewability.
It is needed because

pub fn emit_fatal_malformed_builtin_attribute(
also calls emit_malformed_attribute and is not using the new parser (yet?), so should still emit the lint even for parsed attributes

@@ -26,6 +26,7 @@ use crate::attributes::link_attrs::{LinkNameParser, LinkSectionParser};
use crate::attributes::lint_helpers::{AsPtrParser, PubTransparentParser};
use crate::attributes::loop_match::{ConstContinueParser, LoopMatchParser};
use crate::attributes::must_use::MustUseParser;
use crate::attributes::path::PathParser as PathAttributeParser;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needed because this file contains an unrelated thing called PathParser already

@bors
Copy link
Collaborator

bors commented Jul 3, 2025

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

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 3, 2025
@JonathanBrouwer
Copy link
Contributor Author

^ Rebased on master
@rustbot ready
r? @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 Jul 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 4, 2025

jdonszelmann is currently at their maximum review capacity.
They may take a while to respond.

@JonathanBrouwer JonathanBrouwer marked this pull request as ready for review July 4, 2025 11:01
@rustbot
Copy link
Collaborator

rustbot commented Jul 4, 2025

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

Some changes occurred in compiler/rustc_attr_data_structures

cc @jdonszelmann

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

cc @jdonszelmann

@bors
Copy link
Collaborator

bors commented Jul 4, 2025

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

@JonathanBrouwer
Copy link
Contributor Author

@jdonszelmann ^ Rebased on master
This one next when you have time to review? It shouldn't conflict with #143539

@jdonszelmann
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 6, 2025

📌 Commit 244d64e 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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 6, 2025
bors added a commit that referenced this pull request Jul 7, 2025
Rollup of 9 pull requests

Successful merges:

 - #143206 (Align attr fixes)
 - #143236 (Stabilize `mixed_integer_ops_unsigned_sub`)
 - #143344 (Port `#[path]` to the new attribute parsing infrastructure )
 - #143359 (Link to 2024 edition page for `!` fallback changes)
 - #143456 (mbe: Change `unused_macro_rules` to a `DenseBitSet`)
 - #143529 (Renamed retain_mut to retain on LinkedList as mentioned in the ACP)
 - #143535 (Remove duplicate word)
 - #143544 (compiler: rename BareFn to FnPtr)
 - #143552 (lib: more eagerly return `self.len()` from `ceil_char_boundary`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 11b24c1 into rust-lang:master Jul 7, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 7, 2025
rust-timer added a commit that referenced this pull request Jul 7, 2025
Rollup merge of #143344 - JonathanBrouwer:path-parser, r=jdonszelmann

Port `#[path]` to the new attribute parsing infrastructure

Ports `#[path]` to the new attribute parsing infrastructure for #131229 (comment)

This PR duplicates a change from #143237
Draft until that one is merged
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.

4 participants