Take &mut Diagnostic in emit_diagnostic.
Taking a Diagnostic by move would break the usual pattern `diag.label(..).emit()`.
This commit is contained in:
@@ -49,8 +49,8 @@ macro_rules! panictry_buffer {
|
||||
match $e {
|
||||
Ok(e) => e,
|
||||
Err(errs) => {
|
||||
for e in errs {
|
||||
$handler.emit_diagnostic(&e);
|
||||
for mut e in errs {
|
||||
$handler.emit_diagnostic(&mut e);
|
||||
}
|
||||
FatalError.raise()
|
||||
}
|
||||
@@ -167,8 +167,8 @@ fn try_file_to_source_file(
|
||||
fn file_to_source_file(sess: &ParseSess, path: &Path, spanopt: Option<Span>) -> Lrc<SourceFile> {
|
||||
match try_file_to_source_file(sess, path, spanopt) {
|
||||
Ok(source_file) => source_file,
|
||||
Err(d) => {
|
||||
sess.span_diagnostic.emit_diagnostic(&d);
|
||||
Err(mut d) => {
|
||||
sess.span_diagnostic.emit_diagnostic(&mut d);
|
||||
FatalError.raise();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user