@@ -64,8 +64,8 @@ impl ObjectSafetyViolation {
6464 format ! ( "method `{}` references the `Self` type in where clauses" , name) . into ( ) ,
6565 ObjectSafetyViolation :: Method ( name, MethodViolationCode :: Generic ) =>
6666 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 ( ) ,
6969 ObjectSafetyViolation :: AssociatedConst ( name) =>
7070 format ! ( "the trait cannot contain associated consts like `{}`" , name) . into ( ) ,
7171 }
@@ -87,8 +87,8 @@ pub enum MethodViolationCode {
8787 /// e.g., `fn foo<A>()`
8888 Generic ,
8989
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 ,
9292}
9393
9494impl < ' a , ' tcx > TyCtxt < ' a , ' tcx , ' tcx > {
@@ -325,7 +325,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
325325 // `Receiver: Unsize<Receiver[Self => dyn Trait]>`
326326 if receiver_ty != self . mk_self_type ( ) {
327327 if !self . receiver_is_dispatchable ( method, receiver_ty) {
328- return Some ( MethodViolationCode :: UncoercibleReceiver ) ;
328+ return Some ( MethodViolationCode :: UndispatchableReceiver ) ;
329329 }
330330 }
331331
0 commit comments