2020-05-17 15:39:35 +02:00
|
|
|
- // MIR for `float_to_exponential_common` before ConstProp
|
|
|
|
+ // MIR for `float_to_exponential_common` after ConstProp
|
|
|
|
|
2021-01-28 18:01:36 +02:00
|
|
|
fn float_to_exponential_common(_1: &mut Formatter, _2: &T, _3: bool) -> Result<(), std::fmt::Error> {
|
2020-05-17 15:39:35 +02:00
|
|
|
debug fmt => _1; // in scope 0 at $DIR/funky_arms.rs:11:35: 11:38
|
|
|
|
debug num => _2; // in scope 0 at $DIR/funky_arms.rs:11:60: 11:63
|
|
|
|
debug upper => _3; // in scope 0 at $DIR/funky_arms.rs:11:69: 11:74
|
|
|
|
let mut _0: std::result::Result<(), std::fmt::Error>; // return place in scope 0 at $DIR/funky_arms.rs:11:85: 11:91
|
|
|
|
let _4: bool; // in scope 0 at $DIR/funky_arms.rs:15:9: 15:19
|
Use larger span for adjustments on method calls
Currently, we use a relatively 'small' span for THIR
expressions generated by an 'adjustment' (e.g. an autoderef,
autoborrow, unsizing). As a result, if a borrow generated
by an adustment ends up causing a borrowcheck error, for example:
```rust
let mut my_var = String::new();
let my_ref = &my_var
my_var.push('a');
my_ref;
```
then the span for the mutable borrow may end up referring
to only the base expression (e.g. `my_var`), rather than
the method call which triggered the mutable borrow
(e.g. `my_var.push('a')`)
Due to a quirk of the MIR borrowck implementation,
this doesn't always get exposed in migration mode,
but it does in many cases.
This commit makes THIR building consistently use 'larger'
spans for adjustment expressions
The intent of this change it make it clearer to users
when it's the specific way in which a variable is
used (for example, in a method call) that produdes
a borrowcheck error. For example, an error message
claiming that a 'mutable borrow occurs here' might
be confusing if it just points at a usage of a variable
(e.g. `my_var`), when no `&mut` is in sight. Pointing
at the entire expression should help to emphasize
that the method call itself is responsible for
the mutable borrow.
In several cases, this makes the `#![feature(nll)]` diagnostic
output match up exactly with the default (migration mode) output.
As a result, several `.nll.stderr` files end up getting removed
entirely.
2021-09-16 15:01:22 -05:00
|
|
|
let mut _5: &std::fmt::Formatter; // in scope 0 at $DIR/funky_arms.rs:15:22: 15:37
|
2020-05-17 15:39:35 +02:00
|
|
|
let mut _7: std::option::Option<usize>; // in scope 0 at $DIR/funky_arms.rs:24:30: 24:45
|
Use larger span for adjustments on method calls
Currently, we use a relatively 'small' span for THIR
expressions generated by an 'adjustment' (e.g. an autoderef,
autoborrow, unsizing). As a result, if a borrow generated
by an adustment ends up causing a borrowcheck error, for example:
```rust
let mut my_var = String::new();
let my_ref = &my_var
my_var.push('a');
my_ref;
```
then the span for the mutable borrow may end up referring
to only the base expression (e.g. `my_var`), rather than
the method call which triggered the mutable borrow
(e.g. `my_var.push('a')`)
Due to a quirk of the MIR borrowck implementation,
this doesn't always get exposed in migration mode,
but it does in many cases.
This commit makes THIR building consistently use 'larger'
spans for adjustment expressions
The intent of this change it make it clearer to users
when it's the specific way in which a variable is
used (for example, in a method call) that produdes
a borrowcheck error. For example, an error message
claiming that a 'mutable borrow occurs here' might
be confusing if it just points at a usage of a variable
(e.g. `my_var`), when no `&mut` is in sight. Pointing
at the entire expression should help to emphasize
that the method call itself is responsible for
the mutable borrow.
In several cases, this makes the `#![feature(nll)]` diagnostic
output match up exactly with the default (migration mode) output.
As a result, several `.nll.stderr` files end up getting removed
entirely.
2021-09-16 15:01:22 -05:00
|
|
|
let mut _8: &std::fmt::Formatter; // in scope 0 at $DIR/funky_arms.rs:24:30: 24:45
|
2020-05-17 15:39:35 +02:00
|
|
|
let mut _9: isize; // in scope 0 at $DIR/funky_arms.rs:24:12: 24:27
|
|
|
|
let mut _11: &mut std::fmt::Formatter; // in scope 0 at $DIR/funky_arms.rs:26:43: 26:46
|
|
|
|
let mut _12: &T; // in scope 0 at $DIR/funky_arms.rs:26:48: 26:51
|
|
|
|
let mut _13: core::num::flt2dec::Sign; // in scope 0 at $DIR/funky_arms.rs:26:53: 26:57
|
|
|
|
let mut _14: u32; // in scope 0 at $DIR/funky_arms.rs:26:59: 26:79
|
|
|
|
let mut _15: u32; // in scope 0 at $DIR/funky_arms.rs:26:59: 26:75
|
|
|
|
let mut _16: usize; // in scope 0 at $DIR/funky_arms.rs:26:59: 26:68
|
|
|
|
let mut _17: bool; // in scope 0 at $DIR/funky_arms.rs:26:81: 26:86
|
|
|
|
let mut _18: &mut std::fmt::Formatter; // in scope 0 at $DIR/funky_arms.rs:28:46: 28:49
|
|
|
|
let mut _19: &T; // in scope 0 at $DIR/funky_arms.rs:28:51: 28:54
|
|
|
|
let mut _20: core::num::flt2dec::Sign; // in scope 0 at $DIR/funky_arms.rs:28:56: 28:60
|
|
|
|
let mut _21: bool; // in scope 0 at $DIR/funky_arms.rs:28:62: 28:67
|
|
|
|
scope 1 {
|
|
|
|
debug force_sign => _4; // in scope 1 at $DIR/funky_arms.rs:15:9: 15:19
|
|
|
|
let _6: core::num::flt2dec::Sign; // in scope 1 at $DIR/funky_arms.rs:19:9: 19:13
|
|
|
|
scope 2 {
|
|
|
|
debug sign => _6; // in scope 2 at $DIR/funky_arms.rs:19:9: 19:13
|
|
|
|
scope 3 {
|
|
|
|
debug precision => _10; // in scope 3 at $DIR/funky_arms.rs:24:17: 24:26
|
2022-06-09 23:09:04 -07:00
|
|
|
let _10: usize; // in scope 3 at $DIR/funky_arms.rs:24:17: 24:26
|
2020-05-17 15:39:35 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
|
|
|
StorageLive(_4); // scope 0 at $DIR/funky_arms.rs:15:9: 15:19
|
Use larger span for adjustments on method calls
Currently, we use a relatively 'small' span for THIR
expressions generated by an 'adjustment' (e.g. an autoderef,
autoborrow, unsizing). As a result, if a borrow generated
by an adustment ends up causing a borrowcheck error, for example:
```rust
let mut my_var = String::new();
let my_ref = &my_var
my_var.push('a');
my_ref;
```
then the span for the mutable borrow may end up referring
to only the base expression (e.g. `my_var`), rather than
the method call which triggered the mutable borrow
(e.g. `my_var.push('a')`)
Due to a quirk of the MIR borrowck implementation,
this doesn't always get exposed in migration mode,
but it does in many cases.
This commit makes THIR building consistently use 'larger'
spans for adjustment expressions
The intent of this change it make it clearer to users
when it's the specific way in which a variable is
used (for example, in a method call) that produdes
a borrowcheck error. For example, an error message
claiming that a 'mutable borrow occurs here' might
be confusing if it just points at a usage of a variable
(e.g. `my_var`), when no `&mut` is in sight. Pointing
at the entire expression should help to emphasize
that the method call itself is responsible for
the mutable borrow.
In several cases, this makes the `#![feature(nll)]` diagnostic
output match up exactly with the default (migration mode) output.
As a result, several `.nll.stderr` files end up getting removed
entirely.
2021-09-16 15:01:22 -05:00
|
|
|
StorageLive(_5); // scope 0 at $DIR/funky_arms.rs:15:22: 15:37
|
|
|
|
_5 = &(*_1); // scope 0 at $DIR/funky_arms.rs:15:22: 15:37
|
2020-09-02 10:40:56 +03:00
|
|
|
_4 = Formatter::sign_plus(move _5) -> bb1; // scope 0 at $DIR/funky_arms.rs:15:22: 15:37
|
2020-05-17 15:39:35 +02:00
|
|
|
// mir::Constant
|
|
|
|
// + span: $DIR/funky_arms.rs:15:26: 15:35
|
2022-07-06 10:14:46 -04:00
|
|
|
// + literal: Const { ty: for<'r> fn(&'r Formatter) -> bool {Formatter::sign_plus}, val: Value(<ZST>) }
|
2020-05-17 15:39:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
|
|
|
StorageDead(_5); // scope 0 at $DIR/funky_arms.rs:15:36: 15:37
|
|
|
|
StorageLive(_6); // scope 1 at $DIR/funky_arms.rs:19:9: 19:13
|
2021-07-23 18:55:36 -04:00
|
|
|
switchInt(_4) -> [false: bb3, otherwise: bb2]; // scope 1 at $DIR/funky_arms.rs:19:16: 19:32
|
2020-05-17 15:39:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2022-04-05 19:02:57 -04:00
|
|
|
Deinit(_6); // scope 1 at $DIR/funky_arms.rs:21:17: 21:41
|
2020-10-31 13:16:14 -07:00
|
|
|
discriminant(_6) = 1; // scope 1 at $DIR/funky_arms.rs:21:17: 21:41
|
2021-07-23 18:55:36 -04:00
|
|
|
goto -> bb4; // scope 1 at $DIR/funky_arms.rs:21:17: 21:41
|
2020-05-17 15:39:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bb3: {
|
2022-04-05 19:02:57 -04:00
|
|
|
Deinit(_6); // scope 1 at $DIR/funky_arms.rs:20:18: 20:38
|
2020-05-17 15:39:35 +02:00
|
|
|
discriminant(_6) = 0; // scope 1 at $DIR/funky_arms.rs:20:18: 20:38
|
2021-07-23 18:55:36 -04:00
|
|
|
goto -> bb4; // scope 1 at $DIR/funky_arms.rs:20:18: 20:38
|
2020-05-17 15:39:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bb4: {
|
2022-06-09 23:09:04 -07:00
|
|
|
StorageLive(_7); // scope 3 at $DIR/funky_arms.rs:24:30: 24:45
|
|
|
|
StorageLive(_8); // scope 3 at $DIR/funky_arms.rs:24:30: 24:45
|
|
|
|
_8 = &(*_1); // scope 3 at $DIR/funky_arms.rs:24:30: 24:45
|
|
|
|
_7 = Formatter::precision(move _8) -> bb5; // scope 3 at $DIR/funky_arms.rs:24:30: 24:45
|
2020-05-17 15:39:35 +02:00
|
|
|
// mir::Constant
|
|
|
|
// + span: $DIR/funky_arms.rs:24:34: 24:43
|
2022-07-06 10:14:46 -04:00
|
|
|
// + literal: Const { ty: for<'r> fn(&'r Formatter) -> Option<usize> {Formatter::precision}, val: Value(<ZST>) }
|
2020-05-17 15:39:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bb5: {
|
2022-06-09 23:09:04 -07:00
|
|
|
StorageDead(_8); // scope 3 at $DIR/funky_arms.rs:24:44: 24:45
|
|
|
|
_9 = discriminant(_7); // scope 3 at $DIR/funky_arms.rs:24:12: 24:27
|
|
|
|
switchInt(move _9) -> [1_isize: bb6, otherwise: bb8]; // scope 3 at $DIR/funky_arms.rs:24:12: 24:27
|
2020-05-17 15:39:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bb6: {
|
2022-06-09 11:06:44 -07:00
|
|
|
StorageLive(_10); // scope 3 at $DIR/funky_arms.rs:24:17: 24:26
|
|
|
|
_10 = ((_7 as Some).0: usize); // scope 3 at $DIR/funky_arms.rs:24:17: 24:26
|
2022-06-09 23:16:56 -07:00
|
|
|
StorageLive(_11); // scope 3 at $DIR/funky_arms.rs:26:43: 26:46
|
|
|
|
_11 = &mut (*_1); // scope 3 at $DIR/funky_arms.rs:26:43: 26:46
|
|
|
|
StorageLive(_12); // scope 3 at $DIR/funky_arms.rs:26:48: 26:51
|
|
|
|
_12 = _2; // scope 3 at $DIR/funky_arms.rs:26:48: 26:51
|
|
|
|
StorageLive(_13); // scope 3 at $DIR/funky_arms.rs:26:53: 26:57
|
|
|
|
_13 = _6; // scope 3 at $DIR/funky_arms.rs:26:53: 26:57
|
|
|
|
StorageLive(_14); // scope 3 at $DIR/funky_arms.rs:26:59: 26:79
|
|
|
|
StorageLive(_15); // scope 3 at $DIR/funky_arms.rs:26:59: 26:75
|
|
|
|
StorageLive(_16); // scope 3 at $DIR/funky_arms.rs:26:59: 26:68
|
|
|
|
_16 = _10; // scope 3 at $DIR/funky_arms.rs:26:59: 26:68
|
|
|
|
_15 = move _16 as u32 (Misc); // scope 3 at $DIR/funky_arms.rs:26:59: 26:75
|
|
|
|
StorageDead(_16); // scope 3 at $DIR/funky_arms.rs:26:74: 26:75
|
|
|
|
_14 = Add(move _15, const 1_u32); // scope 3 at $DIR/funky_arms.rs:26:59: 26:79
|
|
|
|
StorageDead(_15); // scope 3 at $DIR/funky_arms.rs:26:78: 26:79
|
|
|
|
StorageLive(_17); // scope 3 at $DIR/funky_arms.rs:26:81: 26:86
|
|
|
|
_17 = _3; // scope 3 at $DIR/funky_arms.rs:26:81: 26:86
|
|
|
|
_0 = float_to_exponential_common_exact::<T>(move _11, move _12, move _13, move _14, move _17) -> bb7; // scope 3 at $DIR/funky_arms.rs:26:9: 26:87
|
2020-05-17 15:39:35 +02:00
|
|
|
// mir::Constant
|
|
|
|
// + span: $DIR/funky_arms.rs:26:9: 26:42
|
2022-07-06 10:14:46 -04:00
|
|
|
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r mut Formatter<'s>, &'t0 T, Sign, u32, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_exact::<T>}, val: Value(<ZST>) }
|
2020-05-17 15:39:35 +02:00
|
|
|
}
|
|
|
|
|
2021-09-01 22:52:17 +01:00
|
|
|
bb7: {
|
2022-06-09 23:16:56 -07:00
|
|
|
StorageDead(_17); // scope 3 at $DIR/funky_arms.rs:26:86: 26:87
|
|
|
|
StorageDead(_14); // scope 3 at $DIR/funky_arms.rs:26:86: 26:87
|
|
|
|
StorageDead(_13); // scope 3 at $DIR/funky_arms.rs:26:86: 26:87
|
|
|
|
StorageDead(_12); // scope 3 at $DIR/funky_arms.rs:26:86: 26:87
|
|
|
|
StorageDead(_11); // scope 3 at $DIR/funky_arms.rs:26:86: 26:87
|
2021-09-01 22:52:17 +01:00
|
|
|
StorageDead(_10); // scope 2 at $DIR/funky_arms.rs:27:5: 27:6
|
2020-05-17 15:39:35 +02:00
|
|
|
goto -> bb10; // scope 2 at $DIR/funky_arms.rs:24:5: 29:6
|
|
|
|
}
|
|
|
|
|
2021-09-01 22:52:17 +01:00
|
|
|
bb8: {
|
|
|
|
StorageLive(_18); // scope 2 at $DIR/funky_arms.rs:28:46: 28:49
|
|
|
|
_18 = &mut (*_1); // scope 2 at $DIR/funky_arms.rs:28:46: 28:49
|
|
|
|
StorageLive(_19); // scope 2 at $DIR/funky_arms.rs:28:51: 28:54
|
|
|
|
_19 = _2; // scope 2 at $DIR/funky_arms.rs:28:51: 28:54
|
|
|
|
StorageLive(_20); // scope 2 at $DIR/funky_arms.rs:28:56: 28:60
|
|
|
|
_20 = _6; // scope 2 at $DIR/funky_arms.rs:28:56: 28:60
|
|
|
|
StorageLive(_21); // scope 2 at $DIR/funky_arms.rs:28:62: 28:67
|
|
|
|
_21 = _3; // scope 2 at $DIR/funky_arms.rs:28:62: 28:67
|
|
|
|
_0 = float_to_exponential_common_shortest::<T>(move _18, move _19, move _20, move _21) -> bb9; // scope 2 at $DIR/funky_arms.rs:28:9: 28:68
|
|
|
|
// mir::Constant
|
|
|
|
// + span: $DIR/funky_arms.rs:28:9: 28:45
|
2022-07-06 10:14:46 -04:00
|
|
|
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r mut Formatter<'s>, &'t0 T, Sign, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_shortest::<T>}, val: Value(<ZST>) }
|
2021-09-01 22:52:17 +01:00
|
|
|
}
|
|
|
|
|
2020-05-17 15:39:35 +02:00
|
|
|
bb9: {
|
|
|
|
StorageDead(_21); // scope 2 at $DIR/funky_arms.rs:28:67: 28:68
|
|
|
|
StorageDead(_20); // scope 2 at $DIR/funky_arms.rs:28:67: 28:68
|
|
|
|
StorageDead(_19); // scope 2 at $DIR/funky_arms.rs:28:67: 28:68
|
|
|
|
StorageDead(_18); // scope 2 at $DIR/funky_arms.rs:28:67: 28:68
|
|
|
|
goto -> bb10; // scope 2 at $DIR/funky_arms.rs:24:5: 29:6
|
|
|
|
}
|
|
|
|
|
|
|
|
bb10: {
|
|
|
|
StorageDead(_6); // scope 1 at $DIR/funky_arms.rs:30:1: 30:2
|
|
|
|
StorageDead(_4); // scope 0 at $DIR/funky_arms.rs:30:1: 30:2
|
|
|
|
StorageDead(_7); // scope 0 at $DIR/funky_arms.rs:30:1: 30:2
|
|
|
|
return; // scope 0 at $DIR/funky_arms.rs:30:2: 30:2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|