1
Fork 0

rustc_errors: let DiagnosticBuilder::emit return a "guarantee of emission".

This commit is contained in:
Eduard-Mihai Burtescu 2022-01-27 09:44:25 +00:00
parent 0b9d70cf6d
commit b7e95dee65
83 changed files with 842 additions and 471 deletions

View file

@ -1753,7 +1753,7 @@ impl SharedEmitterMain {
let msg = msg.strip_prefix("error: ").unwrap_or(&msg);
let mut err = match level {
Level::Error { lint: false } => sess.struct_err(&msg),
Level::Error { lint: false } => sess.struct_err(&msg).forget_guarantee(),
Level::Warning => sess.struct_warn(&msg),
Level::Note => sess.struct_note_without_error(&msg),
_ => bug!("Invalid inline asm diagnostic level"),