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

Make fatal DiagnosticBuilder yield ! #94789

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Mar 10, 2022

Fatal errors should really be fatal, so emitting them should cause us to exit at the same time.

Fine with just throwing away these changes if they're not worthwhile. Also, maybe we want to use an uninhabited enum instead of !.

r? @eddyb who has been working on DiagnosticBuilder stuff, feel free to reassign.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 10, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 10, 2022
Copy link
Member Author

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

Also curious if we should prevent Fatal level errors from being created with a regular DiagnosticBuilder<ErrorGuaranteed>. Because in that case, they really should just be Error level errors.

@@ -21,7 +21,7 @@ impl<'tcx> StructuredDiagnostic<'tcx> for MissingCastForVariadicArg<'tcx> {
}

fn diagnostic_common(&self) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
let mut err = self.sess.struct_span_fatal_with_code(
let mut err = self.sess.struct_span_err_with_code(
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think this was intended to be fatal.

compiler/rustc_typeck/src/astconv/mod.rs Outdated Show resolved Hide resolved
@@ -7,6 +7,7 @@
#![feature(backtrace)]
#![feature(if_let_guard)]
#![feature(let_else)]
#![feature(never_type)]
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know if it's worthwhile introducing more cases of never_type since T-lang has discussed cutting back some of the specialness of the type.

@compiler-errors compiler-errors force-pushed the fatal-never branch 2 times, most recently from f2f858e to 26b2d45 Compare March 10, 2022 01:46
@oli-obk oli-obk added the A-diagnostics Area: Messages for errors, warnings, and lints label Mar 12, 2022
@bors
Copy link
Contributor

bors commented Mar 18, 2022

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

@hellow554

This comment was marked as off-topic.

@oli-obk

This comment was marked as off-topic.

@compiler-errors compiler-errors force-pushed the fatal-never branch 2 times, most recently from 88fc35b to d1babd7 Compare March 19, 2022 05:14
@eddyb
Copy link
Member

eddyb commented Mar 28, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Mar 28, 2022

📌 Commit d1babd779127abdc3fa878c90e6de488dd3b8414 has been approved by eddyb

@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 Mar 28, 2022
@bors
Copy link
Contributor

bors commented Mar 28, 2022

⌛ Testing commit d1babd779127abdc3fa878c90e6de488dd3b8414 with merge 3df6b768eccf7b891a9e7f3abc974dd4b9712481...

@bors
Copy link
Contributor

bors commented Mar 28, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 28, 2022
@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member Author

Rebased and fixed error due to #95149 (changed a & to a &mut here)

@oli-obk
Copy link
Contributor

oli-obk commented Mar 28, 2022

@bors r=eddyb

@bors
Copy link
Contributor

bors commented Mar 28, 2022

📌 Commit 928388b has been approved by eddyb

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 28, 2022
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 28, 2022
@bors
Copy link
Contributor

bors commented Mar 28, 2022

⌛ Testing commit 928388b with merge 0e4524e...

@bors
Copy link
Contributor

bors commented Mar 28, 2022

☀️ Test successful - checks-actions
Approved by: eddyb
Pushing 0e4524e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 28, 2022
@bors bors merged commit 0e4524e into rust-lang:master Mar 28, 2022
@rustbot rustbot added this to the 1.61.0 milestone Mar 28, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0e4524e): comparison url.

Summary: This benchmark run did not return any relevant results. 10 results were found to be statistically significant but too small to be relevant.

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

@rustbot label: -perf-regression

@compiler-errors compiler-errors deleted the fatal-never branch April 7, 2022 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints 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.

9 participants