Skip to content

Commit 73cd404

Browse files
committed
Replace #[inline(always)] by #[inline] due to the later being considered harmful
Signed-off-by: Daniel Egger <[email protected]>
1 parent ad2c8d8 commit 73cd404

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

src/generate.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ pub fn interrupt(
341341
}
342342

343343
unsafe impl Nr for Interrupt {
344-
#[inline(always)]
344+
#[inline]
345345
fn nr(&self) -> u8 {
346346
match *self {
347347
#(#arms)*
@@ -628,7 +628,7 @@ pub fn register(
628628
if access == Access::ReadWrite {
629629
reg_impl_items.push(quote! {
630630
/// Modifies the contents of the register
631-
#[inline(always)]
631+
#[inline]
632632
pub fn modify<F>(&self, f: F)
633633
where
634634
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W
@@ -645,7 +645,7 @@ pub fn register(
645645
if access == Access::ReadOnly || access == Access::ReadWrite {
646646
reg_impl_items.push(quote! {
647647
/// Reads the contents of the register
648-
#[inline(always)]
648+
#[inline]
649649
pub fn read(&self) -> R {
650650
R { bits: self.register.get() }
651651
}
@@ -660,7 +660,7 @@ pub fn register(
660660

661661
r_impl_items.push(quote! {
662662
/// Value of the register as raw bits
663-
#[inline(always)]
663+
#[inline]
664664
pub fn bits(&self) -> #rty {
665665
self.bits
666666
}
@@ -670,7 +670,7 @@ pub fn register(
670670
if access == Access::WriteOnly || access == Access::ReadWrite {
671671
reg_impl_items.push(quote! {
672672
/// Writes to the register
673-
#[inline(always)]
673+
#[inline]
674674
pub fn write<F>(&self, f: F)
675675
where
676676
F: FnOnce(&mut W) -> &mut W
@@ -699,13 +699,13 @@ pub fn register(
699699

700700
w_impl_items.push(quote! {
701701
/// Reset value of the register
702-
#[inline(always)]
702+
#[inline]
703703
pub fn reset_value() -> W {
704704
W { bits: #rv }
705705
}
706706

707707
/// Writes raw bits to the register
708-
#[inline(always)]
708+
#[inline]
709709
pub #unsafety fn bits(&mut self, bits: #rty) -> &mut Self {
710710
self.bits = bits;
711711
self
@@ -716,7 +716,7 @@ pub fn register(
716716
if access == Access::ReadWrite {
717717
reg_impl_items.push(quote! {
718718
/// Writes the reset value to the register
719-
#[inline(always)]
719+
#[inline]
720720
pub fn reset(&self) {
721721
self.write(|w| w)
722722
}
@@ -969,7 +969,7 @@ pub fn fields(
969969
let sc = &f.sc;
970970
r_impl_items.push(quote! {
971971
#[doc = #description]
972-
#[inline(always)]
972+
#[inline]
973973
pub fn #sc(&self) -> #pc_r {
974974
#pc_r::_from({ #value })
975975
}
@@ -1029,13 +1029,13 @@ pub fn fields(
10291029
if f.width == 1 {
10301030
enum_items.push(quote! {
10311031
/// Returns `true` if the bit is clear (0)
1032-
#[inline(always)]
1032+
#[inline]
10331033
pub fn bit_is_clear(&self) -> bool {
10341034
!self.#bits()
10351035
}
10361036

10371037
/// Returns `true` if the bit is set (1)
1038-
#[inline(always)]
1038+
#[inline]
10391039
pub fn bit_is_set(&self) -> bool {
10401040
self.#bits()
10411041
}
@@ -1044,7 +1044,7 @@ pub fn fields(
10441044

10451045
enum_items.push(quote! {
10461046
/// Value of the field as raw bits
1047-
#[inline(always)]
1047+
#[inline]
10481048
pub fn #bits(&self) -> #fty {
10491049
match *self {
10501050
#(#arms),*
@@ -1077,7 +1077,7 @@ pub fn fields(
10771077
enum_items.push(quote! {
10781078
#[allow(missing_docs)]
10791079
#[doc(hidden)]
1080-
#[inline(always)]
1080+
#[inline]
10811081
pub fn _from(value: #fty) -> #pc_r {
10821082
match value {
10831083
#(#arms),*,
@@ -1101,7 +1101,7 @@ pub fn fields(
11011101
);
11021102
enum_items.push(quote! {
11031103
#[doc = #doc]
1104-
#[inline(always)]
1104+
#[inline]
11051105
pub fn #is_variant(&self) -> bool {
11061106
*self == #pc_r::#pc
11071107
}
@@ -1120,7 +1120,7 @@ pub fn fields(
11201120
let sc = &f.sc;
11211121
r_impl_items.push(quote! {
11221122
#[doc = #description]
1123-
#[inline(always)]
1123+
#[inline]
11241124
pub fn #sc(&self) -> #pc_r {
11251125
let bits = { #value };
11261126
#pc_r { bits }
@@ -1129,7 +1129,7 @@ pub fn fields(
11291129

11301130
let mut pc_r_impl_items = vec![quote! {
11311131
/// Value of the field as raw bits
1132-
#[inline(always)]
1132+
#[inline]
11331133
pub fn #bits(&self) -> #fty {
11341134
self.bits
11351135
}
@@ -1138,13 +1138,13 @@ pub fn fields(
11381138
if f.width == 1 {
11391139
pc_r_impl_items.push(quote! {
11401140
/// Returns `true` if the bit is clear (0)
1141-
#[inline(always)]
1141+
#[inline]
11421142
pub fn bit_is_clear(&self) -> bool {
11431143
!self.#bits()
11441144
}
11451145

11461146
/// Returns `true` if the bit is set (1)
1147-
#[inline(always)]
1147+
#[inline]
11481148
pub fn bit_is_set(&self) -> bool {
11491149
self.#bits()
11501150
}
@@ -1305,7 +1305,7 @@ pub fn fields(
13051305
impl #pc_w {
13061306
#[allow(missing_docs)]
13071307
#[doc(hidden)]
1308-
#[inline(always)]
1308+
#[inline]
13091309
pub fn _bits(&self) -> #fty {
13101310
match *self {
13111311
#(#arms),*
@@ -1318,7 +1318,7 @@ pub fn fields(
13181318

13191319
proxy_items.push(quote! {
13201320
/// Writes `variant` to the field
1321-
#[inline(always)]
1321+
#[inline]
13221322
pub fn variant(self, variant: #pc_w) -> &'a mut W {
13231323
#unsafety {
13241324
self.#bits(variant._bits())
@@ -1334,15 +1334,15 @@ pub fn fields(
13341334
if let Some(enum_) = base_pc_w.as_ref() {
13351335
proxy_items.push(quote! {
13361336
#[doc = #doc]
1337-
#[inline(always)]
1337+
#[inline]
13381338
pub fn #sc(self) -> &'a mut W {
13391339
self.variant(#enum_::#pc)
13401340
}
13411341
});
13421342
} else {
13431343
proxy_items.push(quote! {
13441344
#[doc = #doc]
1345-
#[inline(always)]
1345+
#[inline]
13461346
pub fn #sc(self) -> &'a mut W {
13471347
self.variant(#pc_w::#pc)
13481348
}
@@ -1367,7 +1367,7 @@ pub fn fields(
13671367

13681368
proxy_items.push(quote! {
13691369
/// Writes raw bits to the field
1370-
#[inline(always)]
1370+
#[inline]
13711371
pub #unsafety fn #bits(self, value: #fty) -> &'a mut W {
13721372
const MASK: #fty = #mask;
13731373
const OFFSET: u8 = #offset;
@@ -1394,7 +1394,7 @@ pub fn fields(
13941394
let sc = &f.sc;
13951395
w_impl_items.push(quote! {
13961396
#[doc = #description]
1397-
#[inline(always)]
1397+
#[inline]
13981398
pub fn #sc(&mut self) -> #_pc_w {
13991399
#_pc_w { w: self }
14001400
}

0 commit comments

Comments
 (0)