Rollup merge of #121427 - nnethercote:fix-Rocket, r=oli-obk
Fix panic when compiling `Rocket`. This panic was reported [here](https://github.com/rust-lang/rust/pull/120576#issuecomment-1957515484). r? ``@oli-obk``
This commit is contained in:
commit
01ec4eb319
4 changed files with 13 additions and 11 deletions
|
@ -3,8 +3,8 @@ use std::num::NonZero;
|
|||
use rustc_ast::token;
|
||||
use rustc_ast::util::literal::LitError;
|
||||
use rustc_errors::{
|
||||
codes::*, DiagCtxt, DiagnosticBuilder, DiagnosticMessage, ErrorGuaranteed, IntoDiagnostic,
|
||||
Level, MultiSpan,
|
||||
codes::*, DiagCtxt, DiagnosticBuilder, DiagnosticMessage, EmissionGuarantee, ErrorGuaranteed,
|
||||
IntoDiagnostic, Level, MultiSpan,
|
||||
};
|
||||
use rustc_macros::Diagnostic;
|
||||
use rustc_span::{Span, Symbol};
|
||||
|
@ -17,9 +17,9 @@ pub struct FeatureGateError {
|
|||
pub explain: DiagnosticMessage,
|
||||
}
|
||||
|
||||
impl<'a> IntoDiagnostic<'a> for FeatureGateError {
|
||||
impl<'a, G: EmissionGuarantee> IntoDiagnostic<'a, G> for FeatureGateError {
|
||||
#[track_caller]
|
||||
fn into_diagnostic(self, dcx: &'a DiagCtxt, level: Level) -> DiagnosticBuilder<'a> {
|
||||
fn into_diagnostic(self, dcx: &'a DiagCtxt, level: Level) -> DiagnosticBuilder<'a, G> {
|
||||
DiagnosticBuilder::new(dcx, level, self.explain).with_span(self.span).with_code(E0658)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue