Auto merge of #95333 - GuillaumeGomez:auto-trait-perf-issue, r=oli-obk
Fix perf issue for auto trait selection Follow-up of https://github.com/rust-lang/rust/pull/95069 which fixes the perf issue introduced by it. r? `@oli-obk`
This commit is contained in:
commit
3badf5c51c
3 changed files with 31 additions and 28 deletions
|
@ -999,6 +999,15 @@ impl<'tcx> PolyTraitRef<'tcx> {
|
|||
polarity: ty::ImplPolarity::Positive,
|
||||
})
|
||||
}
|
||||
|
||||
/// Same as [`PolyTraitRef::to_poly_trait_predicate`] but sets a negative polarity instead.
|
||||
pub fn to_poly_trait_predicate_negative_polarity(&self) -> ty::PolyTraitPredicate<'tcx> {
|
||||
self.map_bound(|trait_ref| ty::TraitPredicate {
|
||||
trait_ref,
|
||||
constness: ty::BoundConstness::NotConst,
|
||||
polarity: ty::ImplPolarity::Negative,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// An existential reference to a trait, where `Self` is erased.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue