diff --git a/rust-version b/rust-version index f67ac80c52..6af1314799 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -767453eb7ca188e991ac5568c17b984dd4893e77 +3166bbef9248fce2695899e21203f42a21046551 diff --git a/src/diagnostics.rs b/src/diagnostics.rs index a70a9d4602..4c284ff81e 100644 --- a/src/diagnostics.rs +++ b/src/diagnostics.rs @@ -3,7 +3,7 @@ use std::num::NonZeroU64; use log::trace; -use rustc_errors::DiagnosticMessage; +use rustc_errors::{DiagnosticBuilder, DiagnosticMessage, Level}; use rustc_span::{SpanData, Symbol, DUMMY_SP}; use rustc_target::abi::{Align, Size}; @@ -453,11 +453,13 @@ pub fn report_msg<'tcx>( ) { let span = stacktrace.first().map_or(DUMMY_SP, |fi| fi.span); let sess = machine.tcx.sess; - let mut err = match diag_level { - DiagLevel::Error => sess.struct_span_err(span, title).forget_guarantee(), - DiagLevel::Warning => sess.struct_span_warn(span, title), - DiagLevel::Note => sess.dcx().struct_span_note(span, title), + let level = match diag_level { + DiagLevel::Error => Level::Error { lint: false }, + DiagLevel::Warning => Level::Warning(None), + DiagLevel::Note => Level::Note, }; + let mut err = DiagnosticBuilder::<()>::new(sess.dcx(), level, title); + err.set_span(span); // Show main message. if span != DUMMY_SP { diff --git a/src/lib.rs b/src/lib.rs index 1eb40ab826..4e9febf020 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,7 +11,6 @@ #![feature(round_ties_even)] #![feature(let_chains)] #![feature(lint_reasons)] -#![cfg_attr(bootstrap, feature(trait_upcasting))] // Configure clippy and other lints #![allow( clippy::collapsible_else_if,