File tree 5 files changed +40
-0
lines changed
5 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -266,6 +266,14 @@ impl<'ctx> MonotoneFramework for CannotDeriveCopy<'ctx> {
266
266
self . is_not_copy ( data. ty ( ) )
267
267
}
268
268
Field :: Bitfields ( ref bfu) => {
269
+ if bfu. layout ( ) . align > RUST_DERIVE_IN_ARRAY_LIMIT {
270
+ trace ! (
271
+ " we cannot derive Copy for a bitfield larger then \
272
+ the limit"
273
+ ) ;
274
+ return true ;
275
+ }
276
+
269
277
bfu. bitfields ( ) . iter ( ) . any ( |b| {
270
278
self . is_not_copy ( b. ty ( ) )
271
279
} )
Original file line number Diff line number Diff line change @@ -268,6 +268,14 @@ impl<'ctx> MonotoneFramework for CannotDeriveDebug<'ctx> {
268
268
self . is_not_debug ( data. ty ( ) )
269
269
}
270
270
Field :: Bitfields ( ref bfu) => {
271
+ if bfu. layout ( ) . align > RUST_DERIVE_IN_ARRAY_LIMIT {
272
+ trace ! (
273
+ " we cannot derive Debug for a bitfield larger then \
274
+ the limit"
275
+ ) ;
276
+ return true ;
277
+ }
278
+
271
279
bfu. bitfields ( ) . iter ( ) . any ( |b| {
272
280
self . is_not_debug ( b. ty ( ) )
273
281
} )
Original file line number Diff line number Diff line change @@ -308,6 +308,14 @@ impl<'ctx> MonotoneFramework for CannotDeriveDefault<'ctx> {
308
308
self . is_not_default ( data. ty ( ) )
309
309
}
310
310
Field :: Bitfields ( ref bfu) => {
311
+ if bfu. layout ( ) . align > RUST_DERIVE_IN_ARRAY_LIMIT {
312
+ trace ! (
313
+ " we cannot derive Default for a bitfield larger then \
314
+ the limit"
315
+ ) ;
316
+ return true ;
317
+ }
318
+
311
319
bfu. bitfields ( ) . iter ( ) . any ( |b| {
312
320
!self . ctx . whitelisted_items ( ) . contains (
313
321
& b. ty ( ) ,
Original file line number Diff line number Diff line change @@ -283,6 +283,14 @@ impl<'ctx> MonotoneFramework for CannotDeriveHash<'ctx> {
283
283
self . cannot_derive_hash . contains ( & data. ty ( ) )
284
284
}
285
285
Field :: Bitfields ( ref bfu) => {
286
+ if bfu. layout ( ) . align > RUST_DERIVE_IN_ARRAY_LIMIT {
287
+ trace ! (
288
+ " we cannot derive Hash for a bitfield larger then \
289
+ the limit"
290
+ ) ;
291
+ return true ;
292
+ }
293
+
286
294
bfu. bitfields ( ) . iter ( ) . any ( |b| {
287
295
!self . ctx . whitelisted_items ( ) . contains (
288
296
& b. ty ( ) ,
Original file line number Diff line number Diff line change @@ -292,6 +292,14 @@ impl<'ctx> MonotoneFramework for CannotDerivePartialEqOrPartialOrd<'ctx> {
292
292
)
293
293
}
294
294
Field :: Bitfields ( ref bfu) => {
295
+ if bfu. layout ( ) . align > RUST_DERIVE_IN_ARRAY_LIMIT {
296
+ trace ! (
297
+ " we cannot derive PartialEq for a bitfield larger then \
298
+ the limit"
299
+ ) ;
300
+ return true ;
301
+ }
302
+
295
303
bfu. bitfields ( ) . iter ( ) . any ( |b| {
296
304
!self . ctx . whitelisted_items ( ) . contains (
297
305
& b. ty ( ) ,
You can’t perform that action at this time.
0 commit comments