fast_reject: remove StripReferences
This commit is contained in:
parent
165142e993
commit
0efc6c02cb
7 changed files with 20 additions and 68 deletions
|
@ -15,7 +15,7 @@ use crate::traits::{
|
|||
};
|
||||
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
|
||||
use rustc_middle::traits::specialization_graph::OverlapMode;
|
||||
use rustc_middle::ty::fast_reject::{self, SimplifyParams, StripReferences};
|
||||
use rustc_middle::ty::fast_reject::{self, SimplifyParams};
|
||||
use rustc_middle::ty::fold::TypeFoldable;
|
||||
use rustc_middle::ty::subst::Subst;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
|
@ -82,8 +82,8 @@ where
|
|||
impl2_ref.iter().flat_map(|tref| tref.substs.types()),
|
||||
)
|
||||
.any(|(ty1, ty2)| {
|
||||
let t1 = fast_reject::simplify_type(tcx, ty1, SimplifyParams::No, StripReferences::No);
|
||||
let t2 = fast_reject::simplify_type(tcx, ty2, SimplifyParams::No, StripReferences::No);
|
||||
let t1 = fast_reject::simplify_type(tcx, ty1, SimplifyParams::No);
|
||||
let t2 = fast_reject::simplify_type(tcx, ty2, SimplifyParams::No);
|
||||
|
||||
if let (Some(t1), Some(t2)) = (t1, t2) {
|
||||
// Simplified successfully
|
||||
|
|
|
@ -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, StripReferences};
|
||||
use rustc_middle::ty::fast_reject::{self, SimplifyParams};
|
||||
use rustc_middle::ty::print::with_no_trimmed_paths;
|
||||
use rustc_middle::ty::relate::TypeRelation;
|
||||
use rustc_middle::ty::subst::{GenericArgKind, Subst, SubstsRef};
|
||||
|
@ -2172,14 +2172,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
self.tcx(),
|
||||
obligation_ty,
|
||||
SimplifyParams::Yes,
|
||||
StripReferences::No,
|
||||
);
|
||||
let simplified_impl_ty = fast_reject::simplify_type(
|
||||
self.tcx(),
|
||||
impl_ty,
|
||||
SimplifyParams::No,
|
||||
StripReferences::No,
|
||||
);
|
||||
let simplified_impl_ty =
|
||||
fast_reject::simplify_type(self.tcx(), impl_ty, SimplifyParams::No);
|
||||
|
||||
simplified_obligation_ty.is_some()
|
||||
&& simplified_impl_ty.is_some()
|
||||
|
|
|
@ -2,7 +2,7 @@ use super::OverlapError;
|
|||
|
||||
use crate::traits;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_middle::ty::fast_reject::{self, SimplifiedType, SimplifyParams, StripReferences};
|
||||
use rustc_middle::ty::fast_reject::{self, SimplifiedType, SimplifyParams};
|
||||
use rustc_middle::ty::print::with_no_trimmed_paths;
|
||||
use rustc_middle::ty::{self, TyCtxt, TypeFoldable};
|
||||
|
||||
|
@ -49,12 +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(),
|
||||
SimplifyParams::No,
|
||||
StripReferences::No,
|
||||
) {
|
||||
if let Some(st) = fast_reject::simplify_type(tcx, trait_ref.self_ty(), SimplifyParams::No) {
|
||||
debug!("insert_blindly: impl_def_id={:?} st={:?}", impl_def_id, st);
|
||||
self.non_blanket_impls.entry(st).or_default().push(impl_def_id)
|
||||
} else {
|
||||
|
@ -69,12 +64,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(),
|
||||
SimplifyParams::No,
|
||||
StripReferences::No,
|
||||
) {
|
||||
if let Some(st) = fast_reject::simplify_type(tcx, trait_ref.self_ty(), SimplifyParams::No) {
|
||||
debug!("remove_existing: impl_def_id={:?} st={:?}", impl_def_id, st);
|
||||
vec = self.non_blanket_impls.get_mut(&st).unwrap();
|
||||
} else {
|
||||
|
@ -322,12 +312,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(),
|
||||
SimplifyParams::No,
|
||||
StripReferences::No,
|
||||
);
|
||||
let simplified = fast_reject::simplify_type(tcx, trait_ref.self_ty(), SimplifyParams::No);
|
||||
|
||||
// Descend the specialization tree, where `parent` is the current parent node.
|
||||
loop {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue