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

@@ -361,7 +361,7 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
Err(err.struct_error(
ecx.tcx,
"it is undefined behavior to use this value",
|mut diag| {
|diag| {
diag.note(note_on_undefined_behavior_error());
diag.note(&format!(
"the raw bytes of the constant ({}",
@@ -370,7 +370,6 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
ecx.tcx.global_alloc(alloc_id).unwrap_memory()
)
));
diag.emit();
},
))
} else {