rustc_error: make ErrorReported impossible to construct

There are a few places were we have to construct it, though, and a few
places that are more invasive to change. To do this, we create a
constructor with a long obvious name.
This commit is contained in:
mark 2022-01-22 18:49:12 -06:00
parent 461e807801
commit bb8d4307eb
104 changed files with 705 additions and 550 deletions

View file

@ -5,7 +5,6 @@ use rustc_ast as ast;
use rustc_codegen_ssa::traits::CodegenBackend;
use rustc_data_structures::svh::Svh;
use rustc_data_structures::sync::{Lrc, OnceCell, WorkerLocal};
use rustc_errors::ErrorGuaranteed;
use rustc_hir::def_id::LOCAL_CRATE;
use rustc_incremental::DepGraphFuture;
use rustc_lint::LintStore;
@ -121,10 +120,8 @@ impl<'tcx> Queries<'tcx> {
pub fn parse(&self) -> Result<&Query<ast::Crate>> {
self.parse.compute(|| {
passes::parse(self.session(), &self.compiler.input).map_err(|mut parse_error| {
parse_error.emit();
ErrorGuaranteed
})
passes::parse(self.session(), &self.compiler.input)
.map_err(|mut parse_error| parse_error.emit())
})
}