about summary refs log tree commit diff
diff options
context:
space:
mode:
authorElias Holzmann <9659253+EliasHolzmann@users.noreply.github.com>2024-03-03 05:17:55 +0100
committerElias Holzmann <9659253+EliasHolzmann@users.noreply.github.com>2024-12-05 21:48:36 +0100
commit31a56571091a9bdcc3fc9f4dff9e4fafeddc2ea8 (patch)
tree117619552507aa46d9751f57936d98e6b2f1a6ec
parent2f9e0c984bd6c1a9e9acbc8478de2496a3ac481e (diff)
downloadrust-31a56571091a9bdcc3fc9f4dff9e4fafeddc2ea8.tar.gz
rust-31a56571091a9bdcc3fc9f4dff9e4fafeddc2ea8.zip
Access members of `FormattingOptions` directly instead of via getters/setters
-rw-r--r--library/core/src/fmt/float.rs6
-rw-r--r--library/core/src/fmt/mod.rs74
-rw-r--r--tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff147
-rw-r--r--tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff147
4 files changed, 187 insertions, 187 deletions
diff --git a/library/core/src/fmt/float.rs b/library/core/src/fmt/float.rs
index ee7a8f08f19..3f10158193d 100644
--- a/library/core/src/fmt/float.rs
+++ b/library/core/src/fmt/float.rs
@@ -86,7 +86,7 @@ where
         true => flt2dec::Sign::MinusPlus,
     };
 
