Skip to content

Commit 9ee0d80

Browse files
committed
update tests
1 parent 93a73da commit 9ee0d80

32 files changed

+214
-63
lines changed

src/test/ui/associated-consts/defaults-cyclic-fail.stderr

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ note: ...which requires simplifying constant for the type system `Tr::A`...
1010
|
1111
LL | const A: u8 = Self::B;
1212
| ^^^^^^^^^^^^^^^^^^^^^^
13+
note: ...which requires simplifying constant for the type system `Tr::A`...
14+
--> $DIR/defaults-cyclic-fail.rs:6:5
15+
|
16+
LL | const A: u8 = Self::B;
17+
| ^^^^^^^^^^^^^^^^^^^^^^
1318
note: ...which requires const-evaluating + checking `Tr::A`...
1419
--> $DIR/defaults-cyclic-fail.rs:6:5
1520
|
@@ -26,6 +31,11 @@ note: ...which requires simplifying constant for the type system `Tr::B`...
2631
|
2732
LL | const B: u8 = Self::A;
2833
| ^^^^^^^^^^^^^^^^^^^^^^
34+
note: ...which requires simplifying constant for the type system `Tr::B`...
35+
--> $DIR/defaults-cyclic-fail.rs:8:5
36+
|
37+
LL | const B: u8 = Self::A;
38+
| ^^^^^^^^^^^^^^^^^^^^^^
2939
note: ...which requires const-evaluating + checking `Tr::B`...
3040
--> $DIR/defaults-cyclic-fail.rs:8:5
3141
|

src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ note: ...which requires simplifying constant for the type system `IMPL_REF_BAR`.
99
|
1010
LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
note: ...which requires simplifying constant for the type system `IMPL_REF_BAR`...
13+
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
14+
|
15+
LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1217
note: ...which requires const-evaluating + checking `IMPL_REF_BAR`...
1318
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
1419
|
@@ -25,6 +30,11 @@ note: ...which requires simplifying constant for the type system `<impl at $DIR/
2530
|
2631
LL | const BAR: u32 = IMPL_REF_BAR;
2732
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33+
note: ...which requires simplifying constant for the type system `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
34+
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
35+
|
36+
LL | const BAR: u32 = IMPL_REF_BAR;
37+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2838
note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
2939
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
3040
|

src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ note: ...which requires simplifying constant for the type system `DEFAULT_REF_BA
99
|
1010
LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
note: ...which requires simplifying constant for the type system `DEFAULT_REF_BAR`...
13+
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
14+
|
15+
LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1217
note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`...
1318
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
1419
|
@@ -25,6 +30,11 @@ note: ...which requires simplifying constant for the type system `FooDefault::BA
2530
|
2631
LL | const BAR: u32 = DEFAULT_REF_BAR;
2732
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33+
note: ...which requires simplifying constant for the type system `FooDefault::BAR`...
34+
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
35+
|
36+
LL | const BAR: u32 = DEFAULT_REF_BAR;
37+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2838
note: ...which requires const-evaluating + checking `FooDefault::BAR`...
2939
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
3040
|

src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ note: ...which requires simplifying constant for the type system `TRAIT_REF_BAR`
99
|
1010
LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
note: ...which requires simplifying constant for the type system `TRAIT_REF_BAR`...
13+
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
14+
|
15+
LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1217
note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`...
1318
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
1419
|
@@ -25,6 +30,11 @@ note: ...which requires simplifying constant for the type system `<impl at $DIR/
2530
|
2631
LL | const BAR: u32 = TRAIT_REF_BAR;
2732
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33+
note: ...which requires simplifying constant for the type system `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
34+
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
35+
|
36+
LL | const BAR: u32 = TRAIT_REF_BAR;
37+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2838
note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
2939
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
3040
|

src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
#![allow(incomplete_features)]
33

44
fn test<const N: usize>() -> [u8; N - 1] {
5-
//~^ ERROR evaluation of constant
65
todo!()
76
}
87

