Skip to content
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

Suggest quoting unquoted idents in attrs #119341

Merged
merged 1 commit into from
Jan 14, 2024
Merged

Conversation

sjwang05
Copy link
Contributor

Closes #58462

@rustbot
Copy link
Collaborator

rustbot commented Dec 27, 2023

r? @WaffleLapkin

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added 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 Dec 27, 2023
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 27, 2023
@sjwang05
Copy link
Contributor Author

@rustbot review

@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 Dec 27, 2023
compiler/rustc_parse/messages.ftl Outdated Show resolved Hide resolved
.dcx()
.create_err(InvalidMetaItem { span: self.token.span, token: self.token.clone() }))
let token = self.token.clone();
let (sugg, or_ident) = if self.prev_token == token::Eq && !self.token.span.from_expansion()
Copy link
Member

Choose a reason for hiding this comment

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

Please add a comment about what this check does, exactly, and why we only accept identifiers in the else (I'm also pretty sure identifiers are unrelated to expansions?...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a comment explaining the check, including the from_expansion().

why we only accept identifiers in the else

From briefly glancing over attributes-related tests, it seemed like the "or identifier" would be valid for the remaining cases covered by the else branch, e.g.

//~^ ERROR expected unsuffixed literal or identifier, found `n!()`

@rustbot review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 27, 2023
@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 Jan 3, 2024
@bors
Copy link
Contributor

bors commented Jan 4, 2024

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

Copy link
Member

@WaffleLapkin WaffleLapkin left a comment

Choose a reason for hiding this comment

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

This looks good to me! 🙂

Please rebase this PR to resolve conflicts.

Marking as S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. , once you've fixed the conflicts, please use @rustbot review (learn more about rustbot commands). @rustbot author.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 12, 2024
@sjwang05
Copy link
Contributor Author

Rebased, thanks for the help.

@rustbot review

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 13, 2024
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 13, 2024
@WaffleLapkin
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 14, 2024

📌 Commit aa8ecd0 has been approved by WaffleLapkin

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 Jan 14, 2024
@bors
Copy link
Contributor

bors commented Jan 14, 2024

⌛ Testing commit aa8ecd0 with merge aa5f781...

@bors
Copy link
Contributor

bors commented Jan 14, 2024

☀️ Test successful - checks-actions
Approved by: WaffleLapkin
Pushing aa5f781 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 14, 2024
@bors bors merged commit aa5f781 into rust-lang:master Jan 14, 2024
12 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 14, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (aa5f781): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.4%] 1
All ❌✅ (primary) 0.3% [0.3%, 0.3%] 1

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.0% [1.0%, 1.0%] 1
Improvements ✅
(primary)
-4.5% [-4.5%, -4.5%] 1
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) -4.5% [-4.5%, -4.5%] 1

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.9% [2.9%, 2.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.9% [2.9%, 2.9%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 664.704s -> 666.086s (0.21%)
Artifact size: 308.20 MiB -> 308.21 MiB (0.00%)

@sjwang05 sjwang05 deleted the issue-58462 branch January 16, 2024 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

Diagnostic for #[cfg(ident=ident)] fails to suggest #[cfg(ident="string")]
6 participants