-
Notifications
You must be signed in to change notification settings - Fork 13.4k
New attribute parsing infrastructure #135726
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r? @Noratrieb rustbot has assigned @Noratrieb. Use |
053b11b
to
5a3ac64
Compare
This comment has been minimized.
This comment has been minimized.
5a3ac64
to
bbdb095
Compare
This comment has been minimized.
This comment has been minimized.
r? oli-obk |
bbdb095
to
5d70659
Compare
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
4d3437f
to
b3d6ef4
Compare
This comment has been minimized.
This comment has been minimized.
b3d6ef4
to
7319c1a
Compare
This comment has been minimized.
This comment has been minimized.
4aaff39
to
2f73b56
Compare
This comment has been minimized.
This comment has been minimized.
2f73b56
to
e8773d9
Compare
jdonszelmann
commented
Jan 20, 2025
jdonszelmann
commented
Jan 20, 2025
jdonszelmann
commented
Jan 20, 2025
klensy
reviewed
Feb 25, 2025
Comment on lines
-550
to
+553
struct_span_code_err!(tcx.dcx(), item.span(), E0535, "invalid argument") | ||
struct_span_code_err!(tcx.dcx(), items[0].span(), E0535, "invalid argument") |
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.
Why? item == items[0], as destructured in let [item] = &items[..] else
fmease
added a commit
to fmease/rust
that referenced
this pull request
Feb 25, 2025
Revert accidental cargo submodule update This was accidentally introduced in rust-lang#135726
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 25, 2025
Revert "Auto merge of rust-lang#135726 - jdonszelmann:attr-parsing, r=oli-obk" Trying to revert rust-lang#135726 and do some perf. runs on it. r? `@ghost`
fmease
added a commit
to fmease/rust
that referenced
this pull request
Feb 25, 2025
Revert accidental cargo submodule update This was accidentally introduced in rust-lang#135726
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 25, 2025
Rollup merge of rust-lang#137597 - oli-obk:push-unkusxkoqrus, r=Kobzol Revert accidental cargo submodule update This was accidentally introduced in rust-lang#135726
remi-delmas-3000
pushed a commit
to remi-delmas-3000/kani
that referenced
this pull request
Feb 26, 2025
Changes to attribute parsing and representation rust-lang/rust#135726 Map methods moved to `TyCtx` rust-lang/rust#137162 rust-lang/rust#137397 Remove `BackendRepr::Unihabited` rust-lang/rust#136985
remi-delmas-3000
pushed a commit
to remi-delmas-3000/kani
that referenced
this pull request
Feb 26, 2025
Changes to attribute parsing and representation rust-lang/rust#135726 Map methods moved to `TyCtx` rust-lang/rust#137162 rust-lang/rust#137397 Remove `BackendRepr::Unihabited` rust-lang/rust#136985
remi-delmas-3000
pushed a commit
to remi-delmas-3000/kani
that referenced
this pull request
Feb 27, 2025
Changes to attribute parsing and representation rust-lang/rust#135726 Map methods moved to `TyCtx` rust-lang/rust#137162 rust-lang/rust#137397 Remove `BackendRepr::Unihabited` rust-lang/rust#136985
9 tasks
nnethercote
added a commit
to nnethercote/rust
that referenced
this pull request
Mar 5, 2025
Notes about tests: - tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs: some messages are now duplicated due to repeated parsing. - tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs: ditto. - `tests/ui/proc-macro/macro-rules-derive-cfg.rs`: the diff looks large but the only difference is the insertion of a single invisible-delimited group around a metavar. - `tests/ui/attributes/nonterminal-expansion.rs`: a slight span degradation, somehow related to the recent massive attr parsing rewrite (rust-lang#135726). I couldn't work out exactly what is going wrong, I don't think it's worth holding things up for a single slightly suboptimal error message.
github-merge-queue bot
pushed a commit
to model-checking/kani
that referenced
this pull request
Mar 5, 2025
Changes to attribute parsing and representation rust-lang/rust#135726 Map methods moved to `TyCtx` rust-lang/rust#137162 rust-lang/rust#137397 Remove `BackendRepr::Unihabited` rust-lang/rust#136985 Intrinsics rint, roundeven, nearbyint replaced by `round_ties_even`. rust-lang/rust#136543. Use `__sort_of_CPROVER_round_to_integral` to model `round_ties_even`. Rename `sub_ptr` to `offset_from_unsigned`. The feature gate is still `ptr_sub_ptr`. rust-lang/rust#137483. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses. --------- Co-authored-by: Remi Delmas <delmasrd@amazon.com>
vayunbiyani
added a commit
to vayunbiyani/rust
that referenced
this pull request
Mar 12, 2025
nnethercote
added a commit
to nnethercote/rust
that referenced
this pull request
Mar 13, 2025
Notes about tests: - tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs: some messages are now duplicated due to repeated parsing. - tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs: ditto. - `tests/ui/proc-macro/macro-rules-derive-cfg.rs`: the diff looks large but the only difference is the insertion of a single invisible-delimited group around a metavar. - `tests/ui/attributes/nonterminal-expansion.rs`: a slight span degradation, somehow related to the recent massive attr parsing rewrite (rust-lang#135726). I couldn't work out exactly what is going wrong, I don't think it's worth holding things up for a single slightly suboptimal error message.
nnethercote
added a commit
to nnethercote/rust
that referenced
this pull request
Mar 24, 2025
Notes about tests: - tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs: some messages are now duplicated due to repeated parsing. - tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs: ditto. - `tests/ui/proc-macro/macro-rules-derive-cfg.rs`: the diff looks large but the only difference is the insertion of a single invisible-delimited group around a metavar. - `tests/ui/attributes/nonterminal-expansion.rs`: a slight span degradation, somehow related to the recent massive attr parsing rewrite (rust-lang#135726). I couldn't work out exactly what is going wrong, but I don't think it's worth holding things up for a single slightly suboptimal error message.
nnethercote
added a commit
to nnethercote/rust
that referenced
this pull request
Mar 26, 2025
Notes about tests: - tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs: some messages are now duplicated due to repeated parsing. - tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs: ditto. - `tests/ui/proc-macro/macro-rules-derive-cfg.rs`: the diff looks large but the only difference is the insertion of a single invisible-delimited group around a metavar. - `tests/ui/attributes/nonterminal-expansion.rs`: a slight span degradation, somehow related to the recent massive attr parsing rewrite (rust-lang#135726). I couldn't work out exactly what is going wrong, but I don't think it's worth holding things up for a single slightly suboptimal error message.
nnethercote
added a commit
to nnethercote/rust
that referenced
this pull request
Mar 26, 2025
Notes about tests: - tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs: some messages are now duplicated due to repeated parsing. - tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs: ditto. - `tests/ui/proc-macro/macro-rules-derive-cfg.rs`: the diff looks large but the only difference is the insertion of a single invisible-delimited group around a metavar. - `tests/ui/attributes/nonterminal-expansion.rs`: a slight span degradation, somehow related to the recent massive attr parsing rewrite (rust-lang#135726). I couldn't work out exactly what is going wrong, but I don't think it's worth holding things up for a single slightly suboptimal error message.
nnethercote
added a commit
to nnethercote/rust
that referenced
this pull request
Mar 27, 2025
Notes about tests: - tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs: some messages are now duplicated due to repeated parsing. - tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs: ditto. - `tests/ui/proc-macro/macro-rules-derive-cfg.rs`: the diff looks large but the only difference is the insertion of a single invisible-delimited group around a metavar. - `tests/ui/attributes/nonterminal-expansion.rs`: a slight span degradation, somehow related to the recent massive attr parsing rewrite (rust-lang#135726). I couldn't work out exactly what is going wrong, but I don't think it's worth holding things up for a single slightly suboptimal error message.
nnethercote
added a commit
to nnethercote/rust
that referenced
this pull request
Mar 31, 2025
Notes about tests: - tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs: some messages are now duplicated due to repeated parsing. - tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs: ditto. - `tests/ui/proc-macro/macro-rules-derive-cfg.rs`: the diff looks large but the only difference is the insertion of a single invisible-delimited group around a metavar. - `tests/ui/attributes/nonterminal-expansion.rs`: a slight span degradation, somehow related to the recent massive attr parsing rewrite (rust-lang#135726). I couldn't work out exactly what is going wrong, but I don't think it's worth holding things up for a single slightly suboptimal error message.
nnethercote
added a commit
to nnethercote/rust
that referenced
this pull request
Apr 1, 2025
Notes about tests: - tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs: some messages are now duplicated due to repeated parsing. - tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs: ditto. - `tests/ui/proc-macro/macro-rules-derive-cfg.rs`: the diff looks large but the only difference is the insertion of a single invisible-delimited group around a metavar. - `tests/ui/attributes/nonterminal-expansion.rs`: a slight span degradation, somehow related to the recent massive attr parsing rewrite (rust-lang#135726). I couldn't work out exactly what is going wrong, but I don't think it's worth holding things up for a single slightly suboptimal error message.
cberner
pushed a commit
to cberner/rust
that referenced
this pull request
May 1, 2025
Notes about tests: - tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs: some messages are now duplicated due to repeated parsing. - tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs: ditto. - `tests/ui/proc-macro/macro-rules-derive-cfg.rs`: the diff looks large but the only difference is the insertion of a single invisible-delimited group around a metavar. - `tests/ui/attributes/nonterminal-expansion.rs`: a slight span degradation, somehow related to the recent massive attr parsing rewrite (rust-lang#135726). I couldn't work out exactly what is going wrong, but I don't think it's worth holding things up for a single slightly suboptimal error message.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
A-query-system
Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)
A-rustdoc-json
Area: Rustdoc JSON backend
A-rustdoc-search
Area: Rustdoc's search feature
merged-by-bors
This PR was explicitly merged by bors.
perf-regression
Performance regression.
perf-regression-triaged
The performance regression has been triaged.
PG-exploit-mitigations
Project group: Exploit mitigations
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.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
T-rustdoc-frontend
Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Another step in the plan outlined in #131229
introduces infrastructure for structured parsers for attributes, as well as converting a couple of complex attributes to have such structured parsers.
This PR may prove too large to review. I left some of my own comments to guide it a little. Some general notes:
malformed repr(align(N))
#132391. I think most choices I made here are generally reasonable, but let me know if you disagree anywhere.rustc_ast_data_structures::AttributeKind
In general, a lot of the additions here are comments. I've found it very important to document new things in the 2nd commit well so other people can start using it.
Closes #132391
Closes #136717