Commit 3e2e8b9
committed
Disallow to optimise out constants in OOB tests
Apparently our constant errors are only reported if there’s a use in MIR for that constant. This
means that in these tests `let _ = B` is seen as a no-op use and thus is optimised out. Explicitly
drop() the B to make sure it is not optimised (yet, until the inliner happens).
NB: the `let _ = B` statement discussed here has no side effects (such as Drop implementation).1 parent 935dc8d commit 3e2e8b9
File tree
4 files changed
+4
-4
lines changed- src/test/compile-fail
4 files changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
0 commit comments