diff options
| author | oli <github35764891676564198441@oli-obk.de> | 2021-01-04 19:05:51 +0000 |
|---|---|---|
| committer | oli <github35764891676564198441@oli-obk.de> | 2021-01-04 22:29:45 +0000 |
| commit | 65ee418e5c2de7d84353979bbd978ca09390ccba (patch) | |
| tree | 8ae584e6e2d19afbf775901375f97caffb9eaf6c /src/test | |
| parent | 409195d4e50b2c2ae0fc49602350c8a5bdd6bd28 (diff) | |
| download | rust-65ee418e5c2de7d84353979bbd978ca09390ccba.tar.gz rust-65ee418e5c2de7d84353979bbd978ca09390ccba.zip | |
Do not run const prop on the `mir_for_ctfe` of `const fn`
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/const_prop/ice-assert-fail-div-by-zero.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/const_prop/ice-assert-fail-div-by-zero.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/consts/const-eval/issue-49296.stderr | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/test/ui/const_prop/ice-assert-fail-div-by-zero.rs b/src/test/ui/const_prop/ice-assert-fail-div-by-zero.rs index d19cf00eb9c..2afbf3432fb 100644 --- a/src/test/ui/const_prop/ice-assert-fail-div-by-zero.rs +++ b/src/test/ui/const_prop/ice-assert-fail-div-by-zero.rs @@ -1,6 +1,8 @@ // check-pass -// compile-flags: --crate-type lib +// need to emit MIR, because const prop (which emits `unconditional_panic`) only runs if +// the `optimized_mir` query is run, which it isn't in check-only mode. +// compile-flags: --crate-type lib --emit=mir,link #![warn(unconditional_panic)] diff --git a/src/test/ui/const_prop/ice-assert-fail-div-by-zero.stderr b/src/test/ui/const_prop/ice-assert-fail-div-by-zero.stderr index 276fb716d42..865c69c3c89 100644 --- a/src/test/ui/const_prop/ice-assert-fail-div-by-zero.stderr +++ b/src/test/ui/const_prop/ice-assert-fail-div-by-zero.stderr @@ -1,11 +1,11 @@ warning: this operation will panic at runtime - --> $DIR/ice-assert-fail-div-by-zero.rs:11:5 + --> $DIR/ice-assert-fail-div-by-zero.rs:13:5 | LL | f.0 / 0; | ^^^^^^^ attempt to divide `_` by zero | note: the lint level is defined here - --> $DIR/ice-assert-fail-div-by-zero.rs:5:9 + --> $DIR/ice-assert-fail-div-by-zero.rs:7:9 | LL | #![warn(unconditional_panic)] | ^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/consts/const-eval/issue-49296.stderr b/src/test/ui/consts/const-eval/issue-49296.stderr index 798f130a4ba..9363ffbb996 100644 --- a/src/test/ui/consts/const-eval/issue-49296.stderr +++ b/src/test/ui/consts/const-eval/issue-49296.stderr @@ -4,7 +4,7 @@ error: any use of this value will cause an error LL | const X: u64 = *wat(42); | ---------------^^^^^^^^- | | - | pointer to alloc2 was dereferenced after this allocation got freed + | pointer to alloc1 was dereferenced after this allocation got freed | = note: `#[deny(const_err)]` on by default |
