Skip to content

Commit 895722b

Browse files
committed
Auto merge of #141 - therealprof:no_always_inline, r=japaric
Replace #[inline(always)] by #[inline] due to the later being conside… …red harmful Signed-off-by: Daniel Egger <[email protected]>
2 parents 1f3542f + 73cd404 commit 895722b

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
@@ -340,7 +340,7 @@ pub fn interrupt(
340340
}
341341

342342
unsafe impl Nr for Interrupt {
343-
#[inline(always)]
343+
#[inline]
344344
fn nr(&self) -> u8 {
345345
match *self {
346346
#(#arms)*
@@ -693,7 +693,7 @@ pub fn register(
693693
if access == Access::ReadWrite {
694694
reg_impl_items.push(quote! {
695695
/// Modifies the contents of the register
696-
#[inline(always)]
696+
#[inline]
697697
pub fn modify<F>(&self, f: F)
698698
where
699699
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W
@@ -710,7 +710,7 @@ pub fn register(
710710
if access == Access::ReadOnly || access == Access::ReadWrite {
711711
reg_impl_items.push(quote! {
712712
/// Reads the contents of the register
713-
#[inline(always)]
713+
#[inline]
714714
pub fn read(&self) -> R {
715715
R { bits: self.register.get() }
716716
}
@@ -725,7 +725,7 @@ pub fn register(
725725

726726
r_impl_items.push(quote! {
727727
/// Value of the register as raw bits
728-
#[inline(always)]
728+
#[inline]
729729
pub fn bits(&self) -> #rty {
730730
self.bits
731731
}
@@ -735,7 +735,7 @@ pub fn register(
735735
if access == Access::WriteOnly || access == Access::ReadWrite {
736736
reg_impl_items.push(quote! {
737737
/// Writes to the register
738-
#[inline(always)]
738+
#[inline]
739739
pub fn write<F>(&self, f: F)
740740
where
741741
F: FnOnce(&mut W) -> &mut W
@@ -764,13 +764,13 @@ pub fn register(
764764

765765
w_impl_items.push(quote! {
766766
/// Reset value of the register
767-
#[inline(always)]
767+
#[inline]
768768
pub fn reset_value() -> W {
769769
W { bits: #rv }
770770
}
771771

772772
/// Writes raw bits to the register
773-
#[inline(always)]
773+
#[inline]
774774
pub #unsafety fn bits(&mut self, bits: #rty) -> &mut Self {
775775
self.bits = bits;
776776
self
@@ -781,7 +781,7 @@ pub fn register(
781781
if access == Access::ReadWrite {
782782
reg_impl_items.push(quote! {
783783
/// Writes the reset value to the register
784-
#[inline(always)]
784+
#[inline]
785785
pub fn reset(&self) {
786786
self.write(|w| w)
787787
}
@@ -1034,7 +1034,7 @@ pub fn fields(
10341034
let sc = &f.sc;
10351035
r_impl_items.push(quote! {
10361036
#[doc = #description]
1037-
#[inline(always)]
1037+
#[inline]
10381038
pub fn #sc(&self) -> #pc_r {
10391039
#pc_r::_from({ #value })
10401040
}
@@ -1094,13 +1094,13 @@ pub fn fields(
10941094
if f.width == 1 {
10951095
enum_items.push(quote! {
10961096
/// Returns `true` if the bit is clear (0)
1097-
#[inline(always)]
1097+
#[inline]
10981098
pub fn bit_is_clear(&self) -> bool {
10991099
!self.#bits()
11001100
}
11011101

11021102
/// Returns `true` if the bit is set (1)
1103-
#[inline(always)]
1103+
#[inline]
11041104
pub fn bit_is_set(&self) -> bool {
11051105
self.#bits()
11061106
}
@@ -1109,7 +1109,7 @@ pub fn fields(
11091109

11101110
enum_items.push(quote! {
11111111
/// Value of the field as raw bits
1112-
#[inline(always)]
1112+
#[inline]
11131113
pub fn #bits(&self) -> #fty {
11141114
match *self {
11151115
#(#arms),*
@@ -1142,7 +1142,7 @@ pub fn fields(
11421142
enum_items.push(quote! {
11431143
#[allow(missing_docs)]
11441144
#[doc(hidden)]
1145-
#[inline(always)]
1145+
#[inline]
11461146
pub fn _from(value: #fty) -> #pc_r {
11471147
match value {
11481148
#(#arms),*,
@@ -1166,7 +1166,7 @@ pub fn fields(
11661166
);
11671167
enum_items.push(quote! {
11681168
#[doc = #doc]
1169-
#[inline(always)]
1169+
#[inline]
11701170
pub fn #is_variant(&self) -> bool {
11711171
*self == #pc_r::#pc
11721172
}
@@ -1185,7 +1185,7 @@ pub fn fields(
11851185
let sc = &f.sc;
11861186
r_impl_items.push(quote! {
11871187
#[doc = #description]
1188-
#[inline(always)]
1188+
#[inline]
11891189
pub fn #sc(&self) -> #pc_r {
11901190
let bits = { #value };
11911191
#pc_r { bits }
@@ -1194,7 +1194,7 @@ pub fn fields(
11941194

11951195
let mut pc_r_impl_items = vec![quote! {
11961196
/// Value of the field as raw bits
1197-
#[inline(always)]
1197+
#[inline]
11981198
pub fn #bits(&self) -> #fty {
11991199
self.bits
12001200
}
@@ -1203,13 +1203,13 @@ pub fn fields(
12031203
if f.width == 1 {
12041204
pc_r_impl_items.push(quote! {
12051205
/// Returns `true` if the bit is clear (0)
1206-
#[inline(always)]
1206+
#[inline]
12071207
pub fn bit_is_clear(&self) -> bool {
12081208
!self.#bits()
12091209
}
12101210

12111211
/// Returns `true` if the bit is set (1)
1212-
#[inline(always)]
1212+
#[inline]
12131213
pub fn bit_is_set(&self) -> bool {
12141214
self.#bits()
12151215
}
@@ -1370,7 +1370,7 @@ pub fn fields(
13701370
impl #pc_w {
13711371
#[allow(missing_docs)]
13721372
#[doc(hidden)]
1373-
#[inline(always)]
1373+
#[inline]
13741374
pub fn _bits(&self) -> #fty {
13751375
match *self {
13761376
#(#arms),*
@@ -1383,7 +1383,7 @@ pub fn fields(
13831383

13841384
proxy_items.push(quote! {
13851385
/// Writes `variant` to the field
1386-
#[inline(always)]
1386+
#[inline]
13871387
pub fn variant(self, variant: #pc_w) -> &'a mut W {
13881388
#unsafety {
13891389
self.#bits(variant._bits())
@@ -1399,15 +1399,15 @@ pub fn fields(
13991399
if let Some(enum_) = base_pc_w.as_ref() {
14001400
proxy_items.push(quote! {
14011401
#[doc = #doc]
1402-
#[inline(always)]
1402+
#[inline]
14031403
pub fn #sc(self) -> &'a mut W {
14041404
self.variant(#enum_::#pc)
14051405
}
14061406
});
14071407
} else {
14081408
proxy_items.push(quote! {
14091409
#[doc = #doc]
1410-
#[inline(always)]
1410+
#[inline]
14111411
pub fn #sc(self) -> &'a mut W {
14121412
self.variant(#pc_w::#pc)
14131413
}
@@ -1432,7 +1432,7 @@ pub fn fields(
14321432

14331433
proxy_items.push(quote! {
14341434
/// Writes raw bits to the field
1435-
#[inline(always)]
1435+
#[inline]
14361436
pub #unsafety fn #bits(self, value: #fty) -> &'a mut W {
14371437
const MASK: #fty = #mask;
14381438
const OFFSET: u8 = #offset;
@@ -1459,7 +1459,7 @@ pub fn fields(
14591459
let sc = &f.sc;
14601460
w_impl_items.push(quote! {
14611461
#[doc = #description]
1462-
#[inline(always)]
1462+
#[inline]
14631463
pub fn #sc(&mut self) -> #_pc_w {
14641464
#_pc_w { w: self }
14651465
}

0 commit comments

Comments
 (0)