Skip to content

Commit 15dee66

Browse files
author
The Miri Conjob Bot
committed
Merge from rustc
2 parents d05e5bf + 241fab4 commit 15dee66

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/diagnostics.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::num::NonZeroU64;
33

44
use log::trace;
55

6-
use rustc_errors::DiagnosticMessage;
6+
use rustc_errors::{DiagnosticBuilder, DiagnosticMessage, Level};
77
use rustc_span::{SpanData, Symbol, DUMMY_SP};
88
use rustc_target::abi::{Align, Size};
99

@@ -453,11 +453,13 @@ pub fn report_msg<'tcx>(
453453
) {
454454
let span = stacktrace.first().map_or(DUMMY_SP, |fi| fi.span);
455455
let sess = machine.tcx.sess;
456-
let mut err = match diag_level {
457-
DiagLevel::Error => sess.struct_span_err(span, title).forget_guarantee(),
458-
DiagLevel::Warning => sess.struct_span_warn(span, title),
459-
DiagLevel::Note => sess.dcx().struct_span_note(span, title),
456+
let level = match diag_level {
457+
DiagLevel::Error => Level::Error { lint: false },
458+
DiagLevel::Warning => Level::Warning(None),
459+
DiagLevel::Note => Level::Note,
460460
};
461+
let mut err = DiagnosticBuilder::<()>::new(sess.dcx(), level, title);
462+
err.set_span(span);
461463

462464
// Show main message.
463465
if span != DUMMY_SP {

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#![feature(round_ties_even)]
1212
#![feature(let_chains)]
1313
#![feature(lint_reasons)]
14-
#![cfg_attr(bootstrap, feature(trait_upcasting))]
1514
// Configure clippy and other lints
1615
#![allow(
1716
clippy::collapsible_else_if,

0 commit comments

Comments
 (0)