-    if let Some(precision) = fmt.precision() {
+    if let Some(precision) = fmt.options.precision {
         float_to_decimal_common_exact(fmt, num, sign, precision)
     } else {
         let min_precision = 0;
@@ -162,7 +162,7 @@ where
         true => flt2dec::Sign::MinusPlus,
     };
 
-    if let Some(precision) = fmt.precision() {
+    if let Some(precision) = fmt.options.precision {
         // 1 integral digit + `precision` fractional digits = `precision + 1` total digits
         float_to_exponential_common_exact(fmt, num, sign, precision + 1, upper)
     } else {
@@ -180,7 +180,7 @@ where
         true => flt2dec::Sign::MinusPlus,
     };
 
-    if let Some(precision) = fmt.precision() {
+    if let Some(precision) = fmt.options.precision {
         // this behavior of {:.PREC?} predates exponential formatting for {:?}
         float_to_decimal_common_exact(fmt, num, sign, precision)
     } else {
diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs
index da89acdcd1e..14c70065101 100644
--- a/library/core/src/fmt/mod.rs
+++ b/library/core/src/fmt/mod.rs
@@ -1466,14 +1466,14 @@ pub fn write(output: &mut dyn Write, args: Arguments<'_>) -> Result {
 }
 
 unsafe fn run(fmt: &mut Formatter<'_>, arg: &rt::Placeholder, args: &[rt::Argument<'_>]) -> Result {
-    fmt.options.fill(arg.fill);
-    fmt.options.align(arg.align.into());
-    fmt.options.flags(arg.flags);
+    fmt.options.fill = arg.fill;
+    fmt.options.align = arg.align.into();
+    fmt.options.flags = arg.flags;
     // SAFETY: arg and args come from the same Arguments,
     // which guarantees the indexes are always within bounds.
     unsafe {
-        fmt.options.width(getcount(args, &arg.width));
-        fmt.options.precision(getcount(args, &arg.precision));
+        fmt.options.width = getcount(args, &arg.width);
+        fmt.options.precision = getcount(args, &arg.precision);
     }
 
     // Extract the correct argument
@@ -1613,7 +1613,7 @@ impl<'a> Formatter<'a> {
         }
 
         // The `width` field is more of a `min-width` parameter at this point.
-        match self.width() {
+        match self.options.width {
             // If there's no minimum length requirements then we can just
             // write the bytes.
             None => {
@@ -1682,12 +1682,12 @@ impl<'a> Formatter<'a> {
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn pad(&mut self, s: &str) -> Result {
         // Make sure there's a fast path up front
-        if self.width().is_none() && self.precision().is_none() {
+        if self.options.width.is_none() && self.options.precision.is_none() {
             return self.buf.write_str(s);
         }
         // The `precision` field can be interpreted as a `max-width` for the
         // string being formatted.
-        let s = if let Some(max) = self.precision() {
+        let s = if let Some(max) = self.options.precision {
             // If our string is longer that the precision, then we must have
             // truncation. However other flags like `fill`, `width` and `align`
             // must act as always.
@@ -1704,7 +1704,7 @@ impl<'a> Formatter<'a> {
             &s
         };
         // The `width` field is more of a `min-width` parameter at this point.
-        match self.width() {
+        match self.options.width {
             // If we're under the maximum length, and there's no minimum length
             // requirements, then we can just emit the string
             None => self.buf.write_str(s),
@@ -1745,10 +1745,10 @@ impl<'a> Formatter<'a> {
         };
 
         for _ in 0..pre_pad {
-            self.buf.write_char(self.fill())?;
+            self.buf.write_char(self.options.fill)?;
         }
 
-        Ok(PostPadding::new(self.fill(), post_pad))
+        Ok(PostPadding::new(self.options.fill, post_pad))
     }
 
     /// Takes the formatted parts and applies the padding.
@@ -1760,12 +1760,12 @@ impl<'a> Formatter<'a> {
     ///
     /// Any `numfmt::Part::Copy` parts in `formatted` must contain valid UTF-8.
     unsafe fn pad_formatted_parts(&mut self, formatted: &numfmt::Formatted<'_>) -> Result {
-        if let Some(mut width) = self.width() {
+        if let Some(mut width) = self.options.width {
             // for the sign-aware zero padding, we render the sign first and
             // behave as if we had no sign from the beginning.
             let mut formatted = formatted.clone();
-            let old_fill = self.fill();
-            let old_align = self.align();
+            let old_fill = self.options.fill;
+            let old_align = self.options.align;
             if self.sign_aware_zero_pad() {
                 // a sign always goes first
                 let sign = formatted.sign;
@@ -1774,8 +1774,8 @@ impl<'a> Formatter<'a> {
                 // remove the sign from the formatted parts
                 formatted.sign = "";
                 width = width.saturating_sub(sign.len());
-                self.options.fill('0');
-                self.options.align(Some(Alignment::Right));
+                self.options.fill = '0';
+                self.options.align = Some(Alignment::Right);
             }
 
             // remaining parts go through the ordinary padding process.
@@ -1792,8 +1792,8 @@ impl<'a> Formatter<'a> {
                 }
                 post_padding.write(self)
             };
-            self.options.fill(old_fill);
-            self.options.align(old_align);
+            self.options.fill = old_fill;
+            self.options.align = old_align;
             ret
         } else {
             // this is the common case and we take a shortcut
@@ -1919,7 +1919,7 @@ impl<'a> Formatter<'a> {
                 or `sign_aware_zero_pad` methods instead"
     )]
     pub fn flags(&self) -> u32 {
-        self.options.get_flags()
+        self.options.flags
     }
 
     /// Returns the character used as 'fill' whenever there is alignment.
@@ -1952,7 +1952,7 @@ impl<'a> Formatter<'a> {
     #[must_use]
     #[stable(feature = "fmt_flags", since = "1.5.0")]
     pub fn fill(&self) -> char {
-        self.options.get_fill()
+        self.options.fill
     }
 
     /// Returns a flag indicating what form of alignment was requested.
@@ -1987,7 +1987,7 @@ impl<'a> Formatter<'a> {
     #[must_use]
     #[stable(feature = "fmt_flags_align", since = "1.28.0")]
     pub fn align(&self) -> Option<Alignment> {
-        self.options.get_align()
+        self.options.align
     }
 
     /// Returns the optionally specified integer width that the output should be.
@@ -2017,7 +2017,7 @@ impl<'a> Formatter<'a> {
     #[must_use]
     #[stable(feature = "fmt_flags", since = "1.5.0")]
     pub fn width(&self) -> Option<usize> {
-        self.options.get_width()
+        self.options.width
     }
 
     /// Returns the optionally specified precision for numeric types.
@@ -2048,7 +2048,7 @@ impl<'a> Formatter<'a> {
     #[must_use]
     #[stable(feature = "fmt_flags", since = "1.5.0")]
     pub fn precision(&self) -> Option<usize> {
-        self.options.get_precision()
+        self.options.precision
     }
 
     /// Determines if the `+` flag was specified.
@@ -2080,7 +2080,7 @@ impl<'a> Formatter<'a> {
     #[must_use]
     #[stable(feature = "fmt_flags", since = "1.5.0")]
     pub fn sign_plus(&self) -> bool {
-        self.options.get_sign() == Some(Sign::Plus)
+        self.options.flags & (1 << rt::Flag::SignPlus as u32) != 0
     }
 
     /// Determines if the `-` flag was specified.
@@ -2109,7 +2109,7 @@ impl<'a> Formatter<'a> {
     #[must_use]
     #[stable(feature = "fmt_flags", since = "1.5.0")]
     pub fn sign_minus(&self) -> bool {
-        self.options.get_sign() == Some(Sign::Minus)
+        self.options.flags & (1 << rt::Flag::SignMinus as u32) != 0
     }
 
     /// Determines if the `#` flag was specified.
@@ -2137,7 +2137,7 @@ impl<'a> Formatter<'a> {
     #[must_use]
     #[stable(feature = "fmt_flags", since = "1.5.0")]
     pub fn alternate(&self) -> bool {
-        self.options.get_alternate()
+        self.options.flags & (1 << rt::Flag::Alternate as u32) != 0
     }
 
     /// Determines if the `0` flag was specified.
@@ -2163,7 +2163,7 @@ impl<'a> Formatter<'a> {
     #[must_use]
     #[stable(feature = "fmt_flags", since = "1.5.0")]
     pub fn sign_aware_zero_pad(&self) -> bool {
-        self.options.get_sign_aware_zero_pad()
+        self.options.flags & (1 << rt::Flag::SignAwareZeroPad as u32) != 0
     }
 
     // FIXME: Decide what public API we want for these two flags.
@@ -2753,7 +2753,7 @@ impl Debug for char {
 #[stable(feature = "rust1", since = "1.0.0")]
 impl Display for char {
     fn fmt(&self, f: &mut Formatter<'_>) -> Result {
-        if f.width().is_none() && f.precision().is_none() {
+        if f.options.width.is_none() && f.options.precision.is_none() {
             f.write_char(*self)
         } else {
             f.pad(self.encode_utf8(&mut [0; 4]))
@@ -2777,28 +2777,26 @@ impl<T: ?Sized> Pointer for *const T {
 ///
 /// [problematic]: https://github.com/rust-lang/rust/issues/95489
 pub(crate) fn pointer_fmt_inner(ptr_addr: usize, f: &mut Formatter<'_>) -> Result {
-    let old_width = f.width();
-    let old_alternate = f.alternate();
-    let old_zero_pad = f.sign_aware_zero_pad();
+    let old_width = f.options.width;
+    let old_flags = f.options.flags;
 
     // The alternate flag is already treated by LowerHex as being special-
     // it denotes whether to prefix with 0x. We use it to work out whether
     // or not to zero extend, and then unconditionally set it to get the
     // prefix.
     if f.alternate() {
-        f.options.sign_aware_zero_pad(true);
+        f.options.flags |= 1 << (rt::Flag::SignAwareZeroPad as u32);
 
-        if f.width().is_none() {
-            f.options.width(Some((usize::BITS / 4) as usize + 2));
+        if f.options.width.is_none() {
+            f.options.width = Some((usize::BITS / 4) as usize + 2);
         }
     }
-    f.options.alternate(true);
+    f.options.flags |= 1 << (rt::Flag::Alternate as u32);
 
     let ret = LowerHex::fmt(&ptr_addr, f);
 
-    f.options.width(old_width);
-    f.options.alternate(old_alternate);
-    f.options.sign_aware_zero_pad(old_zero_pad);
+    f.options.width = old_width;
+    f.options.flags = old_flags;
 
     ret
 }
diff --git a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff
index ed04bc7dd56..a1be927e1c0 100644
--- a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff
+++ b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff
@@ -7,133 +7,134 @@
       debug upper => _3;
       let mut _0: std::result::Result<(), std::fmt::Error>;
       let _4: bool;
-      let mut _5: &std::fmt::Formatter<'_>;
-      let mut _7: std::option::Option<usize>;
-      let mut _8: isize;
-      let mut _10: &mut std::fmt::Formatter<'_>;
-      let mut _11: &T;
-      let mut _12: core::num::flt2dec::Sign;
+      let mut _6: std::option::Option<usize>;
+      let mut _7: isize;
+      let mut _9: &mut std::fmt::Formatter<'_>;
+      let mut _10: &T;
+      let mut _11: core::num::flt2dec::Sign;
+      let mut _12: u32;
       let mut _13: u32;
-      let mut _14: u32;
-      let mut _15: usize;
-      let mut _16: bool;
-      let mut _17: &mut std::fmt::Formatter<'_>;
-      let mut _18: &T;
-      let mut _19: core::num::flt2dec::Sign;
-      let mut _20: bool;
+      let mut _14: usize;
+      let mut _15: bool;
+      let mut _16: &mut std::fmt::Formatter<'_>;
+      let mut _17: &T;
+      let mut _18: core::num::flt2dec::Sign;
+      let mut _19: bool;
       scope 1 {
           debug force_sign => _4;
-          let _6: core::num::flt2dec::Sign;
+          let _5: core::num::flt2dec::Sign;
           scope 2 {
-              debug sign => _6;
+              debug sign => _5;
               scope 3 {
-                  debug precision => _9;
-                  let _9: usize;
-                  scope 4 (inlined Formatter::<'_>::precision) {
-                      scope 5 (inlined FormattingOptions::get_precision) {
-                      }
+                  debug precision => _8;
+                  let _8: usize;
+                  scope 5 (inlined Formatter::<'_>::precision) {
                   }
               }
           }
       }
+      scope 4 (inlined Formatter::<'_>::sign_plus) {
+          let mut _20: u32;
+          let mut _21: u32;
+      }
   
       bb0: {
           StorageLive(_4);
+          StorageLive(_20);
+          StorageLive(_21);
+          _21 = copy (((*_1).0: std::fmt::FormattingOptions).0: u32);
+          _20 = BitAnd(move _21, const 1_u32);
+          StorageDead(_21);
+          _4 = Ne(move _20, const 0_u32);
+          StorageDead(_20);
           StorageLive(_5);
-          _5 = &(*_1);
-          _4 = Formatter::<'_>::sign_plus(move _5) -> [return: bb1, unwind unreachable];
+          switchInt(copy _4) -> [0: bb2, otherwise: bb1];
       }
   
       bb1: {
-          StorageDead(_5);
-          StorageLive(_6);
-          switchInt(copy _4) -> [0: bb3, otherwise: bb2];
+-         _5 = MinusPlus;
++         _5 = const MinusPlus;
+          goto -> bb3;
       }
   
       bb2: {
--         _6 = MinusPlus;
-+         _6 = const MinusPlus;
-          goto -> bb4;
+-         _5 = core::num::flt2dec::Sign::Minus;
++         _5 = const core::num::flt2dec::Sign::Minus;
+          goto -> bb3;
       }
   
       bb3: {
--         _6 = core::num::flt2dec::Sign::Minus;
-+         _6 = const core::num::flt2dec::Sign::Minus;
-          goto -> bb4;
+          StorageLive(_6);
+          _6 = copy (((*_1).0: std::fmt::FormattingOptions).4: std::option::Option<usize>);
+          _7 = discriminant(_6);
+          switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb9];
       }
   
       bb4: {
-          StorageLive(_7);
-          _7 = copy (((*_1).0: std::fmt::FormattingOptions).4: std::option::Option<usize>);
-          _8 = discriminant(_7);
-          switchInt(move _8) -> [1: bb5, 0: bb7, otherwise: bb10];
-      }
-  
-      bb5: {
--         StorageLive(_9);
+-         StorageLive(_8);
 +         nop;
-          _9 = copy ((_7 as Some).0: usize);
+          _8 = copy ((_6 as Some).0: usize);
+          StorageLive(_9);
+          _9 = copy _1;
           StorageLive(_10);
-          _10 = copy _1;
+          _10 = copy _2;
           StorageLive(_11);
-          _11 = copy _2;
+          _11 = copy _5;
           StorageLive(_12);
-          _12 = copy _6;
           StorageLive(_13);
           StorageLive(_14);
-          StorageLive(_15);
-          _15 = copy _9;
--         _14 = move _15 as u32 (IntToInt);
-+         _14 = copy _9 as u32 (IntToInt);
-          StorageDead(_15);
-          _13 = Add(move _14, const 1_u32);
+          _14 = copy _8;
+-         _13 = move _14 as u32 (IntToInt);
++         _13 = copy _8 as u32 (IntToInt);
           StorageDead(_14);
-          StorageLive(_16);
-          _16 = copy _3;
--         _0 = float_to_exponential_common_exact::<T>(move _10, move _11, move _12, move _13, move _16) -> [return: bb6, unwind unreachable];
-+         _0 = float_to_exponential_common_exact::<T>(copy _1, copy _2, move _12, move _13, copy _3) -> [return: bb6, unwind unreachable];
+          _12 = Add(move _13, const 1_u32);
+          StorageDead(_13);
+          StorageLive(_15);
+          _15 = copy _3;
+-         _0 = float_to_exponential_common_exact::<T>(move _9, move _10, move _11, move _12, move _15) -> [return: bb5, unwind unreachable];
++         _0 = float_to_exponential_common_exact::<T>(copy _1, copy _2, move _11, move _12, copy _3) -> [return: bb5, unwind unreachable];
       }
   
-      bb6: {
-          StorageDead(_16);
-          StorageDead(_13);
+      bb5: {
+          StorageDead(_15);
           StorageDead(_12);
           StorageDead(_11);
           StorageDead(_10);
--         StorageDead(_9);
+          StorageDead(_9);
+-         StorageDead(_8);
 +         nop;
-          goto -> bb9;
+          goto -> bb8;
       }
   
-      bb7: {
+      bb6: {
+          StorageLive(_16);
+          _16 = copy _1;
           StorageLive(_17);
-          _17 = copy _1;
+          _17 = copy _2;
           StorageLive(_18);
-          _18 = copy _2;
+          _18 = copy _5;
           StorageLive(_19);
-          _19 = copy _6;
-          StorageLive(_20);
-          _20 = copy _3;
--         _0 = float_to_exponential_common_shortest::<T>(move _17, move _18, move _19, move _20) -> [return: bb8, unwind unreachable];
-+         _0 = float_to_exponential_common_shortest::<T>(copy _1, copy _2, move _19, copy _3) -> [return: bb8, unwind unreachable];
+          _19 = copy _3;
+-         _0 = float_to_exponential_common_shortest::<T>(move _16, move _17, move _18, move _19) -> [return: bb7, unwind unreachable];
++         _0 = float_to_exponential_common_shortest::<T>(copy _1, copy _2, move _18, copy _3) -> [return: bb7, unwind unreachable];
       }
   
-      bb8: {
-          StorageDead(_20);
+      bb7: {
           StorageDead(_19);
           StorageDead(_18);
           StorageDead(_17);
-          goto -> bb9;
+          StorageDead(_16);
+          goto -> bb8;
       }
   
-      bb9: {
-          StorageDead(_6);
+      bb8: {
+          StorageDead(_5);
           StorageDead(_4);
-          StorageDead(_7);
+          StorageDead(_6);
           return;
       }
   
-      bb10: {
+      bb9: {
           unreachable;
       }
   }
diff --git a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff
index 33640bb2d8f..87ab71feb2f 100644
--- a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff
+++ b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff
@@ -7,133 +7,134 @@
       debug upper => _3;
       let mut _0: std::result::Result<(), std::fmt::Error>;
       let _4: bool;
-      let mut _5: &std::fmt::Formatter<'_>;
-      let mut _7: std::option::Option<usize>;
-      let mut _8: isize;
-      let mut _10: &mut std::fmt::Formatter<'_>;
-      let mut _11: &T;
-      let mut _12: core::num::flt2dec::Sign;
+      let mut _6: std::option::Option<usize>;
+      let mut _7: isize;
+      let mut _9: &mut std::fmt::Formatter<'_>;
+      let mut _10: &T;
+      let mut _11: core::num::flt2dec::Sign;
+      let mut _12: u32;
       let mut _13: u32;
-      let mut _14: u32;
-      let mut _15: usize;
-      let mut _16: bool;
-      let mut _17: &mut std::fmt::Formatter<'_>;
-      let mut _18: &T;
-      let mut _19: core::num::flt2dec::Sign;
-      let mut _20: bool;
+      let mut _14: usize;
+      let mut _15: bool;
+      let mut _16: &mut std::fmt::Formatter<'_>;
+      let mut _17: &T;
+      let mut _18: core::num::flt2dec::Sign;
+      let mut _19: bool;
       scope 1 {
           debug force_sign => _4;
-          let _6: core::num::flt2dec::Sign;
+          let _5: core::num::flt2dec::Sign;
           scope 2 {
-              debug sign => _6;
+              debug sign => _5;
               scope 3 {
-                  debug precision => _9;
-                  let _9: usize;
-                  scope 4 (inlined Formatter::<'_>::precision) {
-                      scope 5 (inlined FormattingOptions::get_precision) {
-                      }
+                  debug precision => _8;
+                  let _8: usize;
+                  scope 5 (inlined Formatter::<'_>::precision) {
                   }
               }
           }
       }
+      scope 4 (inlined Formatter::<'_>::sign_plus) {
+          let mut _20: u32;
+          let mut _21: u32;
+      }
   
       bb0: {
           StorageLive(_4);
+          StorageLive(_20);
+          StorageLive(_21);
+          _21 = copy (((*_1).0: std::fmt::FormattingOptions).0: u32);
+          _20 = BitAnd(move _21, const 1_u32);
+          StorageDead(_21);
+          _4 = Ne(move _20, const 0_u32);
+          StorageDead(_20);
           StorageLive(_5);
-          _5 = &(*_1);
-          _4 = Formatter::<'_>::sign_plus(move _5) -> [return: bb1, unwind continue];
+          switchInt(copy _4) -> [0: bb2, otherwise: bb1];
       }
   
       bb1: {
-          StorageDead(_5);
-          StorageLive(_6);
-          switchInt(copy _4) -> [0: bb3, otherwise: bb2];
+-         _5 = MinusPlus;
++         _5 = const MinusPlus;
+          goto -> bb3;
       }
   
       bb2: {
--         _6 = MinusPlus;
-+         _6 = const MinusPlus;
-          goto -> bb4;
+-         _5 = core::num::flt2dec::Sign::Minus;
++         _5 = const core::num::flt2dec::Sign::Minus;
+          goto -> bb3;
       }
   
       bb3: {
--         _6 = core::num::flt2dec::Sign::Minus;
-+         _6 = const core::num::flt2dec::Sign::Minus;
-          goto -> bb4;
+          StorageLive(_6);
+          _6 = copy (((*_1).0: std::fmt::FormattingOptions).4: std::option::Option<usize>);
+          _7 = discriminant(_6);
+          switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb9];
       }
   
       bb4: {
-          StorageLive(_7);
-          _7 = copy (((*_1).0: std::fmt::FormattingOptions).4: std::option::Option<usize>);
-          _8 = discriminant(_7);
-          switchInt(move _8) -> [1: bb5, 0: bb7, otherwise: bb10];
-      }
-  
-      bb5: {
--         StorageLive(_9);
+-         StorageLive(_8);
 +         nop;
-          _9 = copy ((_7 as Some).0: usize);
+          _8 = copy ((_6 as Some).0: usize);
+          StorageLive(_9);
+          _9 = copy _1;
           StorageLive(_10);
-          _10 = copy _1;
+          _10 = copy _2;
           StorageLive(_11);
-          _11 = copy _2;
+          _11 = copy _5;
           StorageLive(_12);
-          _12 = copy _6;
           StorageLive(_13);
           StorageLive(_14);
-          StorageLive(_15);
-          _15 = copy _9;
--         _14 = move _15 as u32 (IntToInt);
-+         _14 = copy _9 as u32 (IntToInt);
-          StorageDead(_15);
-          _13 = Add(move _14, const 1_u32);
+          _14 = copy _8;
+-         _13 = move _14 as u32 (IntToInt);
++         _13 = copy _8 as u32 (IntToInt);
           StorageDead(_14);
-          StorageLive(_16);
-          _16 = copy _3;
--         _0 = float_to_exponential_common_exact::<T>(move _10, move _11, move _12, move _13, move _16) -> [return: bb6, unwind continue];
-+         _0 = float_to_exponential_common_exact::<T>(copy _1, copy _2, move _12, move _13, copy _3) -> [return: bb6, unwind continue];
+          _12 = Add(move _13, const 1_u32);
+          StorageDead(_13);
+          StorageLive(_15);
+          _15 = copy _3;
+-         _0 = float_to_exponential_common_exact::<T>(move _9, move _10, move _11, move _12, move _15) -> [return: bb5, unwind continue];
++         _0 = float_to_exponential_common_exact::<T>(copy _1, copy _2, move _11, move _12, copy _3) -> [return: bb5, unwind continue];
       }
   
-      bb6: {
-          StorageDead(_16);
-          StorageDead(_13);
+      bb5: {
+          StorageDead(_15);
           StorageDead(_12);
           StorageDead(_11);
           StorageDead(_10);
--         StorageDead(_9);
+          StorageDead(_9);
+-         StorageDead(_8);
 +         nop;
-          goto -> bb9;
+          goto -> bb8;
       }
   
-      bb7: {
+      bb6: {
+          StorageLive(_16);
+          _16 = copy _1;
           StorageLive(_17);
-          _17 = copy _1;
+          _17 = copy _2;
           StorageLive(_18);
-          _18 = copy _2;
+          _18 = copy _5;
           StorageLive(_19);
-          _19 = copy _6;
-          StorageLive(_20);
-          _20 = copy _3;
--         _0 = float_to_exponential_common_shortest::<T>(move _17, move _18, move _19, move _20) -> [return: bb8, unwind continue];
-+         _0 = float_to_exponential_common_shortest::<T>(copy _1, copy _2, move _19, copy _3) -> [return: bb8, unwind continue];
+          _19 = copy _3;
+-         _0 = float_to_exponential_common_shortest::<T>(move _16, move _17, move _18, move _19) -> [return: bb7, unwind continue];
++         _0 = float_to_exponential_common_shortest::<T>(copy _1, copy _2, move _18, copy _3) -> [return: bb7, unwind continue];
       }
   
-      bb8: {
-          StorageDead(_20);
+      bb7: {
           StorageDead(_19);
           StorageDead(_18);
           StorageDead(_17);
-          goto -> bb9;
+          StorageDead(_16);
+          goto -> bb8;
       }
   
-      bb9: {
-          StorageDead(_6);
+      bb8: {
+          StorageDead(_5);
           StorageDead(_4);
-          StorageDead(_7);
+          StorageDead(_6);
           return;
       }
   
-      bb10: {
+      bb9: {
           unreachable;
       }
   }