Skip to content

Commit 825cb5b

Browse files
committed
fix rebase
1 parent cd9743b commit 825cb5b

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

src/librustc_infer/infer/outlives/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn explicit_outlives_bounds<'tcx>(
1616
.caller_bounds()
1717
.into_iter()
1818
.map(ty::Predicate::skip_binders)
19-
.filter(TypeFoldable::has_escaping_bound_vars)
19+
.filter(|atom| !atom.has_escaping_bound_vars())
2020
.filter_map(move |atom| match atom {
2121
ty::PredicateAtom::Projection(..)
2222
| ty::PredicateAtom::Trait(..)

src/librustc_lint/builtin.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,8 +1208,6 @@ impl<'tcx> LateLintPass<'tcx> for TrivialConstraints {
12081208
let def_id = cx.tcx.hir().local_def_id(item.hir_id);
12091209
let predicates = cx.tcx.predicates_of(def_id);
12101210
for &(predicate, span) in predicates.predicates {
1211-
// We don't actually look inside of the predicate,
1212-
// so it is safe to skip this binder here.
12131211
let predicate_kind_name = match predicate.skip_binders() {
12141212
Trait(..) => "Trait",
12151213
TypeOutlives(..) |

src/librustc_middle/ty/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,14 +1377,14 @@ impl ToPredicate<'tcx> for PredicateKind<'tcx> {
13771377

13781378
impl ToPredicate<'tcx> for PredicateAtom<'tcx> {
13791379
#[inline(always)]
1380-
fn to_predicate(&self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1380+
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
13811381
debug_assert!(!self.has_escaping_bound_vars(), "excaping bound vars for {:?}", self);
1382-
tcx.mk_predicate(ty::PredicateKind::Atom(*self))
1382+
tcx.mk_predicate(ty::PredicateKind::Atom(self))
13831383
}
13841384
}
13851385

13861386
impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<TraitRef<'tcx>> {
1387-
fn to_predicate(&self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1387+
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
13881388
ty::PredicateAtom::Trait(ty::TraitPredicate { trait_ref: self.value }, self.constness)
13891389
.to_predicate(tcx)
13901390
}

src/librustc_trait_selection/traits/fulfill.rs

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -471,29 +471,31 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
471471
}
472472
}
473473

474-
ty::PredicateAtom::ConstEquate(c1, c2) => {
475-
debug!("equating consts: c1={:?} c2={:?}", c1, c2);
476-
477-
let stalled_on = &mut pending_obligation.stalled_on;
478-
479-
let mut evaluate = |c: &'tcx Const<'tcx>| {
480-
if let ty::ConstKind::Unevaluated(def, substs, promoted) = c.val {
481-
match self.selcx.infcx().const_eval_resolve(
482-
obligation.param_env,
483-
def,
484-
substs,
485-
promoted,
486-
Some(obligation.cause.span),
487-
) {
488-
Ok(val) => Ok(Const::from_value(self.selcx.tcx(), val, c.ty)),
489-
Err(ErrorHandled::TooGeneric) => {
490-
stalled_on.append(
491-
&mut substs
492-
.types()
493-
.filter_map(|ty| TyOrConstInferVar::maybe_from_ty(ty))
494-
.collect(),
495-
);
496-
Err(ErrorHandled::TooGeneric)
474+
ty::PredicateAtom::ConstEquate(c1, c2) => {
475+
debug!("equating consts: c1={:?} c2={:?}", c1, c2);
476+
477+
let stalled_on = &mut pending_obligation.stalled_on;
478+
479+
let mut evaluate = |c: &'tcx Const<'tcx>| {
480+
if let ty::ConstKind::Unevaluated(def, substs, promoted) = c.val {
481+
match self.selcx.infcx().const_eval_resolve(
482+
obligation.param_env,
483+
def,
484+
substs,
485+
promoted,
486+
Some(obligation.cause.span),
487+
) {
488+
Ok(val) => Ok(Const::from_value(self.selcx.tcx(), val, c.ty)),
489+
Err(ErrorHandled::TooGeneric) => {
490+
stalled_on.append(
491+
&mut substs
492+
.types()
493+
.filter_map(|ty| TyOrConstInferVar::maybe_from_ty(ty))
494+
.collect(),
495+
);
496+
Err(ErrorHandled::TooGeneric)
497+
}
498+
Err(err) => Err(err),
497499
}
498500
} else {
499501
Ok(c)

0 commit comments

Comments
 (0)