Rollup merge of #153159 - Zalathar:emit-workaround, r=nnethercote

Work around a false `err.emit();` type error in rust-analyzer

For whatever reason, rust-analyzer doesn't see that these calls to `err.emit();` are diverging, so the trailing semicolon makes r-a complain about a type mismatch between `()` and some other type.

Removing the trailing semicolon makes no functional difference (because the emit still unwinds the stack), but seems to be enough to allow rust-analyzer to see that emitting an error returns `!` in these cases, which silences the false error.
This commit is contained in:
Jonathan Brouwer
2026-02-27 14:05:38 +01:00
committed by GitHub
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -300,7 +300,7 @@ internal compiler error: query cycle handler thread panicked, aborting process";
diag.help(
"try lowering `-Z threads` or checking the operating system's resource limits",
);
diag.emit();
diag.emit()
})
})
})
+1 -1
View File
@@ -132,7 +132,7 @@ pub fn new_parser_from_file<'a>(
if let Some(sp) = sp {
err.span(sp);
}
err.emit();
err.emit()
});
new_parser_from_source_file(psess, source_file, strip_tokens)
}
+1 -1
View File
@@ -1615,7 +1615,7 @@ pub fn build_target_config(
let mut err =
early_dcx.early_struct_fatal(format!("error loading target specification: {e}"));
err.help("run `rustc --print target-list` for a list of built-in targets");
err.emit();
err.emit()
}
}
}