@@ -237,7 +237,7 @@ pub(crate) mod rustc {
237
237
238
238
ty:: Tuple ( members) => Self :: from_tuple ( ( ty, layout) , members, cx) ,
239
239
240
- ty:: Array ( inner_ty, len ) => {
240
+ ty:: Array ( inner_ty, _len ) => {
241
241
let FieldsShape :: Array { stride, count } = & layout. fields else {
242
242
return Err ( Err :: NotYetSupported ) ;
243
243
} ;
@@ -282,7 +282,6 @@ pub(crate) mod rustc {
282
282
FieldsShape :: Primitive => {
283
283
assert_eq ! ( members. len( ) , 1 ) ;
284
284
let inner_ty = members[ 0 ] ;
285
- let inner_layout = layout_of ( cx, inner_ty) ?;
286
285
Self :: from_ty ( inner_ty, cx)
287
286
}
288
287
FieldsShape :: Arbitrary { offsets, .. } => {
@@ -345,7 +344,7 @@ pub(crate) mod rustc {
345
344
// the enum delegates its layout to the variant at `index`.
346
345
layout_of_variant ( * index, None )
347
346
}
348
- Variants :: Multiple { tag, tag_encoding, tag_field, .. } => {
347
+ Variants :: Multiple { tag : _ , tag_encoding, tag_field, .. } => {
349
348
// `Variants::Multiple` denotes an enum with multiple
350
349
// variants. The layout of such an enum is the disjunction
351
350
// of the layouts of its tagged variants.
@@ -356,7 +355,7 @@ pub(crate) mod rustc {
356
355
357
356
let variants = def. discriminants ( cx. tcx ( ) ) . try_fold (
358
357
Self :: uninhabited ( ) ,
359
- |variants, ( idx, ref discriminant ) | {
358
+ |variants, ( idx, _discriminant ) | {
360
359
let variant = layout_of_variant ( idx, Some ( tag_encoding. clone ( ) ) ) ?;
361
360
Result :: < Self , Err > :: Ok ( variants. or ( variant) )
362
361
} ,
@@ -414,7 +413,7 @@ pub(crate) mod rustc {
414
413
415
414
// Append the fields, in memory order, to the layout.
416
415
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 ( ) {
418
417
// Add interfield padding.
419
418
let padding_needed = offsets[ field_idx] - size;
420
419
let padding = Self :: padding ( padding_needed. bytes_usize ( ) ) ;
@@ -468,15 +467,14 @@ pub(crate) mod rustc {
468
467
469
468
// This constructor does not support non-`FieldsShape::Union`
470
469
// 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 {
472
471
return Err ( Err :: NotYetSupported ) ;
473
472
} ;
474
473
475
474
let fields = & def. non_enum_variant ( ) . fields ;
476
475
let fields = fields. iter_enumerated ( ) . try_fold (
477
476
Self :: uninhabited ( ) ,
478
- |fields, ( idx, field_def) | {
479
- let field_def = Def :: Field ( field_def) ;
477
+ |fields, ( idx, _field_def) | {
480
478
let field_ty = ty_field ( cx, ( ty, layout) , idx) ;
481
479
let field_layout = layout_of ( cx, field_ty) ?;
482
480
let field = Self :: from_ty ( field_ty, cx) ?;
0 commit comments