@@ -237,7 +237,7 @@ pub(crate) mod rustc {
237237
238238 ty:: Tuple ( members) => Self :: from_tuple ( ( ty, layout) , members, cx) ,
239239
240- ty:: Array ( inner_ty, len ) => {
240+ ty:: Array ( inner_ty, _len ) => {
241241 let FieldsShape :: Array { stride, count } = & layout. fields else {
242242 return Err ( Err :: NotYetSupported ) ;
243243 } ;
@@ -282,7 +282,6 @@ pub(crate) mod rustc {
282282 FieldsShape :: Primitive => {
283283 assert_eq ! ( members. len( ) , 1 ) ;
284284 let inner_ty = members[ 0 ] ;
285- let inner_layout = layout_of ( cx, inner_ty) ?;
286285 Self :: from_ty ( inner_ty, cx)
287286 }
288287 FieldsShape :: Arbitrary { offsets, .. } => {
@@ -345,7 +344,7 @@ pub(crate) mod rustc {
345344 // the enum delegates its layout to the variant at `index`.
346345 layout_of_variant ( * index, None )
347346 }
348- Variants :: Multiple { tag, tag_encoding, tag_field, .. } => {
347+ Variants :: Multiple { tag : _ , tag_encoding, tag_field, .. } => {
349348 // `Variants::Multiple` denotes an enum with multiple
350349 // variants. The layout of such an enum is the disjunction
351350 // of the layouts of its tagged variants.
@@ -356,7 +355,7 @@ pub(crate) mod rustc {
356355
357356 let variants = def. discriminants ( cx. tcx ( ) ) . try_fold (
358357 Self :: uninhabited ( ) ,
359- |variants, ( idx, ref discriminant ) | {
358+ |variants, ( idx, _discriminant ) | {
360359 let variant = layout_of_variant ( idx, Some ( tag_encoding. clone ( ) ) ) ?;
361360 Result :: < Self , Err > :: Ok ( variants. or ( variant) )
362361 } ,
@@ -414,7 +413,7 @@ pub(crate) mod rustc {
414413
415414 // Append the fields, in memory order, to the layout.
416415 let inverse_memory_index = memory_index. invert_bijective_mapping ( ) ;
417- for ( memory_idx , & field_idx) in inverse_memory_index. iter_enumerated ( ) {
416+ for & field_idx in inverse_memory_index. iter ( ) {
418417 // Add interfield padding.
419418 let padding_needed = offsets[ field_idx] - size;
420419 let padding = Self :: padding ( padding_needed. bytes_usize ( ) ) ;
@@ -468,15 +467,14 @@ pub(crate) mod rustc {
468467
469468 // This constructor does not support non-`FieldsShape::Union`
470469 // layouts. Fields of this shape are all placed at offset 0.
471- let FieldsShape :: Union ( fields ) = layout. fields ( ) else {
470+ let FieldsShape :: Union ( _fields ) = layout. fields ( ) else {
472471 return Err ( Err :: NotYetSupported ) ;
473472 } ;
474473
475474 let fields = & def. non_enum_variant ( ) . fields ;
476475 let fields = fields. iter_enumerated ( ) . try_fold (
477476 Self :: uninhabited ( ) ,
478- |fields, ( idx, field_def) | {
479- let field_def = Def :: Field ( field_def) ;
477+ |fields, ( idx, _field_def) | {
480478 let field_ty = ty_field ( cx, ( ty, layout) , idx) ;
481479 let field_layout = layout_of ( cx, field_ty) ?;
482480 let field = Self :: from_ty ( field_ty, cx) ?;
0 commit comments