fix simplify_type
This commit is contained in:
parent
00755e4ca6
commit
db19e2bd01
9 changed files with 63 additions and 86 deletions
|
@ -88,8 +88,8 @@ where
|
|||
impl2_ref.iter().flat_map(|tref| tref.substs.types()),
|
||||
)
|
||||
.any(|(ty1, ty2)| {
|
||||
let t1 = fast_reject::simplify_type(tcx, ty1, TreatParams::AsPlaceholders);
|
||||
let t2 = fast_reject::simplify_type(tcx, ty2, TreatParams::AsPlaceholders);
|
||||
let t1 = fast_reject::simplify_type(tcx, ty1, TreatParams::AsInfer);
|
||||
let t2 = fast_reject::simplify_type(tcx, ty2, TreatParams::AsInfer);
|
||||
|
||||
if let (Some(t1), Some(t2)) = (t1, t2) {
|
||||
// Simplified successfully
|
||||
|
|
|
@ -2142,13 +2142,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()
|
||||
|
|
|
@ -49,8 +49,7 @@ impl ChildrenExt<'_> for Children {
|
|||
/// Insert an impl into this set of children without comparing to any existing impls.
|
||||
fn insert_blindly(&mut self, tcx: TyCtxt<'_>, impl_def_id: DefId) {
|
||||
let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap();
|
||||
if let Some(st) =
|
||||
fast_reject::simplify_type(tcx, trait_ref.self_ty(), TreatParams::AsPlaceholders)
|
||||
if let Some(st) = fast_reject::simplify_type(tcx, trait_ref.self_ty(), TreatParams::AsInfer)
|
||||
{
|
||||
debug!("insert_blindly: impl_def_id={:?} st={:?}", impl_def_id, st);
|
||||
self.non_blanket_impls.entry(st).or_default().push(impl_def_id)
|
||||
|
@ -66,8 +65,7 @@ impl ChildrenExt<'_> for Children {
|
|||
fn remove_existing(&mut self, tcx: TyCtxt<'_>, impl_def_id: DefId) {
|
||||
let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap();
|
||||
let vec: &mut Vec<DefId>;
|
||||
if let Some(st) =
|
||||
fast_reject::simplify_type(tcx, trait_ref.self_ty(), TreatParams::AsPlaceholders)
|
||||
if let Some(st) = fast_reject::simplify_type(tcx, trait_ref.self_ty(), TreatParams::AsInfer)
|
||||
{
|
||||
debug!("remove_existing: impl_def_id={:?} st={:?}", impl_def_id, st);
|
||||
vec = self.non_blanket_impls.get_mut(&st).unwrap();
|
||||
|
@ -316,8 +314,7 @@ impl GraphExt for Graph {
|
|||
|
||||
let mut parent = trait_def_id;
|
||||
let mut last_lint = None;
|
||||
let simplified =
|
||||
fast_reject::simplify_type(tcx, trait_ref.self_ty(), TreatParams::AsPlaceholders);
|
||||
let simplified = fast_reject::simplify_type(tcx, trait_ref.self_ty(), TreatParams::AsInfer);
|
||||
|
||||
// Descend the specialization tree, where `parent` is the current parent node.
|
||||
loop {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue