@@ -64,8 +64,8 @@ impl ObjectSafetyViolation {
64
64
format ! ( "method `{}` references the `Self` type in where clauses" , name) . into ( ) ,
65
65
ObjectSafetyViolation :: Method ( name, MethodViolationCode :: Generic ) =>
66
66
format ! ( "method `{}` has generic type parameters" , name) . into ( ) ,
67
- ObjectSafetyViolation :: Method ( name, MethodViolationCode :: UncoercibleReceiver ) =>
68
- format ! ( "method `{}` has an uncoercible receiver type " , name) . into ( ) ,
67
+ ObjectSafetyViolation :: Method ( name, MethodViolationCode :: UndispatchableReceiver ) =>
68
+ format ! ( "method `{}`'s receiver cannot be dispatched on " , name) . into ( ) ,
69
69
ObjectSafetyViolation :: AssociatedConst ( name) =>
70
70
format ! ( "the trait cannot contain associated consts like `{}`" , name) . into ( ) ,
71
71
}
@@ -87,8 +87,8 @@ pub enum MethodViolationCode {
87
87
/// e.g., `fn foo<A>()`
88
88
Generic ,
89
89
90
- /// the self argument can't be coerced from Self=dyn Trait to Self=T where T: Trait
91
- UncoercibleReceiver ,
90
+ /// the method's receiver (` self` argument) can't be dispatched on
91
+ UndispatchableReceiver ,
92
92
}
93
93
94
94
impl < ' a , ' tcx > TyCtxt < ' a , ' tcx , ' tcx > {
@@ -325,7 +325,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
325
325
// `Receiver: Unsize<Receiver[Self => dyn Trait]>`
326
326
if receiver_ty != self . mk_self_type ( ) {
327
327
if !self . receiver_is_dispatchable ( method, receiver_ty) {
328
- return Some ( MethodViolationCode :: UncoercibleReceiver ) ;
328
+ return Some ( MethodViolationCode :: UndispatchableReceiver ) ;
329
329
}
330
330
}
331
331
0 commit comments