Skip to content

Commit df32edf

Browse files
committed
Split Handler::emit_diagnostic in two.
Currently, `emit_diagnostic` takes `&mut self`. This commit changes it so `emit_diagnostic` takes `self` and the new `emit_diagnostic_without_consuming` function takes `&mut self`. I find the distinction useful. The former case is much more common, and avoids a bunch of `mut` and `&mut` occurrences. We can also restrict the latter with `pub(crate)` which is nice.
1 parent 611a359 commit df32edf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ pub fn report_msg<'tcx>(
512512
}
513513
}
514514

515-
handler.emit_diagnostic(&mut err);
515+
handler.emit_diagnostic(err);
516516
}
517517

518518
impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {

0 commit comments

Comments
 (0)