diff options
| author | oli <github35764891676564198441@oli-obk.de> | 2021-01-04 23:32:19 +0000 |
|---|---|---|
| committer | oli <github35764891676564198441@oli-obk.de> | 2021-01-17 13:40:29 +0000 |
| commit | ad5aa2359d45654953405763090dbc0cd63b0c97 (patch) | |
| tree | 59357140b8938513d6179504ba33cb01d801d9b6 | |
| parent | d51cf9601c714a8383aecade7c98559dd4831625 (diff) | |
Remove an unnecessary field from a `NonConstOp`
| -rw-r--r-- | compiler/rustc_mir/src/transform/check_consts/ops.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_mir/src/transform/check_consts/validation.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_mir/src/transform/check_consts/ops.rs b/compiler/rustc_mir/src/transform/check_consts/ops.rs index 9e90a7519cf..99ffb0edce9 100644 --- a/compiler/rustc_mir/src/transform/check_consts/ops.rs +++ b/compiler/rustc_mir/src/transform/check_consts/ops.rs @@ -72,7 +72,7 @@ impl NonConstOp for FnCallIndirect { /// A function call where the callee is not marked as `const`. #[derive(Debug)] -pub struct FnCallNonConst(pub DefId); +pub struct FnCallNonConst; impl NonConstOp for FnCallNonConst { fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> DiagnosticBuilder<'tcx> { struct_span_err!( diff --git a/compiler/rustc_mir/src/transform/check_consts/validation.rs b/compiler/rustc_mir/src/transform/check_consts/validation.rs index d1c07d1051d..ebb4e7e7fa0 100644 --- a/compiler/rustc_mir/src/transform/check_consts/validation.rs +++ b/compiler/rustc_mir/src/transform/check_consts/validation.rs @@ -817,7 +817,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> { // Attempting to call a trait method? if let Some(trait_id) = tcx.trait_of_item(callee) { if !self.tcx.features().const_trait_impl { - self.check_op(ops::FnCallNonConst(callee)); + self.check_op(ops::FnCallNonConst); return; } @@ -883,7 +883,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> { } if !tcx.is_const_fn_raw(callee) { - self.check_op(ops::FnCallNonConst(callee)); + self.check_op(ops::FnCallNonConst); return; } |
