Rebased and improved errors

This commit is contained in:
Deadbeef 2021-12-29 16:29:14 +08:00
parent b5235ea732
commit 6d6314f878
No known key found for this signature in database
GPG key ID: 6D017A96D8E6C2F9
9 changed files with 40 additions and 20 deletions

View file

@ -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,
}),
);

View file

@ -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)