X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_monomorphize%2Fsrc%2Fcollector.rs;h=1477bc28cff449c4789557bfd09a0ef38877d014;hb=928388bad20572e9ffa575319bb6d3b636bcdc69;hp=ed771534c4c4c2c152252541c294998261dcc65d;hpb=298c9a0e14944872d1b919a21c7d84d0c6d6a713;p=rust.git diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index ed771534c4c..1477bc28cff 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -180,7 +180,6 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::sync::{par_iter, MTLock, MTRef, ParallelIterator}; -use rustc_errors::{ErrorGuaranteed, 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() } } @@ -716,9 +713,7 @@ fn visit_constant(&mut self, constant: &mir::Constant<'tcx>, location: Location) match self.tcx.const_eval_resolve(param_env, ct, None) { // The `monomorphize` call should have evaluated that constant already. Ok(val) => val, - Err(ErrorHandled::Reported(ErrorGuaranteed) | ErrorHandled::Linted) => { - return; - } + Err(ErrorHandled::Reported(_) | ErrorHandled::Linted) => return, Err(ErrorHandled::TooGeneric) => span_bug!( self.body.source_info(location).span, "collection encountered polymorphic constant: {:?}", @@ -750,7 +745,7 @@ fn visit_const(&mut self, constant: ty::Const<'tcx>, location: Location) { substituted_constant, val ), - Err(ErrorHandled::Reported(ErrorGuaranteed) | ErrorHandled::Linted) => {} + Err(ErrorHandled::Reported(_) | ErrorHandled::Linted) => {} Err(ErrorHandled::TooGeneric) => span_bug!( self.body.source_info(location).span, "collection encountered polymorphic constant: {}", @@ -864,7 +859,7 @@ fn visit_operand(&mut self, operand: &mir::Operand<'tcx>, location: Location) { |lint| { let mut err = lint.build(&format!("moving {} bytes", layout.size.bytes())); err.span_label(source_info.span, "value moved from here"); - err.emit() + err.emit(); }, ); }