@@ -64,7 +64,7 @@ fn is_dyn_compatible(tcx: TyCtxt<'_>, trait_def_id: DefId) -> bool {
64
64
}
65
65
66
66
/// We say a method is *vtable safe* if it can be invoked on a trait
67
- /// object. Note that object-safe traits can have some
67
+ /// object. Note that dyn-compatible traits can have some
68
68
/// non-vtable-safe methods, so long as they require `Self: Sized` or
69
69
/// otherwise ensure that they cannot be used when `Self = Trait`.
70
70
pub fn is_vtable_safe_method ( tcx : TyCtxt < ' _ > , trait_def_id : DefId , method : ty:: AssocItem ) -> bool {
@@ -421,7 +421,7 @@ fn virtual_call_violations_for_method<'tcx>(
421
421
let receiver_ty = tcx. liberate_late_bound_regions ( method. def_id , sig. input ( 0 ) ) ;
422
422
423
423
// Until `unsized_locals` is fully implemented, `self: Self` can't be dispatched on.
424
- // However, this is already considered object-safe . We allow it as a special case here.
424
+ // However, this is already considered dyn compatible . We allow it as a special case here.
425
425
// FIXME(mikeyhew) get rid of this `if` statement once `receiver_is_dispatchable` allows
426
426
// `Receiver: Unsize<Receiver[Self => dyn Trait]>`.
427
427
if receiver_ty != tcx. types . self_param {
@@ -631,7 +631,7 @@ fn object_ty_for_trait<'tcx>(
631
631
/// - `self: Pin<Box<Self>>` requires `Pin<Box<Self>>: DispatchFromDyn<Pin<Box<dyn Trait>>>`.
632
632
///
633
633
/// The only case where the receiver is not dispatchable, but is still a valid receiver
634
- /// type (just not object-safe ), is when there is more than one level of pointer indirection.
634
+ /// type (just not dyn compatible ), is when there is more than one level of pointer indirection.
635
635
/// E.g., `self: &&Self`, `self: &Rc<Self>`, `self: Box<Box<Self>>`. In these cases, there
636
636
/// is no way, or at least no inexpensive way, to coerce the receiver from the version where
637
637
/// `Self = dyn Trait` to the version where `Self = T`, where `T` is the unknown erased type
0 commit comments