Skip to content

Commit 04cbc1d

Browse files
committed
re-bind receiver_ty to avoid escaping regions errors
Probably the better way to do this would be to use bound_map everywhere, instead of calling skip_binder in the first place. Oh well, let’s do this for now
1 parent ebe1199 commit 04cbc1d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustc/traits/object_safety.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use super::elaborate_predicates;
2222
use hir::def_id::DefId;
2323
use lint;
2424
use traits::{self, Obligation, ObligationCause};
25-
use ty::{self, Ty, TyCtxt, TypeFoldable, Predicate, ToPredicate};
25+
use ty::{self, Ty, TyCtxt, Binder, TypeFoldable, Predicate, ToPredicate};
2626
use ty::subst::{Subst};
2727
use std::borrow::Cow;
2828
use std::iter::{self};
@@ -361,10 +361,10 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
361361
let param_env = {
362362
let mut param_env = self.param_env(method.def_id);
363363

364-
let predicate = ty::TraitRef {
364+
let predicate = Binder::bind(ty::TraitRef {
365365
def_id: unsize_did,
366366
substs: self.mk_substs_trait(self.mk_self_type(), &[target_self_ty.into()]),
367-
}.to_predicate();
367+
}).to_predicate();
368368

369369
let caller_bounds: Vec<Predicate<'tcx>> = param_env.caller_bounds.iter().cloned()
370370
.chain(iter::once(predicate))
@@ -383,10 +383,10 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
383383

384384
// Receiver: CoerceUnsized<Receiver<Self=U>>
385385
let obligation = {
386-
let predicate = ty::TraitRef {
386+
let predicate = Binder::bind(ty::TraitRef {
387387
def_id: coerce_unsized_did,
388388
substs: self.mk_substs_trait(self.mk_self_type(), &[target_receiver_ty.into()]),
389-
}.to_predicate();
389+
}).to_predicate();
390390

391391
Obligation::new(
392392
ObligationCause::dummy(),

0 commit comments

Comments
 (0)