@@ -213,6 +213,7 @@ pub fn fields(
213
213
let can_write = access != Access :: ReadOnly ;
214
214
215
215
// TODO enumeratedValues
216
+ let inline = quote ! { #[ inline( always) ] } ;
216
217
for f in fields. iter ( ) {
217
218
// TODO(AJM) - do we need to do anything with this range type?
218
219
let BitRange { offset, width, .. } = f. bit_range ;
@@ -314,7 +315,7 @@ pub fn fields(
314
315
let doc = & util:: replace_suffix ( & description, suffixes_str) ;
315
316
r_impl_items. extend ( quote ! {
316
317
#[ doc = #doc]
317
- #[ inline( always ) ]
318
+ #inline
318
319
pub unsafe fn #sc( & self , n: usize ) -> #_pc_r {
319
320
#_pc_r:: new ( #value )
320
321
}
@@ -341,7 +342,7 @@ pub fn fields(
341
342
) ;
342
343
r_impl_items. extend ( quote ! {
343
344
#[ doc = #doc]
344
- #[ inline( always ) ]
345
+ #inline
345
346
pub fn #sc_n( & self ) -> #_pc_r {
346
347
#_pc_r:: new ( #value )
347
348
}
@@ -351,7 +352,7 @@ pub fn fields(
351
352
let doc = description_with_bits ( & description, offset, width) ;
352
353
r_impl_items. extend ( quote ! {
353
354
#[ doc = #doc]
354
- #[ inline( always ) ]
355
+ #inline
355
356
pub fn #sc( & self ) -> #_pc_r {
356
357
#_pc_r:: new ( #value )
357
358
}
@@ -407,7 +408,7 @@ pub fn fields(
407
408
if has_reserved_variant {
408
409
enum_items. extend ( quote ! {
409
410
///Get enumerated values variant
410
- #[ inline( always ) ]
411
+ #inline
411
412
pub fn variant( & self ) -> crate :: Variant <#fty, #pc_r> {
412
413
use crate :: Variant :: * ;
413
414
match self . bits {
@@ -418,7 +419,7 @@ pub fn fields(
418
419
} else {
419
420
enum_items. extend ( quote ! {
420
421
///Get enumerated values variant
421
- #[ inline( always ) ]
422
+ #inline
422
423
pub fn variant( & self ) -> #pc_r {
423
424
match self . bits {
424
425
#arms
@@ -443,7 +444,7 @@ pub fn fields(
443
444
let doc = format ! ( "Checks if the value of the field is `{}`" , pc) ;
444
445
enum_items. extend ( quote ! {
445
446
#[ doc = #doc]
446
- #[ inline( always ) ]
447
+ #inline
447
448
pub fn #is_variant( & self ) -> bool {
448
449
* self == #pc_r:: #pc
449
450
}
@@ -496,7 +497,7 @@ pub fn fields(
496
497
497
498
proxy_items. extend ( quote ! {
498
499
///Writes `variant` to the field
499
- #[ inline( always ) ]
500
+ #inline
500
501
pub fn variant( self , variant: #pc_w) -> & ' a mut W {
501
502
#unsafety {
502
503
self . #bits( variant. into( ) )
@@ -511,7 +512,7 @@ pub fn fields(
511
512
let doc = util:: escape_brackets ( util:: respace ( & v. doc ) . as_ref ( ) ) ;
512
513
proxy_items. extend ( quote ! {
513
514
#[ doc = #doc]
514
- #[ inline( always ) ]
515
+ #inline
515
516
pub fn #sc( self ) -> & ' a mut W {
516
517
self . variant( #pc_w:: #pc)
517
518
}
@@ -522,13 +523,13 @@ pub fn fields(
522
523
if width == 1 {
523
524
proxy_items. extend ( quote ! {
524
525
///Sets the field bit
525
- #[ inline( always ) ]
526
+ #inline
526
527
pub #unsafety fn set_bit( self ) -> & ' a mut W {
527
528
self . bit( true )
528
529
}
529
530
530
531
///Clears the field bit
531
- #[ inline( always ) ]
532
+ #inline
532
533
pub #unsafety fn clear_bit( self ) -> & ' a mut W {
533
534
self . bit( false )
534
535
}
@@ -538,7 +539,7 @@ pub fn fields(
538
539
proxy_items. extend ( if field_dim. is_some ( ) {
539
540
quote ! {
540
541
///Writes raw bits to the field
541
- #[ inline( always ) ]
542
+ #inline
542
543
pub #unsafety fn #bits( self , value: #fty) -> & ' a mut W {
543
544
self . w. bits = ( self . w. bits & !( #hexmask << self . offset) ) | ( ( ( value as #rty) & #hexmask) << self . offset) ;
544
545
self . w
@@ -548,7 +549,7 @@ pub fn fields(
548
549
let offset = & util:: unsuffixed ( offset) ;
549
550
quote ! {
550
551
///Writes raw bits to the field
551
- #[ inline( always ) ]
552
+ #inline
552
553
pub #unsafety fn #bits( self , value: #fty) -> & ' a mut W {
553
554
self . w. bits = ( self . w. bits & !( #hexmask << #offset) ) | ( ( ( value as #rty) & #hexmask) << #offset) ;
554
555
self . w
@@ -557,7 +558,7 @@ pub fn fields(
557
558
} else {
558
559
quote ! {
559
560
///Writes raw bits to the field
560
- #[ inline( always ) ]
561
+ #inline
561
562
pub #unsafety fn #bits( self , value: #fty) -> & ' a mut W {
562
563
self . w. bits = ( self . w. bits & !#hexmask) | ( ( value as #rty) & #hexmask) ;
563
564
self . w
@@ -591,7 +592,7 @@ pub fn fields(
591
592
let doc = & util:: replace_suffix ( & description, suffixes_str) ;
592
593
w_impl_items. extend ( quote ! {
593
594
#[ doc = #doc]
594
- #[ inline( always ) ]
595
+ #inline
595
596
pub unsafe fn #sc( & mut self , n: usize ) -> #_pc_w {
596
597
#_pc_w { w: self , offset: #offset_calc }
597
598
}
@@ -609,7 +610,7 @@ pub fn fields(
609
610
let sub_offset = util:: unsuffixed ( sub_offset as u64 ) ;
610
611
w_impl_items. extend ( quote ! {
611
612
#[ doc = #doc]
612
- #[ inline( always ) ]
613
+ #inline
613
614
pub fn #sc_n( & mut self ) -> #_pc_w {
614
615
#_pc_w { w: self , offset: #sub_offset }
615
616
}
@@ -619,7 +620,7 @@ pub fn fields(
619
620
let doc = description_with_bits ( & description, offset, width) ;
620
621
w_impl_items. extend ( quote ! {
621
622
#[ doc = #doc]
622
- #[ inline( always ) ]
623
+ #inline
623
624
pub fn #sc( & mut self ) -> #_pc_w {
624
625
#_pc_w { w: self }
625
626
}
0 commit comments