diff options
| author | Ralf Jung <post@ralfj.de> | 2020-06-01 11:17:38 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2020-06-12 09:43:55 +0200 |
| commit | 0ac6fd0405c2f3defa9ad8ee3d4026469fbda018 (patch) | |
| tree | d9c842f302d6d2b0dc3b712943523e2a57573d23 /src/test | |
| parent | dc6ffaebd5b56793f86443a0a50c06f025321198 (diff) | |
fix const_prop spans and re-bless tests
Diffstat (limited to 'src/test')
8 files changed, 29 insertions, 26 deletions
diff --git a/src/test/ui/consts/const-eval/infinite_loop.stderr b/src/test/ui/consts/const-eval/infinite_loop.stderr index ebdb73c4467..3386e6e588e 100644 --- a/src/test/ui/consts/const-eval/infinite_loop.stderr +++ b/src/test/ui/consts/const-eval/infinite_loop.stderr @@ -23,10 +23,10 @@ LL | n = if n % 2 == 0 { n/2 } else { 3*n + 1 }; = help: add `#![feature(const_if_match)]` to the crate attributes to enable error[E0080]: evaluation of constant value failed - --> $DIR/infinite_loop.rs:8:20 + --> $DIR/infinite_loop.rs:8:17 | LL | n = if n % 2 == 0 { n/2 } else { 3*n + 1 }; - | ^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`) error: aborting due to 3 previous errors diff --git a/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr b/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr index be522dd6d5d..8c2190b4e59 100644 --- a/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr +++ b/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr @@ -1,15 +1,18 @@ error: any use of this value will cause an error - --> $DIR/const_eval_limit_reached.rs:8:11 + --> $DIR/const_eval_limit_reached.rs:8:5 | -LL | / const X: usize = { -LL | | let mut x = 0; -LL | | while x != 1000 { - | | ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`) -LL | | -... | -LL | | x -LL | | }; - | |__- +LL | / const X: usize = { +LL | | let mut x = 0; +LL | | while x != 1000 { + | |_____^ +LL | || +LL | || x += 1; +LL | || } + | ||_____^ exceeded interpreter step limit (see `#[const_eval_limit]`) +LL | | +LL | | x +LL | | }; + | |__- | = note: `#[deny(const_err)]` on by default diff --git a/src/test/ui/consts/recursive-zst-static.default.stderr b/src/test/ui/consts/recursive-zst-static.default.stderr index d424b22f000..9042c6f6be1 100644 --- a/src/test/ui/consts/recursive-zst-static.default.stderr +++ b/src/test/ui/consts/recursive-zst-static.default.stderr @@ -1,8 +1,8 @@ error[E0391]: cycle detected when const-evaluating `FOO` - --> $DIR/recursive-zst-static.rs:10:18 + --> $DIR/recursive-zst-static.rs:10:1 | LL | static FOO: () = FOO; - | ^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | note: ...which requires const-evaluating `FOO`... --> $DIR/recursive-zst-static.rs:10:1 diff --git a/src/test/ui/consts/recursive-zst-static.unleash.stderr b/src/test/ui/consts/recursive-zst-static.unleash.stderr index d424b22f000..9042c6f6be1 100644 --- a/src/test/ui/consts/recursive-zst-static.unleash.stderr +++ b/src/test/ui/consts/recursive-zst-static.unleash.stderr @@ -1,8 +1,8 @@ error[E0391]: cycle detected when const-evaluating `FOO` - --> $DIR/recursive-zst-static.rs:10:18 + --> $DIR/recursive-zst-static.rs:10:1 | LL | static FOO: () = FOO; - | ^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | note: ...which requires const-evaluating `FOO`... --> $DIR/recursive-zst-static.rs:10:1 diff --git a/src/test/ui/consts/uninhabited-const-issue-61744.rs b/src/test/ui/consts/uninhabited-const-issue-61744.rs index 15436f9c1b2..55f42d84f9c 100644 --- a/src/test/ui/consts/uninhabited-const-issue-61744.rs +++ b/src/test/ui/consts/uninhabited-const-issue-61744.rs @@ -1,11 +1,11 @@ // build-fail pub const unsafe fn fake_type<T>() -> T { - hint_unreachable() + hint_unreachable() //~ ERROR evaluation of constant value failed } pub const unsafe fn hint_unreachable() -> ! { - fake_type() //~ ERROR evaluation of constant value failed + fake_type() } trait Const { diff --git a/src/test/ui/consts/uninhabited-const-issue-61744.stderr b/src/test/ui/consts/uninhabited-const-issue-61744.stderr index ca232380897..fc908b2b222 100644 --- a/src/test/ui/consts/uninhabited-const-issue-61744.stderr +++ b/src/test/ui/consts/uninhabited-const-issue-61744.stderr @@ -1,9 +1,10 @@ error[E0080]: evaluation of constant value failed - --> $DIR/uninhabited-const-issue-61744.rs:8:5 + --> $DIR/uninhabited-const-issue-61744.rs:4:5 | LL | hint_unreachable() - | ------------------ + | ^^^^^^^^^^^^^^^^^^ | | + | reached the configured maximum number of stack frames | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5 | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5 | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5 @@ -71,9 +72,8 @@ LL | hint_unreachable() | inside `fake_type::<i32>` at $DIR/uninhabited-const-issue-61744.rs:4:5 ... LL | fake_type() - | ^^^^^^^^^^^ + | ----------- | | - | reached the configured maximum number of stack frames | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5 | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5 | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5 diff --git a/src/test/ui/recursion/recursive-static-definition.stderr b/src/test/ui/recursion/recursive-static-definition.stderr index b724c261a7c..093606e100c 100644 --- a/src/test/ui/recursion/recursive-static-definition.stderr +++ b/src/test/ui/recursion/recursive-static-definition.stderr @@ -1,8 +1,8 @@ error[E0391]: cycle detected when const-evaluating `FOO` - --> $DIR/recursive-static-definition.rs:1:23 + --> $DIR/recursive-static-definition.rs:1:1 | LL | pub static FOO: u32 = FOO; - | ^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: ...which requires const-evaluating `FOO`... --> $DIR/recursive-static-definition.rs:1:1 diff --git a/src/test/ui/write-to-static-mut-in-static.stderr b/src/test/ui/write-to-static-mut-in-static.stderr index 6c2bd13d433..50dfce3448c 100644 --- a/src/test/ui/write-to-static-mut-in-static.stderr +++ b/src/test/ui/write-to-static-mut-in-static.stderr @@ -5,10 +5,10 @@ LL | pub static mut B: () = unsafe { A = 1; }; | ^^^^^ modifying a static's initial value from another static's initializer error[E0391]: cycle detected when const-evaluating `C` - --> $DIR/write-to-static-mut-in-static.rs:5:34 + --> $DIR/write-to-static-mut-in-static.rs:5:1 | LL | pub static mut C: u32 = unsafe { C = 1; 0 }; - | ^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: ...which requires const-evaluating `C`... --> $DIR/write-to-static-mut-in-static.rs:5:1 |
