Rollup merge of #99746 - compiler-errors:more-trait-engine, r=jackh726

Use `TraitEngine` in more places that don't specifically need `FulfillmentContext::new_in_snapshot`

Not sure if this change is worthwhile, but couldn't hurt re: chalkification

r? types
This commit is contained in:
Matthias Krüger 2022-08-03 22:29:27 +02:00 committed by GitHub
commit 0de7f756f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 23 additions and 22 deletions

View file

@ -10,7 +10,7 @@ use rustc_middle::mir::*;
use rustc_middle::ty::{self, subst::SubstsRef, AdtDef, Ty};
use rustc_span::DUMMY_SP;
use rustc_trait_selection::traits::{
self, FulfillmentContext, ImplSource, Obligation, ObligationCause, SelectionContext,
self, ImplSource, Obligation, ObligationCause, SelectionContext, TraitEngineExt,
};
use super::ConstCx;
@ -191,7 +191,7 @@ impl Qualif for NeedsNonConstDrop {
// If we successfully found one, then select all of the predicates
// implied by our const drop impl.
let mut fcx = FulfillmentContext::new();
let mut fcx = <dyn TraitEngine<'tcx>>::new(cx.tcx);
for nested in impl_src.nested_obligations() {
fcx.register_predicate_obligation(&infcx, nested);
}