Review changes
This commit is contained in:
parent
66c179946b
commit
3dea68de1d
67 changed files with 581 additions and 590 deletions
|
@ -414,9 +414,9 @@ impl AutoTraitFinder<'tcx> {
|
|||
let mut should_add_new = true;
|
||||
user_computed_preds.retain(|&old_pred| {
|
||||
if let (
|
||||
ty::PredicateAtom::Trait(new_trait, _),
|
||||
ty::PredicateAtom::Trait(old_trait, _),
|
||||
) = (new_pred.skip_binders(), old_pred.skip_binders())
|
||||
ty::PredicateKind::Trait(new_trait, _),
|
||||
ty::PredicateKind::Trait(old_trait, _),
|
||||
) = (new_pred.kind().skip_binder(), old_pred.kind().skip_binder())
|
||||
{
|
||||
if new_trait.def_id() == old_trait.def_id() {
|
||||
let new_substs = new_trait.trait_ref.substs;
|
||||
|
@ -633,16 +633,16 @@ impl AutoTraitFinder<'tcx> {
|
|||
// We check this by calling is_of_param on the relevant types
|
||||
// from the various possible predicates
|
||||
|
||||
let bound_predicate = predicate.bound_atom();
|
||||
let bound_predicate = predicate.kind();
|
||||
match bound_predicate.skip_binder() {
|
||||
ty::PredicateAtom::Trait(p, _) => {
|
||||
ty::PredicateKind::Trait(p, _) => {
|
||||
// Add this to `predicates` so that we end up calling `select`
|
||||
// with it. If this predicate ends up being unimplemented,
|
||||
// then `evaluate_predicates` will handle adding it the `ParamEnv`
|
||||
// if possible.
|
||||
predicates.push_back(bound_predicate.rebind(p));
|
||||
}
|
||||
ty::PredicateAtom::Projection(p) => {
|
||||
ty::PredicateKind::Projection(p) => {
|
||||
let p = bound_predicate.rebind(p);
|
||||
debug!(
|
||||
"evaluate_nested_obligations: examining projection predicate {:?}",
|
||||
|
@ -772,13 +772,13 @@ impl AutoTraitFinder<'tcx> {
|
|||
}
|
||||
}
|
||||
}
|
||||
ty::PredicateAtom::RegionOutlives(binder) => {
|
||||
ty::PredicateKind::RegionOutlives(binder) => {
|
||||
let binder = bound_predicate.rebind(binder);
|
||||
if select.infcx().region_outlives_predicate(&dummy_cause, binder).is_err() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
ty::PredicateAtom::TypeOutlives(binder) => {
|
||||
ty::PredicateKind::TypeOutlives(binder) => {
|
||||
let binder = bound_predicate.rebind(binder);
|
||||
match (
|
||||
binder.no_bound_vars(),
|
||||
|
@ -801,7 +801,7 @@ impl AutoTraitFinder<'tcx> {
|
|||
_ => {}
|
||||
};
|
||||
}
|
||||
ty::PredicateAtom::ConstEquate(c1, c2) => {
|
||||
ty::PredicateKind::ConstEquate(c1, c2) => {
|
||||
let evaluate = |c: &'tcx ty::Const<'tcx>| {
|
||||
if let ty::ConstKind::Unevaluated(def, substs, promoted) = c.val {
|
||||
match select.infcx().const_eval_resolve(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue