diff options
| author | bors <bors@rust-lang.org> | 2023-07-07 10:32:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-07-07 10:32:42 +0000 |
| commit | 1a449dcfd25143f7e1f6b6f5ddf1c12af361e2ff (patch) | |
| tree | 142f10c8aa13483fc241b510cbb66b386c9b19f5 /compiler/rustc_infer/src | |
| parent | 921f669749a57ab5936721fdd93b2da57b581381 (diff) | |
| parent | 3f8919c09bbf78b6d1d48fbbacbd63ad5a78cf7a (diff) | |
| download | rust-1a449dcfd25143f7e1f6b6f5ddf1c12af361e2ff.tar.gz rust-1a449dcfd25143f7e1f6b6f5ddf1c12af361e2ff.zip | |
Auto merge of #113308 - compiler-errors:poly-select, r=lcnr
Split `SelectionContext::select` into fns that take a binder and don't
*most* usages of `SelectionContext::select` don't need to use a binder, but wrap them in a dummy because of the signature. Let's split this out into `SelectionContext::{select,poly_select}` and limit the usages of the latter.
Right now, we only have 3 places where we're calling `poly_select` -- fulfillment, internally within the old solver, and the auto-trait finder.
r? `@lcnr`
Diffstat (limited to 'compiler/rustc_infer/src')
| -rw-r--r-- | compiler/rustc_infer/src/traits/mod.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_infer/src/traits/mod.rs b/compiler/rustc_infer/src/traits/mod.rs index 6da490a90ee..626dd9359a1 100644 --- a/compiler/rustc_infer/src/traits/mod.rs +++ b/compiler/rustc_infer/src/traits/mod.rs @@ -62,7 +62,8 @@ impl<'tcx, P> From<Obligation<'tcx, P>> for solve::Goal<'tcx, P> { } pub type PredicateObligation<'tcx> = Obligation<'tcx, ty::Predicate<'tcx>>; -pub type TraitObligation<'tcx> = Obligation<'tcx, ty::PolyTraitPredicate<'tcx>>; +pub type TraitObligation<'tcx> = Obligation<'tcx, ty::TraitPredicate<'tcx>>; +pub type PolyTraitObligation<'tcx> = Obligation<'tcx, ty::PolyTraitPredicate<'tcx>>; impl<'tcx> PredicateObligation<'tcx> { /// Flips the polarity of the inner predicate. @@ -86,7 +87,7 @@ impl<'tcx> PredicateObligation<'tcx> { } } -impl<'tcx> TraitObligation<'tcx> { +impl<'tcx> PolyTraitObligation<'tcx> { /// Returns `true` if the trait predicate is considered `const` in its ParamEnv. pub fn is_const(&self) -> bool { matches!( @@ -193,7 +194,7 @@ impl<'tcx> FulfillmentError<'tcx> { } } -impl<'tcx> TraitObligation<'tcx> { +impl<'tcx> PolyTraitObligation<'tcx> { pub fn polarity(&self) -> ty::ImplPolarity { self.predicate.skip_binder().polarity } |
