From 73cd404695fec208a7dc6952daa345c795d3d9ae Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Mon, 11 Sep 2017 11:47:26 +0300 Subject: [PATCH] Replace #[inline(always)] by #[inline] due to the later being considered harmful Signed-off-by: Daniel Egger --- src/generate.rs | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/generate.rs b/src/generate.rs index ef05584e..65dfede9 100644 --- a/src/generate.rs +++ b/src/generate.rs @@ -341,7 +341,7 @@ pub fn interrupt( } unsafe impl Nr for Interrupt { - #[inline(always)] + #[inline] fn nr(&self) -> u8 { match *self { #(#arms)* @@ -628,7 +628,7 @@ pub fn register( if access == Access::ReadWrite { reg_impl_items.push(quote! { /// Modifies the contents of the register - #[inline(always)] + #[inline] pub fn modify(&self, f: F) where for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W @@ -645,7 +645,7 @@ pub fn register( if access == Access::ReadOnly || access == Access::ReadWrite { reg_impl_items.push(quote! { /// Reads the contents of the register - #[inline(always)] + #[inline] pub fn read(&self) -> R { R { bits: self.register.get() } } @@ -660,7 +660,7 @@ pub fn register( r_impl_items.push(quote! { /// Value of the register as raw bits - #[inline(always)] + #[inline] pub fn bits(&self) -> #rty { self.bits } @@ -670,7 +670,7 @@ pub fn register( if access == Access::WriteOnly || access == Access::ReadWrite { reg_impl_items.push(quote! { /// Writes to the register - #[inline(always)] + #[inline] pub fn write(&self, f: F) where F: FnOnce(&mut W) -> &mut W @@ -699,13 +699,13 @@ pub fn register( w_impl_items.push(quote! { /// Reset value of the register - #[inline(always)] + #[inline] pub fn reset_value() -> W { W { bits: #rv } } /// Writes raw bits to the register - #[inline(always)] + #[inline] pub #unsafety fn bits(&mut self, bits: #rty) -> &mut Self { self.bits = bits; self @@ -716,7 +716,7 @@ pub fn register( if access == Access::ReadWrite { reg_impl_items.push(quote! { /// Writes the reset value to the register - #[inline(always)] + #[inline] pub fn reset(&self) { self.write(|w| w) } @@ -969,7 +969,7 @@ pub fn fields( let sc = &f.sc; r_impl_items.push(quote! { #[doc = #description] - #[inline(always)] + #[inline] pub fn #sc(&self) -> #pc_r { #pc_r::_from({ #value }) } @@ -1029,13 +1029,13 @@ pub fn fields( if f.width == 1 { enum_items.push(quote! { /// Returns `true` if the bit is clear (0) - #[inline(always)] + #[inline] pub fn bit_is_clear(&self) -> bool { !self.#bits() } /// Returns `true` if the bit is set (1) - #[inline(always)] + #[inline] pub fn bit_is_set(&self) -> bool { self.#bits() } @@ -1044,7 +1044,7 @@ pub fn fields( enum_items.push(quote! { /// Value of the field as raw bits - #[inline(always)] + #[inline] pub fn #bits(&self) -> #fty { match *self { #(#arms),* @@ -1077,7 +1077,7 @@ pub fn fields( enum_items.push(quote! { #[allow(missing_docs)] #[doc(hidden)] - #[inline(always)] + #[inline] pub fn _from(value: #fty) -> #pc_r { match value { #(#arms),*, @@ -1101,7 +1101,7 @@ pub fn fields( ); enum_items.push(quote! { #[doc = #doc] - #[inline(always)] + #[inline] pub fn #is_variant(&self) -> bool { *self == #pc_r::#pc } @@ -1120,7 +1120,7 @@ pub fn fields( let sc = &f.sc; r_impl_items.push(quote! { #[doc = #description] - #[inline(always)] + #[inline] pub fn #sc(&self) -> #pc_r { let bits = { #value }; #pc_r { bits } @@ -1129,7 +1129,7 @@ pub fn fields( let mut pc_r_impl_items = vec![quote! { /// Value of the field as raw bits - #[inline(always)] + #[inline] pub fn #bits(&self) -> #fty { self.bits } @@ -1138,13 +1138,13 @@ pub fn fields( if f.width == 1 { pc_r_impl_items.push(quote! { /// Returns `true` if the bit is clear (0) - #[inline(always)] + #[inline] pub fn bit_is_clear(&self) -> bool { !self.#bits() } /// Returns `true` if the bit is set (1) - #[inline(always)] + #[inline] pub fn bit_is_set(&self) -> bool { self.#bits() } @@ -1305,7 +1305,7 @@ pub fn fields( impl #pc_w { #[allow(missing_docs)] #[doc(hidden)] - #[inline(always)] + #[inline] pub fn _bits(&self) -> #fty { match *self { #(#arms),* @@ -1318,7 +1318,7 @@ pub fn fields( proxy_items.push(quote! { /// Writes `variant` to the field - #[inline(always)] + #[inline] pub fn variant(self, variant: #pc_w) -> &'a mut W { #unsafety { self.#bits(variant._bits()) @@ -1334,7 +1334,7 @@ pub fn fields( if let Some(enum_) = base_pc_w.as_ref() { proxy_items.push(quote! { #[doc = #doc] - #[inline(always)] + #[inline] pub fn #sc(self) -> &'a mut W { self.variant(#enum_::#pc) } @@ -1342,7 +1342,7 @@ pub fn fields( } else { proxy_items.push(quote! { #[doc = #doc] - #[inline(always)] + #[inline] pub fn #sc(self) -> &'a mut W { self.variant(#pc_w::#pc) } @@ -1367,7 +1367,7 @@ pub fn fields( proxy_items.push(quote! { /// Writes raw bits to the field - #[inline(always)] + #[inline] pub #unsafety fn #bits(self, value: #fty) -> &'a mut W { const MASK: #fty = #mask; const OFFSET: u8 = #offset; @@ -1394,7 +1394,7 @@ pub fn fields( let sc = &f.sc; w_impl_items.push(quote! { #[doc = #description] - #[inline(always)] + #[inline] pub fn #sc(&mut self) -> #_pc_w { #_pc_w { w: self } }