From 6d6314f878bf489e15293498ecb4af082c8d53d8 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Wed, 29 Dec 2021 16:29:14 +0800 Subject: Rebased and improved errors --- compiler/rustc_const_eval/src/transform/check_consts/ops.rs | 2 +- compiler/rustc_const_eval/src/util/call_kind.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'compiler/rustc_const_eval/src') diff --git a/compiler/rustc_const_eval/src/transform/check_consts/ops.rs b/compiler/rustc_const_eval/src/transform/check_consts/ops.rs index c26b1e550ba..237201c5478 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/ops.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/ops.rs @@ -125,7 +125,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx> { param_env, Binder::dummy(TraitPredicate { trait_ref, - constness: BoundConstness::ConstIfConst, + constness: BoundConstness::NotConst, polarity: ImplPolarity::Positive, }), ); diff --git a/compiler/rustc_const_eval/src/util/call_kind.rs b/compiler/rustc_const_eval/src/util/call_kind.rs index 34925692664..fe35d942341 100644 --- a/compiler/rustc_const_eval/src/util/call_kind.rs +++ b/compiler/rustc_const_eval/src/util/call_kind.rs @@ -71,9 +71,7 @@ pub fn call_kind<'tcx>( AssocItemContainer::TraitContainer(trait_did) => Some(trait_did), }); - let fn_call = (!from_hir_call) - .then(|| parent) - .flatten() + let fn_call = parent .and_then(|p| tcx.lang_items().group(LangItemGroup::Fn).iter().find(|did| **did == p)); let operator = (!from_hir_call) -- cgit 1.4.1-3-g733a5