Skip to content

Put spans in all parsed attributes #142813

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

Closed
wants to merge 1 commit into from
Closed

Conversation

mejrs
Copy link
Contributor

@mejrs mejrs commented Jun 20, 2025

Fixes #142783

Alternative to #142552.

This PR is more wordy than it strictly has to be because it also changes the AttributeKind enum to have exclusively named fields.(my ocd cannot stand enums with mixed named and tuple fields)

cc @GrigorenkoPV
r? @jdonszelmann

@rustbot
Copy link
Collaborator

rustbot commented Jun 20, 2025

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

@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 Jun 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 20, 2025

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred to constck

cc @fee1-dead

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

cc @jdonszelmann

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

Some changes occurred in compiler/rustc_attr_data_structures

cc @jdonszelmann

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

Some changes occurred in compiler/rustc_codegen_ssa/src/codegen_attrs.rs

cc @jdonszelmann

@jdonszelmann
Copy link
Contributor

jdonszelmann commented Jun 20, 2025

I'm very much against this. About to head to bed, but I don't think this is the best way forward. Will say more tomorrow

@mejrs
Copy link
Contributor Author

mejrs commented Jun 20, 2025

I don't disagree but if we don't do something then that ICE is going to keep popping up.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer
Copy link
Collaborator

The job mingw-check-2 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    |                                                ^^^^^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant
    |
help: the struct variant's field is being ignored
    |
763 -                         hir::Attribute::Parsed(AttributeKind::Repr(..)) => None,
763 +                         hir::Attribute::Parsed(AttributeKind::Repr { reprs: _ }) => None,
    |

For more information about this error, try `rustc --explain E0164`.
[RUSTC-TIMING] rustdoc test:false 3.175
error: could not compile `rustdoc` (lib) due to 1 previous error

@bors
Copy link
Collaborator

bors commented Jun 21, 2025

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

@jdonszelmann
Copy link
Contributor

mhm, I had somewhat accepted that that's an ICE that's going to sporadically appear and when it does we'll locally fix it. For example, in the case of that issue we just also convert track_caller to a new attribute

@jdonszelmann
Copy link
Contributor

alright, closing this one. Feel free to file just the field change on its own!

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-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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: can't get the span of an arbitrary parsed attribute
5 participants