mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
address review
This commit is contained in:
@@ -367,10 +367,7 @@ fn mark_live_symbols(&mut self) -> <MarkSymbolVisitor<'tcx> as Visitor<'tcx>>::R
|
||||
continue;
|
||||
}
|
||||
|
||||
let visit_result = self.visit_node(self.tcx.hir_node_by_def_id(id));
|
||||
if visit_result.is_break() {
|
||||
return visit_result;
|
||||
}
|
||||
self.visit_node(self.tcx.hir_node_by_def_id(id))?;
|
||||
}
|
||||
|
||||
ControlFlow::Continue(())
|
||||
@@ -1167,11 +1164,12 @@ fn is_live_code(&self, def_id: LocalDefId) -> bool {
|
||||
}
|
||||
|
||||
fn check_mod_deathness(tcx: TyCtxt<'_>, module: LocalModDefId) {
|
||||
let live_symbols_result = tcx.live_symbols_and_ignored_derived_traits(());
|
||||
if live_symbols_result.is_err() {
|
||||
let Ok((live_symbols, ignored_derived_traits)) =
|
||||
tcx.live_symbols_and_ignored_derived_traits(()).as_ref()
|
||||
else {
|
||||
return;
|
||||
}
|
||||
let (live_symbols, ignored_derived_traits) = live_symbols_result.as_ref().unwrap();
|
||||
};
|
||||
|
||||
let mut visitor = DeadVisitor { tcx, live_symbols, ignored_derived_traits };
|
||||
|
||||
let module_items = tcx.hir_module_items(module);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// The test confirms ICE-125323 is fixed.
|
||||
//
|
||||
// This warning makes sure the fix doesn't throw everything with errors to dead.
|
||||
// This warning tests there is no warning about dead code
|
||||
// when there is a constant evaluation error.
|
||||
#![warn(unused)]
|
||||
fn should_not_be_dead() {}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: constant evaluation is taking a long time
|
||||
--> $DIR/do-not-ice-long-constant-evaluation-in-for-loop.rs:9:14
|
||||
--> $DIR/do-not-ice-long-constant-evaluation-in-for-loop.rs:10:14
|
||||
|
|
||||
LL | [(); loop {}];
|
||||
| ^^^^^^^
|
||||
@@ -7,7 +7,7 @@ LL | [(); loop {}];
|
||||
= note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
|
||||
If your compilation actually takes a long time, you can safely allow the lint.
|
||||
help: the constant being evaluated
|
||||
--> $DIR/do-not-ice-long-constant-evaluation-in-for-loop.rs:9:14
|
||||
--> $DIR/do-not-ice-long-constant-evaluation-in-for-loop.rs:10:14
|
||||
|
|
||||
LL | [(); loop {}];
|
||||
| ^^^^^^^
|
||||
|
||||
Reference in New Issue
Block a user