Auto merge of #97024 - lcnr:simplify_type-sus, r=<try>

`simplify_type` improvements and cursed docs

the existing `TreatParams` enum pretty much mixes everything up. Not sure why this looked right to me in #94057

This also includes two changes which impact perf:
- `ty::Projection` with inference vars shouldn't be treated as a rigid type, even if fully normalized
- `ty::Placeholder` only unifies with itself, so actually return `Some` for them

r? `@nikomatsakis`
This commit is contained in:
bors
2022-05-19 13:08:51 +00:00
9 changed files with 63 additions and 86 deletions

View File

@@ -2148,13 +2148,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
let simplified_obligation_ty = fast_reject::simplify_type(
self.tcx(),
obligation_ty,
TreatParams::AsBoundTypes,
);
let simplified_impl_ty = fast_reject::simplify_type(
self.tcx(),
impl_ty,
TreatParams::AsPlaceholders,
TreatParams::AsPlaceholder,
);
let simplified_impl_ty =
fast_reject::simplify_type(self.tcx(), impl_ty, TreatParams::AsInfer);
simplified_obligation_ty.is_some()
&& simplified_impl_ty.is_some()