1
Fork 0

Make fatal DiagnosticBuilder yield never

This commit is contained in:
Michael Goulet 2022-03-09 16:11:28 -08:00
parent 93313d108f
commit 928388bad2
11 changed files with 82 additions and 46 deletions

View file

@ -180,7 +180,6 @@
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::sync::{par_iter, MTLock, MTRef, ParallelIterator};
use rustc_errors::FatalError;
use rustc_hir as hir;
use rustc_hir::def_id::{DefId, DefIdMap, LocalDefId, LOCAL_CRATE};
use rustc_hir::itemlikevisit::ItemLikeVisitor;
@ -560,8 +559,7 @@ fn check_recursion_limit<'tcx>(
if let Some(path) = written_to_path {
err.note(&format!("the full type name has been written to '{}'", path.display()));
}
err.emit();
FatalError.raise();
err.emit()
}
recursion_depths.insert(def_id, recursion_depth + 1);
@ -598,8 +596,7 @@ fn check_type_length_limit<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) {
"consider adding a `#![type_length_limit=\"{}\"]` attribute to your crate",
type_length
));
diag.emit();
tcx.sess.abort_if_errors();
diag.emit()
}
}