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

migrate rustc_macros to syn 2.0 #109663

Merged
merged 4 commits into from
Apr 7, 2023

Conversation

fee1-dead
Copy link
Member

WIP at this point since I need to work on migrating the code that heavily uses NestedMeta for parsing. Perhaps a full refactor would be nice..

@rustbot
Copy link
Collaborator

rustbot commented Mar 27, 2023

r? @Nilstrieb

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

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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 Mar 27, 2023
@Noratrieb Noratrieb 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 Mar 27, 2023
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Mar 27, 2023

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

@fee1-dead fee1-dead marked this pull request as ready for review April 3, 2023 12:33
@rustbot
Copy link
Collaborator

rustbot commented Apr 3, 2023

rustc_macros::diagnostics was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @TaKO8Ki

These commits modify the Cargo.lock file. Random changes to Cargo.lock can be introduced when switching branches and rebasing PRs.
This was probably unintentional and should be reverted before this PR is merged.

If this was intentional then you can ignore this comment.

@fee1-dead fee1-dead changed the title [WIP] migrate rustc_macros to syn 2.0 migrate rustc_macros to syn 2.0 Apr 3, 2023
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@fee1-dead
Copy link
Member Author

@rustbot ready

@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 Apr 4, 2023
Copy link
Member

@Noratrieb Noratrieb left a comment

Choose a reason for hiding this comment

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

Thanks a lot! A few small improvements.

I see a lot of bespoke meta handling which makes the code a lot more complex. Maybe it would be a good idea to investigate using something like darling in the future?

Copy link
Member

Choose a reason for hiding this comment

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

The error messages got a little worse but that seems fine to me.

let _ = attr.parse_nested_meta(|nested| {
if nested.path.is_ident("ignore") {
ignored = true;
}
Copy link
Member

Choose a reason for hiding this comment

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

(for a potential future PR, not for now) the else here could maybe be an error

compiler/rustc_macros/src/newtype.rs Outdated Show resolved Hide resolved
compiler/rustc_macros/src/diagnostics/utils.rs Outdated Show resolved Hide resolved
compiler/rustc_macros/src/diagnostics/utils.rs Outdated Show resolved Hide resolved
@Noratrieb Noratrieb 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 Apr 4, 2023
@fee1-dead
Copy link
Member Author

Maybe it would be a good idea to investigate using something like darling in the future?

It might be good, but currently we don't have darling in our Cargo.lock, and I don't know the procedure for adding a library like that.

@Noratrieb
Copy link
Member

I think the usual procedure is just adding it and then double checking with someone from the compiler team that it really makes sense or something like that. Might je worth quickly asking on zulip before doing the implementation work.

@Noratrieb
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Apr 6, 2023

📌 Commit d764c2d has been approved by Nilstrieb

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 6, 2023
@bors
Copy link
Contributor

bors commented Apr 7, 2023

⌛ Testing commit d764c2d with merge 32ea4bb...

@bors
Copy link
Contributor

bors commented Apr 7, 2023

☀️ Test successful - checks-actions
Approved by: Nilstrieb
Pushing 32ea4bb to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 7, 2023
@bors bors merged commit 32ea4bb into rust-lang:master Apr 7, 2023
@rustbot rustbot added this to the 1.70.0 milestone Apr 7, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (32ea4bb): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

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)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

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)
1.9% [1.5%, 2.3%] 11
Regressions ❌
(secondary)
1.7% [1.5%, 1.9%] 2
Improvements ✅
(primary)
-0.5% [-0.5%, -0.5%] 1
Improvements ✅
(secondary)
-3.0% [-3.6%, -2.7%] 4
All ❌✅ (primary) 1.7% [-0.5%, 2.3%] 12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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.

6 participants