update docs for simplify_type
This commit is contained in:
parent
026d8ce7f5
commit
55f938b589
7 changed files with 66 additions and 60 deletions
|
@ -36,7 +36,7 @@ use rustc_infer::infer::LateBoundRegionConversionTime;
|
|||
use rustc_middle::dep_graph::{DepKind, DepNodeIndex};
|
||||
use rustc_middle::mir::interpret::ErrorHandled;
|
||||
use rustc_middle::thir::abstract_const::NotConstEvaluatable;
|
||||
use rustc_middle::ty::fast_reject::{self, SimplifyParams};
|
||||
use rustc_middle::ty::fast_reject::{self, TreatParams};
|
||||
use rustc_middle::ty::print::with_no_trimmed_paths;
|
||||
use rustc_middle::ty::relate::TypeRelation;
|
||||
use rustc_middle::ty::subst::{GenericArgKind, Subst, SubstsRef};
|
||||
|
@ -2180,8 +2180,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
|
||||
fn fast_reject_trait_refs(
|
||||
&mut self,
|
||||
obligation: &TraitObligation<'_>,
|
||||
impl_trait_ref: &ty::TraitRef<'_>,
|
||||
obligation: &TraitObligation<'tcx>,
|
||||
impl_trait_ref: &ty::TraitRef<'tcx>,
|
||||
) -> bool {
|
||||
// We can avoid creating type variables and doing the full
|
||||
// substitution if we find that any of the input types, when
|
||||
|
@ -2197,10 +2197,13 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
let simplified_obligation_ty = fast_reject::simplify_type(
|
||||
self.tcx(),
|
||||
obligation_ty,
|
||||
SimplifyParams::Yes,
|
||||
TreatParams::AsBoundTypes,
|
||||
);
|
||||
let simplified_impl_ty = fast_reject::simplify_type(
|
||||
self.tcx(),
|
||||
impl_ty,
|
||||
TreatParams::AsPlaceholders,
|
||||
);
|
||||
let simplified_impl_ty =
|
||||
fast_reject::simplify_type(self.tcx(), impl_ty, SimplifyParams::No);
|
||||
|
||||
simplified_obligation_ty.is_some()
|
||||
&& simplified_impl_ty.is_some()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue