Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 7 pull requests #124527

Merged
merged 18 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a0a8442
Remove direct dependencies on lazy_static, once_cell and byteorder
GKFX Apr 28, 2024
ca79086
Fix #124478 - offset_of! returns a temporary
GKFX Apr 28, 2024
2348eb2
Update mir-opt tests, add proper regression test
GKFX Apr 28, 2024
8aa3c59
Move rustfmt changes out
GKFX Apr 28, 2024
254a9fb
Prohibit const prop of unions in `KnownPanicsLint`
gurry Apr 29, 2024
a25a11a
coverage: Avoid hard-coded values when visiting logical ops
Zalathar Apr 29, 2024
c8ff8a4
Pretty-print parenthesis around binary in postfix match
scrabsha Apr 22, 2024
d31b7db
[Refactor] Rename Lint and LintGroup\'s is_loaded to is_externally_lo…
blyxyas Apr 29, 2024
5776aec
Make names more accurate
compiler-errors Apr 26, 2024
7cf1c54
Actually use probes when needed and stop relying on existing outer pr…
compiler-errors Apr 26, 2024
2eb7c81
Only register candidate if it is associated w a shallow certainty
compiler-errors Apr 28, 2024
f1c53da
Rollup merge of #124269 - scrabsha:sasha/fix-124206, r=dtolnay
jieyouxu Apr 29, 2024
4355749
Rollup merge of #124415 - compiler-errors:candidates, r=lcnr
jieyouxu Apr 29, 2024
3151ad5
Rollup merge of #124475 - GKFX:more-dependency-pruning, r=oli-obk
jieyouxu Apr 29, 2024
0580588
Rollup merge of #124484 - GKFX:offset_of_must_use, r=jieyouxu
jieyouxu Apr 29, 2024
43265f5
Rollup merge of #124504 - gurry:123710-union-ICE, r=oli-obk
jieyouxu Apr 29, 2024
0797adb
Rollup merge of #124508 - Zalathar:op, r=jieyouxu
jieyouxu Apr 29, 2024
ebce31a
Rollup merge of #124522 - blyxyas:refactor-is-loaded, r=jieyouxu
jieyouxu Apr 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update mir-opt tests, add proper regression test
  • Loading branch information
GKFX committed Apr 28, 2024
commit 2348eb271c95f7ba75333f41b1a303b3b7261b4f
112 changes: 28 additions & 84 deletions tests/mir-opt/const_prop/offset_of.concrete.GVN.panic-abort.diff
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,26 @@
fn concrete() -> () {
let mut _0: ();
let _1: usize;
let mut _2: usize;
let mut _4: usize;
let mut _6: usize;
let mut _8: usize;
let mut _10: usize;
let mut _12: usize;
let mut _14: usize;
scope 1 {
debug x => _1;
let _3: usize;
let _2: usize;
scope 2 {
debug y => _3;
let _5: usize;
debug y => _2;
let _3: usize;
scope 3 {
debug z0 => _5;
let _7: usize;
debug z0 => _3;
let _4: usize;
scope 4 {
debug z1 => _7;
let _9: usize;
debug z1 => _4;
let _5: usize;
scope 5 {
debug eA0 => _9;
let _11: usize;
debug eA0 => _5;
let _6: usize;
scope 6 {
debug eA1 => _11;
let _13: usize;
debug eA1 => _6;
let _7: usize;
scope 7 {
debug eC => _13;
debug eC => _7;
}
}
}
Expand All @@ -41,82 +34,33 @@

bb0: {
StorageLive(_1);
- _1 = OffsetOf(Alpha, [(0, 0)]);
+ _1 = const 4_usize;
StorageLive(_2);
- _2 = OffsetOf(Alpha, [(0, 0)]);
- _1 = must_use::<usize>(move _2) -> [return: bb1, unwind unreachable];
+ _2 = const 4_usize;
+ _1 = must_use::<usize>(const 4_usize) -> [return: bb1, unwind unreachable];
}

bb1: {
StorageDead(_2);
- _2 = OffsetOf(Alpha, [(0, 1)]);
+ _2 = const 0_usize;
StorageLive(_3);
- _3 = OffsetOf(Alpha, [(0, 2), (0, 0)]);
+ _3 = const 2_usize;
StorageLive(_4);
- _4 = OffsetOf(Alpha, [(0, 1)]);
- _3 = must_use::<usize>(move _4) -> [return: bb2, unwind unreachable];
+ _4 = const 0_usize;
+ _3 = must_use::<usize>(const 0_usize) -> [return: bb2, unwind unreachable];
}

bb2: {
StorageDead(_4);
- _4 = OffsetOf(Alpha, [(0, 2), (0, 1)]);
+ _4 = const 3_usize;
StorageLive(_5);
- _5 = OffsetOf(Epsilon, [(0, 0)]);
+ _5 = const 1_usize;
StorageLive(_6);
- _6 = OffsetOf(Alpha, [(0, 2), (0, 0)]);
- _5 = must_use::<usize>(move _6) -> [return: bb3, unwind unreachable];
- _6 = OffsetOf(Epsilon, [(0, 1)]);
+ _6 = const 2_usize;
+ _5 = must_use::<usize>(const 2_usize) -> [return: bb3, unwind unreachable];
}

bb3: {
StorageDead(_6);
StorageLive(_7);
StorageLive(_8);
- _8 = OffsetOf(Alpha, [(0, 2), (0, 1)]);
- _7 = must_use::<usize>(move _8) -> [return: bb4, unwind unreachable];
+ _8 = const 3_usize;
+ _7 = must_use::<usize>(const 3_usize) -> [return: bb4, unwind unreachable];
}

bb4: {
StorageDead(_8);
StorageLive(_9);
StorageLive(_10);
- _10 = OffsetOf(Epsilon, [(0, 0)]);
- _9 = must_use::<usize>(move _10) -> [return: bb5, unwind unreachable];
+ _10 = const 1_usize;
+ _9 = must_use::<usize>(const 1_usize) -> [return: bb5, unwind unreachable];
}

bb5: {
StorageDead(_10);
StorageLive(_11);
StorageLive(_12);
- _12 = OffsetOf(Epsilon, [(0, 1)]);
- _11 = must_use::<usize>(move _12) -> [return: bb6, unwind unreachable];
+ _12 = const 2_usize;
+ _11 = must_use::<usize>(const 2_usize) -> [return: bb6, unwind unreachable];
}

bb6: {
StorageDead(_12);
StorageLive(_13);
StorageLive(_14);
- _14 = OffsetOf(Epsilon, [(2, 0)]);
- _13 = must_use::<usize>(move _14) -> [return: bb7, unwind unreachable];
+ _14 = const 4_usize;
+ _13 = must_use::<usize>(const 4_usize) -> [return: bb7, unwind unreachable];
}

bb7: {
StorageDead(_14);
- _7 = OffsetOf(Epsilon, [(2, 0)]);
+ _7 = const 4_usize;
_0 = const ();
StorageDead(_13);
StorageDead(_11);
StorageDead(_9);
StorageDead(_7);
StorageDead(_6);
StorageDead(_5);
StorageDead(_4);
StorageDead(_3);
StorageDead(_2);
StorageDead(_1);
return;
}
Expand Down
112 changes: 28 additions & 84 deletions tests/mir-opt/const_prop/offset_of.concrete.GVN.panic-unwind.diff
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,26 @@
fn concrete() -> () {
let mut _0: ();
let _1: usize;
let mut _2: usize;
let mut _4: usize;
let mut _6: usize;
let mut _8: usize;
let mut _10: usize;
let mut _12: usize;
let mut _14: usize;
scope 1 {
debug x => _1;
let _3: usize;
let _2: usize;
scope 2 {
debug y => _3;
let _5: usize;
debug y => _2;
let _3: usize;
scope 3 {
debug z0 => _5;
let _7: usize;
debug z0 => _3;
let _4: usize;
scope 4 {
debug z1 => _7;
let _9: usize;
debug z1 => _4;
let _5: usize;
scope 5 {
debug eA0 => _9;
let _11: usize;
debug eA0 => _5;
let _6: usize;
scope 6 {
debug eA1 => _11;
let _13: usize;
debug eA1 => _6;
let _7: usize;
scope 7 {
debug eC => _13;
debug eC => _7;
}
}
}
Expand All @@ -41,82 +34,33 @@

bb0: {
StorageLive(_1);
- _1 = OffsetOf(Alpha, [(0, 0)]);
+ _1 = const 4_usize;
StorageLive(_2);
- _2 = OffsetOf(Alpha, [(0, 0)]);
- _1 = must_use::<usize>(move _2) -> [return: bb1, unwind continue];
+ _2 = const 4_usize;
+ _1 = must_use::<usize>(const 4_usize) -> [return: bb1, unwind continue];
}

bb1: {
StorageDead(_2);
- _2 = OffsetOf(Alpha, [(0, 1)]);
+ _2 = const 0_usize;
StorageLive(_3);
- _3 = OffsetOf(Alpha, [(0, 2), (0, 0)]);
+ _3 = const 2_usize;
StorageLive(_4);
- _4 = OffsetOf(Alpha, [(0, 1)]);
- _3 = must_use::<usize>(move _4) -> [return: bb2, unwind continue];
+ _4 = const 0_usize;
+ _3 = must_use::<usize>(const 0_usize) -> [return: bb2, unwind continue];
}

bb2: {
StorageDead(_4);
- _4 = OffsetOf(Alpha, [(0, 2), (0, 1)]);
+ _4 = const 3_usize;
StorageLive(_5);
- _5 = OffsetOf(Epsilon, [(0, 0)]);
+ _5 = const 1_usize;
StorageLive(_6);
- _6 = OffsetOf(Alpha, [(0, 2), (0, 0)]);
- _5 = must_use::<usize>(move _6) -> [return: bb3, unwind continue];
- _6 = OffsetOf(Epsilon, [(0, 1)]);
+ _6 = const 2_usize;
+ _5 = must_use::<usize>(const 2_usize) -> [return: bb3, unwind continue];
}

bb3: {
StorageDead(_6);
StorageLive(_7);
StorageLive(_8);
- _8 = OffsetOf(Alpha, [(0, 2), (0, 1)]);
- _7 = must_use::<usize>(move _8) -> [return: bb4, unwind continue];
+ _8 = const 3_usize;
+ _7 = must_use::<usize>(const 3_usize) -> [return: bb4, unwind continue];
}

bb4: {
StorageDead(_8);
StorageLive(_9);
StorageLive(_10);
- _10 = OffsetOf(Epsilon, [(0, 0)]);
- _9 = must_use::<usize>(move _10) -> [return: bb5, unwind continue];
+ _10 = const 1_usize;
+ _9 = must_use::<usize>(const 1_usize) -> [return: bb5, unwind continue];
}

bb5: {
StorageDead(_10);
StorageLive(_11);
StorageLive(_12);
- _12 = OffsetOf(Epsilon, [(0, 1)]);
- _11 = must_use::<usize>(move _12) -> [return: bb6, unwind continue];
+ _12 = const 2_usize;
+ _11 = must_use::<usize>(const 2_usize) -> [return: bb6, unwind continue];
}

bb6: {
StorageDead(_12);
StorageLive(_13);
StorageLive(_14);
- _14 = OffsetOf(Epsilon, [(2, 0)]);
- _13 = must_use::<usize>(move _14) -> [return: bb7, unwind continue];
+ _14 = const 4_usize;
+ _13 = must_use::<usize>(const 4_usize) -> [return: bb7, unwind continue];
}

bb7: {
StorageDead(_14);
- _7 = OffsetOf(Epsilon, [(2, 0)]);
+ _7 = const 4_usize;
_0 = const ();
StorageDead(_13);
StorageDead(_11);
StorageDead(_9);
StorageDead(_7);
StorageDead(_6);
StorageDead(_5);
StorageDead(_4);
StorageDead(_3);
StorageDead(_2);
StorageDead(_1);
return;
}
Expand Down
Loading
Loading