1
Fork 0

Remove an unnecessary field from a NonConstOp

This commit is contained in:
oli 2021-01-04 23:32:19 +00:00
parent d51cf9601c
commit ad5aa2359d
2 changed files with 3 additions and 3 deletions

View file

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

View file

@ -817,7 +817,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
// Attempting to call a trait method? // Attempting to call a trait method?
if let Some(trait_id) = tcx.trait_of_item(callee) { if let Some(trait_id) = tcx.trait_of_item(callee) {
if !self.tcx.features().const_trait_impl { if !self.tcx.features().const_trait_impl {
self.check_op(ops::FnCallNonConst(callee)); self.check_op(ops::FnCallNonConst);
return; return;
} }
@ -883,7 +883,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
} }
if !tcx.is_const_fn_raw(callee) { if !tcx.is_const_fn_raw(callee) {
self.check_op(ops::FnCallNonConst(callee)); self.check_op(ops::FnCallNonConst);
return; return;
} }