-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Make fatal DiagnosticBuilder yield !
#94789
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
#![feature(backtrace)] | ||
#![feature(if_let_guard)] | ||
#![feature(let_else)] | ||
#![feature(never_type)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if it's worthwhile introducing more cases of |
||
#![feature(nll)] | ||
#![feature(adt_const_params)] | ||
#![allow(incomplete_features)] | ||
|
@@ -758,7 +759,7 @@ impl Handler { | |
&self, | ||
span: impl Into<MultiSpan>, | ||
msg: &str, | ||
) -> DiagnosticBuilder<'_, ErrorGuaranteed> { | ||
) -> DiagnosticBuilder<'_, !> { | ||
let mut result = self.struct_fatal(msg); | ||
result.set_span(span); | ||
result | ||
|
@@ -770,15 +771,15 @@ impl Handler { | |
span: impl Into<MultiSpan>, | ||
msg: &str, | ||
code: DiagnosticId, | ||
) -> DiagnosticBuilder<'_, ErrorGuaranteed> { | ||
) -> DiagnosticBuilder<'_, !> { | ||
let mut result = self.struct_span_fatal(span, msg); | ||
result.code(code); | ||
result | ||
} | ||
|
||
/// Construct a builder at the `Error` level with the `msg`. | ||
pub fn struct_fatal(&self, msg: &str) -> DiagnosticBuilder<'_, ErrorGuaranteed> { | ||
DiagnosticBuilder::new_guaranteeing_error::<{ Level::Fatal }>(self, msg) | ||
pub fn struct_fatal(&self, msg: &str) -> DiagnosticBuilder<'_, !> { | ||
DiagnosticBuilder::new_fatal(self, msg) | ||
} | ||
|
||
/// Construct a builder at the `Help` level with the `msg`. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this was intended to be fatal. |
||
self.span, | ||
&format!("can't pass `{}` to variadic function", self.ty), | ||
self.code(), | ||
|
Uh oh!
There was an error while loading. Please reload this page.