-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change enum->int casts to not go through MIR casts.
Instead we generate a discriminant rvalue and cast the result of that.
- Loading branch information
Showing
15 changed files
with
221 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// MIR for `bar` 0 mir_map | ||
|
||
fn bar(_1: Bar) -> usize { | ||
debug bar => _1; // in scope 0 at $DIR/enum_cast.rs:22:8: 22:11 | ||
let mut _0: usize; // return place in scope 0 at $DIR/enum_cast.rs:22:21: 22:26 | ||
let mut _2: isize; // in scope 0 at $DIR/enum_cast.rs:23:5: 23:8 | ||
|
||
bb0: { | ||
_2 = discriminant(_1); // scope 0 at $DIR/enum_cast.rs:23:5: 23:17 | ||
_0 = move _2 as usize (Misc); // scope 0 at $DIR/enum_cast.rs:23:5: 23:17 | ||
return; // scope 0 at $DIR/enum_cast.rs:24:2: 24:2 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// MIR for `boo` 0 mir_map | ||
|
||
fn boo(_1: Boo) -> usize { | ||
debug boo => _1; // in scope 0 at $DIR/enum_cast.rs:26:8: 26:11 | ||
let mut _0: usize; // return place in scope 0 at $DIR/enum_cast.rs:26:21: 26:26 | ||
let mut _2: u8; // in scope 0 at $DIR/enum_cast.rs:27:5: 27:8 | ||
|
||
bb0: { | ||
_2 = discriminant(_1); // scope 0 at $DIR/enum_cast.rs:27:5: 27:17 | ||
_0 = move _2 as usize (Misc); // scope 0 at $DIR/enum_cast.rs:27:5: 27:17 | ||
return; // scope 0 at $DIR/enum_cast.rs:28:2: 28:2 | ||
} | ||
} |
Oops, something went wrong.