From 5a49578b28a3804e9f62fc23b021e1d42445fce3 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Fri, 24 Apr 2020 12:07:33 -0700 Subject: [PATCH 1/2] Use `debug` to print illegal operations in a const context --- src/librustc_mir/transform/check_consts/validation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_mir/transform/check_consts/validation.rs b/src/librustc_mir/transform/check_consts/validation.rs index 45d8e1d08b721..90dafe9c359fd 100644 --- a/src/librustc_mir/transform/check_consts/validation.rs +++ b/src/librustc_mir/transform/check_consts/validation.rs @@ -205,7 +205,7 @@ impl Validator<'a, 'mir, 'tcx> { where O: NonConstOp, { - trace!("check_op: op={:?}", op); + debug!("check_op: op={:?}", op); if op.is_allowed_in_item(self) { return; From 0e34cb2bdd21bf00d557c3769a6e2ce490e4f6ac Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Fri, 24 Apr 2020 12:07:44 -0700 Subject: [PATCH 2/2] Remove unused `visit_local` --- src/librustc_mir/transform/check_consts/validation.rs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/librustc_mir/transform/check_consts/validation.rs b/src/librustc_mir/transform/check_consts/validation.rs index 90dafe9c359fd..d794599f9982f 100644 --- a/src/librustc_mir/transform/check_consts/validation.rs +++ b/src/librustc_mir/transform/check_consts/validation.rs @@ -386,15 +386,6 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> { } } - fn visit_local(&mut self, place_local: &Local, context: PlaceContext, location: Location) { - trace!( - "visit_local: place_local={:?} context={:?} location={:?}", - place_local, - context, - location, - ); - } - fn visit_operand(&mut self, op: &Operand<'tcx>, location: Location) { self.super_operand(op, location); if let Operand::Constant(c) = op {