@@ -924,7 +924,7 @@ impl CodeGenerator for Type {
924924 // on our layout if converting the inner item fails.
925925 let ( mut inner_ty, _) = inner_item
926926 . try_to_rust_ty_or_opaque ( ctx, & ( ) )
927- . map ( |ty| ty. to_outer_type ( ) )
927+ . map ( |ty| ty. into_outer_type ( ) )
928928 . unwrap_or_else ( |_| {
929929 ( self . to_opaque ( ctx, item) , RustTyAnnotation :: None )
930930 } ) ;
@@ -1435,7 +1435,7 @@ impl<'a> FieldCodegen<'a> for FieldData {
14351435 self . ty ( ) . into_resolver ( ) . through_type_refs ( ) . resolve ( ctx) ;
14361436 let field_ty = field_item. expect_type ( ) ;
14371437 let ty = self . ty ( ) . to_rust_ty_or_opaque ( ctx, & ( ) ) ;
1438- let ( mut ty, ty_annotations) = ty. to_outer_type ( ) ;
1438+ let ( mut ty, ty_annotations) = ty. into_outer_type ( ) ;
14391439 ty. append_implicit_template_params ( ctx, field_item) ;
14401440
14411441 // NB: If supported, we use proper `union` types.
@@ -3983,11 +3983,11 @@ impl RustTy {
39833983
39843984 // Use when this is an inner type and will become part of an outer type.
39853985 // Pass the annotation into [wraps]
3986- fn to_outer_type ( self ) -> ( proc_macro2:: TokenStream , RustTyAnnotation ) {
3986+ fn into_outer_type ( self ) -> ( proc_macro2:: TokenStream , RustTyAnnotation ) {
39873987 ( self . ts , self . annotation )
39883988 }
39893989
3990- fn to_unannotated_ts ( self ) -> error:: Result < proc_macro2:: TokenStream > {
3990+ fn into_unannotated_ts ( self ) -> error:: Result < proc_macro2:: TokenStream > {
39913991 if matches ! ( self . annotation, RustTyAnnotation :: None ) {
39923992 Ok ( self . ts )
39933993 } else {
@@ -4095,7 +4095,7 @@ impl TryToRustTy for Type {
40954095 // sizeof(NonZero<_>) optimization with opaque blobs (because
40964096 // they aren't NonZero), so don't *ever* use an or_opaque
40974097 // variant here.
4098- let ty = fs. try_to_rust_ty ( ctx, & ( ) ) ?. to_unannotated_ts ( ) ?;
4098+ let ty = fs. try_to_rust_ty ( ctx, & ( ) ) ?. into_unannotated_ts ( ) ?;
40994099
41004100 let prefix = ctx. trait_prefix ( ) ;
41014101 Ok ( quote ! {
@@ -4104,7 +4104,8 @@ impl TryToRustTy for Type {
41044104 . into ( ) )
41054105 }
41064106 TypeKind :: Array ( item, len) | TypeKind :: Vector ( item, len) => {
4107- let ty = item. try_to_rust_ty ( ctx, & ( ) ) ?. to_unannotated_ts ( ) ?;
4107+ let ty =
4108+ item. try_to_rust_ty ( ctx, & ( ) ) ?. into_unannotated_ts ( ) ?;
41084109 Ok ( quote ! {
41094110 [ #ty ; #len ]
41104111 }
@@ -4148,7 +4149,7 @@ impl TryToRustTy for Type {
41484149 if info. has_non_type_template_params ( ) ||
41494150 ( item. is_opaque ( ctx, & ( ) ) && !template_params. is_empty ( ) )
41504151 {
4151- return Ok ( self . try_to_opaque ( ctx, item) ? ) ;
4152+ return self . try_to_opaque ( ctx, item) ;
41524153 }
41534154
41544155 Ok ( utils:: build_path ( item, ctx) ?. into ( ) )
@@ -4172,7 +4173,7 @@ impl TryToRustTy for Type {
41724173 // should always generate a proper pointer here, so use
41734174 // infallible conversion of the inner type.
41744175 let ( mut ty, inner_annotations) =
4175- inner. to_rust_ty_or_opaque ( ctx, & ( ) ) . to_outer_type ( ) ;
4176+ inner. to_rust_ty_or_opaque ( ctx, & ( ) ) . into_outer_type ( ) ;
41764177 ty. append_implicit_template_params ( ctx, inner) ;
41774178
41784179 // Avoid the first function pointer level, since it's already
@@ -4287,7 +4288,7 @@ impl TryToRustTy for TemplateInstantiation {
42874288 . map ( |( arg, _) | {
42884289 let arg = arg. into_resolver ( ) . through_type_refs ( ) . resolve ( ctx) ;
42894290 let mut ty =
4290- arg. try_to_rust_ty ( ctx, & ( ) ) ?. to_unannotated_ts ( ) ?;
4291+ arg. try_to_rust_ty ( ctx, & ( ) ) ?. into_unannotated_ts ( ) ?;
42914292 ty. append_implicit_template_params ( ctx, arg) ;
42924293 Ok ( ty)
42934294 } )
@@ -5492,7 +5493,7 @@ pub(crate) mod utils {
54925493 } else {
54935494 t. to_rust_ty_or_opaque ( ctx, & ( ) )
54945495 } ;
5495- let ( inner_ty, annotations) = rust_ty. to_outer_type ( ) ;
5496+ let ( inner_ty, annotations) = rust_ty. into_outer_type ( ) ;
54965497 RustTy :: wraps (
54975498 inner_ty. to_ptr ( ctx. resolve_type ( t) . is_const ( ) ) ,
54985499 annotations,
0 commit comments