Skip to content

Commit 831e821

Browse files
committed
It's the receiver type we're checking, not Self
fixes a bug that made everything non-object-safe
1 parent 04cbc1d commit 831e821

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc/traits/object_safety.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
385385
let obligation = {
386386
let predicate = Binder::bind(ty::TraitRef {
387387
def_id: coerce_unsized_did,
388-
substs: self.mk_substs_trait(self.mk_self_type(), &[target_receiver_ty.into()]),
388+
substs: self.mk_substs_trait(receiver_ty, &[target_receiver_ty.into()]),
389389
}).to_predicate();
390390

391391
Obligation::new(

0 commit comments

Comments
 (0)