@@ -19,7 +19,7 @@ macro_rules! path {
1919 ( $span: expr, $( $part: ident) ::* ) => { vec![ $( Ident :: new( sym:: $part, $span) , ) * ] }
2020}
2121
22- pub ( crate ) fn expand_deriving_smart_ptr (
22+ pub ( crate ) fn expand_deriving_coerce_pointee (
2323 cx : & ExtCtxt < ' _ > ,
2424 span : Span ,
2525 _mitem : & MetaItem ,
@@ -41,7 +41,7 @@ pub(crate) fn expand_deriving_smart_ptr(
4141 cx. dcx ( )
4242 . struct_span_err (
4343 span,
44- "`SmartPointer ` can only be derived on `struct`s with `#[repr(transparent)]`" ,
44+ "`CoercePointee ` can only be derived on `struct`s with `#[repr(transparent)]`" ,
4545 )
4646 . emit ( ) ;
4747 return ;
@@ -54,7 +54,7 @@ pub(crate) fn expand_deriving_smart_ptr(
5454 cx. dcx ( )
5555 . struct_span_err (
5656 span,
57- "`SmartPointer ` can only be derived on `struct`s with at least one field" ,
57+ "`CoercePointee ` can only be derived on `struct`s with at least one field" ,
5858 )
5959 . emit ( ) ;
6060 return ;
@@ -64,7 +64,7 @@ pub(crate) fn expand_deriving_smart_ptr(
6464 cx. dcx ( )
6565 . struct_span_err (
6666 span,
67- "`SmartPointer ` can only be derived on `struct`s with `#[repr(transparent)]`" ,
67+ "`CoercePointee ` can only be derived on `struct`s with `#[repr(transparent)]`" ,
6868 )
6969 . emit ( ) ;
7070 return ;
@@ -94,10 +94,10 @@ pub(crate) fn expand_deriving_smart_ptr(
9494 . collect ( ) ;
9595
9696 let pointee_param_idx = if type_params. is_empty ( ) {
97- // `#[derive(SmartPointer )]` requires at least one generic type on the target `struct`
97+ // `#[derive(CoercePointee )]` requires at least one generic type on the target `struct`
9898 cx. dcx ( ) . struct_span_err (
9999 span,
100- "`SmartPointer ` can only be derived on `struct`s that are generic over at least one type" ,
100+ "`CoercePointee ` can only be derived on `struct`s that are generic over at least one type" ,
101101 ) . emit ( ) ;
102102 return ;
103103 } else if type_params. len ( ) == 1 {
@@ -113,15 +113,15 @@ pub(crate) fn expand_deriving_smart_ptr(
113113 ( None , _) => {
114114 cx. dcx ( ) . struct_span_err (
115115 span,
116- "exactly one generic type parameter must be marked as #[pointee] to derive SmartPointer traits" ,
116+ "exactly one generic type parameter must be marked as #[pointee] to derive CoercePointee traits" ,
117117 ) . emit ( ) ;
118118 return ;
119119 }
120120 ( Some ( ( _, one) ) , Some ( ( _, another) ) ) => {
121121 cx. dcx ( )
122122 . struct_span_err (
123123 vec ! [ one, another] ,
124- "only one type parameter can be marked as `#[pointee]` when deriving SmartPointer traits" ,
124+ "only one type parameter can be marked as `#[pointee]` when deriving CoercePointee traits" ,
125125 )
126126 . emit ( ) ;
127127 return ;
@@ -185,7 +185,7 @@ pub(crate) fn expand_deriving_smart_ptr(
185185 . struct_span_err (
186186 pointee_ty_ident. span ,
187187 format ! (
188- "`derive(SmartPointer )` requires {} to be marked `?Sized`" ,
188+ "`derive(CoercePointee )` requires {} to be marked `?Sized`" ,
189189 pointee_ty_ident. name
190190 ) ,
191191 )
@@ -195,7 +195,7 @@ pub(crate) fn expand_deriving_smart_ptr(
195195 let arg = GenericArg :: Type ( s_ty. clone ( ) ) ;
196196 let unsize = cx. path_all ( span, true , path ! ( span, core:: marker:: Unsize ) , vec ! [ arg] ) ;
197197 pointee. bounds . push ( cx. trait_bound ( unsize, false ) ) ;
198- // Drop `#[pointee]` attribute since it should not be recognized outside `derive(SmartPointer )`
198+ // Drop `#[pointee]` attribute since it should not be recognized outside `derive(CoercePointee )`
199199 pointee. attrs . retain ( |attr| !attr. has_name ( sym:: pointee) ) ;
200200 }
201201
0 commit comments