98
fn main() {
109
test::<0>();
10+
//~^ ERROR failed to evaluate the given constant
11+
//~| ERROR failed to evaluate the given constant
1112
}

src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.stderr

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1-
error[E0080]: evaluation of constant value failed
2-
--> $DIR/from-sig-fail.rs:4:35
1+
error: failed to evaluate the given constant
2+
--> $DIR/from-sig-fail.rs:9:5
33
|
44
LL | fn test<const N: usize>() -> [u8; N - 1] {
5-
| ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow
5+
| ----- required by this bound in `test`
6+
...
7+
LL | test::<0>();
8+
| ^^^^^^^^^
69

7-
error: aborting due to previous error
10+
error: failed to evaluate the given constant
11+
--> $DIR/from-sig-fail.rs:9:5
12+
|
13+
LL | fn test<const N: usize>() -> [u8; N - 1] {
14+
| ----- required by this bound in `test`
15+
...
16+
LL | test::<0>();
17+
| ^^^^^^^^^^^
18+
19+
error: aborting due to 2 previous errors
820

9-
For more information about this error, try `rustc --explain E0080`.

src/test/ui/const-generics/const_evaluatable_checked/simple_fail.full.stderr

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
error[E0080]: evaluation of constant value failed
2-
--> $DIR/simple_fail.rs:6:33
1+
error: failed to evaluate the given constant
2+
--> $DIR/simple_fail.rs:14:5
33
|
4-
LL | type Arr<const N: usize> = [u8; N - 1];
5-
| ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow
4+
LL | fn test<const N: usize>() -> Arr<N> where Arr<N>: Sized {
5+
| ------ required by this bound in `test`
6+
...
7+
LL | test::<0>();
8+
| ^^^^^^^^^
69

7-
error: aborting due to previous error
10+
error: failed to evaluate the given constant
11+
--> $DIR/simple_fail.rs:14:5
12+
|
13+
LL | test::<0>();
14+
| ^^^^^^^^^^^
15+
16+
error: aborting due to 2 previous errors
817

9-
For more information about this error, try `rustc --explain E0080`.

src/test/ui/const-generics/const_evaluatable_checked/simple_fail.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![feature(const_evaluatable_checked)]
44
#![allow(incomplete_features)]
55

6-
type Arr<const N: usize> = [u8; N - 1]; //[full]~ ERROR evaluation of constant
6+
type Arr<const N: usize> = [u8; N - 1];
77
//[min]~^ ERROR generic parameters may not be used in const operations
88

99
fn test<const N: usize>() -> Arr<N> where Arr<N>: Sized {
@@ -12,4 +12,6 @@ fn test<const N: usize>() -> Arr<N> where Arr<N>: Sized {
1212

1313
fn main() {
1414
test::<0>();
15+
//[full]~^ ERROR failed to evaluate the given constant
16+
//[full]~| ERROR failed to evaluate the given constant
1517
}

src/test/ui/consts/const-eval/const-eval-overflow-3.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const A_I8_I
1717
: [u32; (i8::MAX as usize) + 1]
1818
= [0; (i8::MAX + 1) as usize];
1919
//~^ ERROR evaluation of constant value failed
20+
//~| ERROR failed to evaluate the given constant
2021

2122
fn main() {
2223
foo(&A_I8_I[..]);

src/test/ui/consts/const-eval/const-eval-overflow-3.stderr

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ error[E0080]: evaluation of constant value failed
44
LL | = [0; (i8::MAX + 1) as usize];
55
| ^^^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow
66

7-
error: aborting due to previous error
7+
error: failed to evaluate the given constant
8+
--> $DIR/const-eval-overflow-3.rs:18:11
9+
|
10+
LL | = [0; (i8::MAX + 1) as usize];
11+
| ^^^^^^^^^^^^^^^^^^^^^^
12+
13+
error: aborting due to 2 previous errors
814

915
For more information about this error, try `rustc --explain E0080`.

src/test/ui/consts/const-eval/const-pointer-values-in-various-types.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ error[E0080]: it is undefined behavior to use this value
3636
--> $DIR/const-pointer-values-in-various-types.rs:37:5
3737
|
3838
LL | const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 };
39-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc18, but expected initialized plain (non-pointer) bytes
39+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc24, but expected initialized plain (non-pointer) bytes
4040
|
4141
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
4242

@@ -76,7 +76,7 @@ error[E0080]: it is undefined behavior to use this value
7676
--> $DIR/const-pointer-values-in-various-types.rs:52:5
7777
|
7878
LL | const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 };
79-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc38, but expected initialized plain (non-pointer) bytes
79+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc50, but expected initialized plain (non-pointer) bytes
8080
|
8181
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
8282

@@ -100,7 +100,7 @@ error[E0080]: it is undefined behavior to use this value
100100
--> $DIR/const-pointer-values-in-various-types.rs:61:5
101101
|
102102
LL | const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 };
103-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc50, but expected initialized plain (non-pointer) bytes
103+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc64, but expected initialized plain (non-pointer) bytes
104104
|
105105
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
106106

@@ -148,7 +148,7 @@ error[E0080]: it is undefined behavior to use this value
148148
--> $DIR/const-pointer-values-in-various-types.rs:79:5
149149
|
150150
LL | const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 };
151-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc71, but expected initialized plain (non-pointer) bytes
151+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc98, but expected initialized plain (non-pointer) bytes
152152
|
153153
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
154154

@@ -188,7 +188,7 @@ error[E0080]: it is undefined behavior to use this value
188188
--> $DIR/const-pointer-values-in-various-types.rs:94:5
189189
|
190190
LL | const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 };
191-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc86, but expected initialized plain (non-pointer) bytes
191+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc125, but expected initialized plain (non-pointer) bytes
192192
|
193193
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
194194

@@ -212,7 +212,7 @@ error[E0080]: it is undefined behavior to use this value
212212
--> $DIR/const-pointer-values-in-various-types.rs:103:5
213213
|
214214
LL | const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 };
215-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc95, but expected initialized plain (non-pointer) bytes
215+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc140, but expected initialized plain (non-pointer) bytes
216216
|
217217
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
218218

