Skip to content

Kind-less SessionDiagnostic derive - #100765

Merged
bors merged 4 commits into
rust-lang:masterfrom
Xiretza:session-diagnostic-unification
Aug 21, 2022
Merged

Kind-less SessionDiagnostic derive#100765
bors merged 4 commits into
rust-lang:masterfrom
Xiretza:session-diagnostic-unification

Conversation

@Xiretza

Copy link
Copy Markdown
Contributor

From #100730 (comment):

Hm, maybe we should expose some sess.struct_$SOMETHING (like struct_diagnostic?) that is generic over EmissionGuarantee, then make the SessionDiagnostic derive generic, i.e.

impl<'tcx>SessionDiagnosticforUnusedGenericParams{fninto_diagnostic<T:EmissionGuarantee>( .. ) -> DiagnosticBuilder<'tcx,T>{letmut diag = sess.struct_diagnostic(rustc_errors:..);
..
}}

Discussed on Zulip.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @petrochenkov

(rust-highfive has picked a reviewer for you, use r? to override)

@rustbotrustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 19, 2022
@rustbot

Copy link
Copy Markdown
Collaborator

rustc_macros::diagnostics was changed

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 19, 2022
@Xiretza
Xiretzaforce-pushed the session-diagnostic-unification branch from b868bb8 to 9eec2c4CompareAugust 19, 2022 17:15
@XiretzaXiretza mentioned this pull request Aug 19, 2022
84 tasks
@Xiretza
Xiretzaforce-pushed the session-diagnostic-unification branch 2 times, most recently from 4e04b57 to 450989fCompareAugust 19, 2022 18:06
@compiler-errors

Copy link
Copy Markdown
Contributor

r? @compiler-errors

@compiler-errors

Copy link
Copy Markdown
Contributor

This is exactly what I wanted to see! 😄 I'll wait until CI is ready and then approve.

@compiler-errors

Copy link
Copy Markdown
Contributor

Also, we probably need to adjust the rustc dev guide docs once again.

@Xiretza

Copy link
Copy Markdown
ContributorAuthor

That's good to hear! :D The PR will conflict with all the diagnostics migration PRs currently open, so I suppose it will need a rollup=never with a relatively high priority or it'll fail bors until the end of time.

@Xiretza

Copy link
Copy Markdown
ContributorAuthor

Also, we probably need to adjust the rustc dev guide docs once again.

Already drafted: rust-lang/rustc-dev-guide#1440

@compiler-errors

Copy link
Copy Markdown
Contributor

The PR will conflict with all the diagnostics migration PRs currently open, so I suppose it will need a rollup=never with a relatively high priority or it'll fail bors until the end of time.

Yup makes sense. I was gonna wait until CI is green then approve.

Already drafted: rust-lang/rustc-dev-guide#1440

You're wonderful!

@compiler-errors

Copy link
Copy Markdown
Contributor

@bors r+ p=1 rollup=never

(will likely not merge unless p=1)

@bors

bors commented Aug 19, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 450989f9ede869f8e432f9c1f64d3d055bfa041a has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Aug 19, 2022
@bors

bors commented Aug 19, 2022

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 450989f9ede869f8e432f9c1f64d3d055bfa041a with merge 8175a9f41cc3944935dcc70a5eb751ffc371d3a9...

@ChrisDenton

ChrisDenton commented Aug 20, 2022

Copy link
Copy Markdown
Member

CI has stalled.

EDIT: Sorry for the noise. The CI was still going after 5hrs without movement from a Windows builder for at least 3hrs.

@ChrisDenton

This comment was marked as resolved.

@borsbors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 20, 2022
@borsbors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 21, 2022
@compiler-errors

Copy link
Copy Markdown
Contributor

Wait... this needs rebase.

@bors r-

@borsbors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 21, 2022
This unifies the struct_{warn,error,fatal}() methods in one generic
method.
Deriving SessionDiagnostic on a type no longer forces that diagnostic to
be one of warning, error, or fatal. The level is instead decided when
the struct is passed to the respective Handler::emit_*() method.
@Xiretza
Xiretzaforce-pushed the session-diagnostic-unification branch from dc8d944 to 7f3a6fdCompareAugust 21, 2022 07:18
@compiler-errors

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Aug 21, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 7f3a6fd has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Aug 21, 2022
@bors

bors commented Aug 21, 2022

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 7f3a6fd with merge 4b695f7...

@bors

bors commented Aug 21, 2022

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing 4b695f7 to master...

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (4b695f7): comparison url.

Instruction count

  • Primary benchmarks: ✅ relevant improvements found
  • Secondary benchmarks: no relevant changes found
mean1maxcount2
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
-0.8%-0.9%5
Improvements ✅
(secondary)
--0
All ❌✅ (primary)-0.8%-0.9%5

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: mixed results
mean1maxcount2
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
2.9%2.9%1
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
-2.4%-3.3%2
All ❌✅ (primary)--0

Cycles

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

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change2

  2. number of relevant changes2

@Xiretza
Xiretza deleted the session-diagnostic-unification branch August 21, 2022 15:34
@davidtwco

Copy link
Copy Markdown
Member

Thanks for working on this!

JhonnyBillM added a commit to JhonnyBillM/rust that referenced this pull request Aug 30, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-translationArea: Translation infrastructure, and migrating existing diagnostics to SessionDiagnosticmerged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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.

10 participants

@Xiretza@rust-highfive@rustbot@compiler-errors@bors@ChrisDenton@rust-log-analyzer@davidtwco@rust-timer@petrochenkov