Skip to content

Commit ad5aa23

Browse files
committed
Remove an unnecessary field from a NonConstOp
1 parent d51cf96 commit ad5aa23

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_mir/src/transform/check_consts/ops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl NonConstOp for FnCallIndirect {
7272

7373
/// A function call where the callee is not marked as `const`.
7474
#[derive(Debug)]
75-
pub struct FnCallNonConst(pub DefId);
75+
pub struct FnCallNonConst;
7676
impl NonConstOp for FnCallNonConst {
7777
fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> DiagnosticBuilder<'tcx> {
7878
struct_span_err!(

compiler/rustc_mir/src/transform/check_consts/validation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
817817
// Attempting to call a trait method?
818818
if let Some(trait_id) = tcx.trait_of_item(callee) {
819819
if !self.tcx.features().const_trait_impl {
820-
self.check_op(ops::FnCallNonConst(callee));
820+
self.check_op(ops::FnCallNonConst);
821821
return;
822822
}
823823

@@ -883,7 +883,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
883883
}
884884

885885
if !tcx.is_const_fn_raw(callee) {
886-
self.check_op(ops::FnCallNonConst(callee));
886+
self.check_op(ops::FnCallNonConst);
887887
return;
888888
}
889889

0 commit comments

Comments
 (0)