src/test/ui/consts/const-eval/infinite_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
fn main() {
22
// Tests the Collatz conjecture with an incorrect base case (0 instead of 1).
33
// The value of `n` will loop indefinitely (4 - 2 - 1 - 4).
4-
let _ = [(); {
4+
let _ = [(); { //~ ERROR failed to evaluate the given constant
55
let mut n = 113383; // #20 in https://oeis.org/A006884
66
while n != 0 {
77
n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
1+
error: failed to evaluate the given constant
2+
--> $DIR/infinite_loop.rs:4:18
3+
|
4+
LL | let _ = [(); {
5+
| __________________^
6+
LL | | let mut n = 113383; // #20 in https://oeis.org/A006884
7+
LL | | while n != 0 {
8+
LL | | n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
9+
... |
10+
LL | | n
11+
LL | | }];
12+
| |_____^
13+
114
error[E0080]: evaluation of constant value failed
215
--> $DIR/infinite_loop.rs:7:17
316
|
417
LL | n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
518
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
619

7-
error: aborting due to previous error
20+
error: aborting due to 2 previous errors
821

922
For more information about this error, try `rustc --explain E0080`.

src/test/ui/consts/const-eval/issue-49296.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: any use of this value will cause an error
44
LL | const X: u64 = *wat(42);
55
| ---------------^^^^^^^^-
66
| |
7-
| pointer to alloc1 was dereferenced after this allocation got freed
7+
| pointer to alloc4 was dereferenced after this allocation got freed
88
|
99
= note: `#[deny(const_err)]` on by default
1010

src/test/ui/consts/const-eval/issue-52475.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fn main() {
2-
let _ = [(); {
2+
let _ = [(); { //~ ERROR failed to evaluate the given constant
33
let mut x = &0;
44
let mut n = 0;
55
while n < 5 {
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
1+
error: failed to evaluate the given constant
2+
--> $DIR/issue-52475.rs:2:18
3+
|
4+
LL | let _ = [(); {
5+
| __________________^
6+
LL | | let mut x = &0;
7+
LL | | let mut n = 0;
8+
LL | | while n < 5 {
9+
... |
10+
LL | | 0
11+
LL | | }];
12+
| |_____^
13+
114
error[E0080]: evaluation of constant value failed
215
--> $DIR/issue-52475.rs:6:17
316
|
417
LL | n = (n + 1) % 5;
518
| ^^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
619

7-
error: aborting due to previous error
20+
error: aborting due to 2 previous errors
821

922
For more information about this error, try `rustc --explain E0080`.

src/test/ui/consts/const-size_of-cycle.stderr

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ note: ...which requires simplifying constant for the type system `Foo::bytes::{c
99
|
1010
LL | bytes: [u8; std::mem::size_of::<Foo>()]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
note: ...which requires simplifying constant for the type system `Foo::bytes::{constant#0}`...
13+
--> $DIR/const-size_of-cycle.rs:4:17
14+
|
15+
LL | bytes: [u8; std::mem::size_of::<Foo>()]
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
1217
note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`...
1318
--> $DIR/const-size_of-cycle.rs:4:17
1419
|

src/test/ui/consts/issue-36163.stderr

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ note: ...which requires simplifying constant for the type system `Foo::B::{const
99
|
1010
LL | B = A,
1111
| ^
12+
note: ...which requires simplifying constant for the type system `Foo::B::{constant#0}`...
13+
--> $DIR/issue-36163.rs:4:9
14+
|
15+
LL | B = A,
16+
| ^
1217
note: ...which requires const-evaluating + checking `Foo::B::{constant#0}`...
1318
--> $DIR/issue-36163.rs:4:9
1419
|
@@ -25,6 +30,11 @@ note: ...which requires simplifying constant for the type system `A`...
2530
|
2631
LL | const A: isize = Foo::B as isize;
2732
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33+
note: ...which requires simplifying constant for the type system `A`...
34+
--> $DIR/issue-36163.rs:1:1
35+
|
36+
LL | const A: isize = Foo::B as isize;
37+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2838
note: ...which requires const-evaluating + checking `A`...
2939
--> $DIR/issue-36163.rs:1:1
3040
|

src/test/ui/consts/issue-44415.stderr

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ note: ...which requires simplifying constant for the type system `Foo::bytes::{c
99
|
1010
LL | bytes: [u8; unsafe { intrinsics::size_of::<Foo>() }],
1111
| ^^^^^^
12+
note: ...which requires simplifying constant for the type system `Foo::bytes::{constant#0}`...
13+
--> $DIR/issue-44415.rs:6:17
14+
|
15+
LL | bytes: [u8; unsafe { intrinsics::size_of::<Foo>() }],
16+
| ^^^^^^
1217
note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`...
1318
--> $DIR/issue-44415.rs:6:17
1419
|

src/test/ui/consts/issue-52432.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ fn main() {
66
//~| ERROR: type annotations needed
77
[(); &(static || {}) as *const _ as usize];
88
//~^ ERROR: closures cannot be static
9-
//~| ERROR evaluation of constant value failed
9+
//~| ERROR: failed to evaluate the given constant
1010
}

src/test/ui/consts/issue-52432.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ error[E0282]: type annotations needed
1616
LL | [(); &(static |x| {}) as *const _ as usize];
1717
| ^ consider giving this closure parameter a type
1818

19-
error[E0080]: evaluation of constant value failed
19+
error: failed to evaluate the given constant
2020
--> $DIR/issue-52432.rs:7:10
2121
|
2222
LL | [(); &(static || {}) as *const _ as usize];
23-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "pointer-to-integer cast" needs an rfc before being allowed inside constants
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2424

2525
error: aborting due to 4 previous errors
2626

27-
Some errors have detailed explanations: E0080, E0282, E0697.
28-
For more information about an error, try `rustc --explain E0080`.
27+
Some errors have detailed explanations: E0282, E0697.
28+
For more information about an error, try `rustc --explain E0282`.

0 commit comments

Comments
 (0)