Skip to content

Commit 614301a

Browse files
committed
update tests
1 parent 135a98f commit 614301a

File tree

102 files changed

+620
-520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+620
-520
lines changed

src/test/ui/associated-consts/associated-const-type-parameter-arrays-2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ impl Foo for Def {
1515
pub fn test<A: Foo, B: Foo>() {
1616
let _array = [4; <A as Foo>::Y];
1717
//~^ ERROR constant expression depends on a generic parameter
18+
//~| ERROR failed to evaluate
1819
}
1920

2021
fn main() {

src/test/ui/associated-consts/associated-const-type-parameter-arrays-2.stderr

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@ LL | let _array = [4; <A as Foo>::Y];
66
|
77
= note: this may fail depending on what value the parameter takes
88

9-
error: aborting due to previous error
9+
error: failed to evaluate the given constant
10+
--> $DIR/associated-const-type-parameter-arrays-2.rs:16:22
11+
|
12+
LL | let _array = [4; <A as Foo>::Y];
13+
| ^^^^^^^^^^^^^
14+
15+
error: aborting due to 2 previous errors
1016

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@ note: ...which requires simplifying constant for the type system `Tr::A`...
55
|
66
LL | const A: u8 = Self::B;
77
| ^^^^^^^^^^^^^^^^^^^^^^
8-
note: ...which requires simplifying constant for the type system `Tr::A`...
9-
--> $DIR/defaults-cyclic-fail.rs:6:5
10-
|
11-
LL | const A: u8 = Self::B;
12-
| ^^^^^^^^^^^^^^^^^^^^^^
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-
| ^^^^^^^^^^^^^^^^^^^^^^
188
note: ...which requires const-evaluating + checking `Tr::A`...
199
--> $DIR/defaults-cyclic-fail.rs:6:5
2010
|
@@ -26,16 +16,6 @@ note: ...which requires simplifying constant for the type system `Tr::B`...
2616
|
2717
LL | const B: u8 = Self::A;
2818
| ^^^^^^^^^^^^^^^^^^^^^^
29-
note: ...which requires simplifying constant for the type system `Tr::B`...
30-
--> $DIR/defaults-cyclic-fail.rs:8:5
31-
|
32-
LL | const B: u8 = Self::A;
33-
| ^^^^^^^^^^^^^^^^^^^^^^
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-
| ^^^^^^^^^^^^^^^^^^^^^^
3919
note: ...which requires const-evaluating + checking `Tr::B`...
4020
--> $DIR/defaults-cyclic-fail.rs:8:5
4121
|

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ error[E0391]: cycle detected when simplifying constant for the type system `IMPL
44
LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
note: ...which requires simplifying constant for the type system `IMPL_REF_BAR`...
8-
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
9-
|
10-
LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
177
note: ...which requires const-evaluating + checking `IMPL_REF_BAR`...
188
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
199
|
@@ -25,16 +15,6 @@ note: ...which requires simplifying constant for the type system `<impl at $DIR/
2515
|
2616
LL | const BAR: u32 = IMPL_REF_BAR;
2717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28-
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`...
29-
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
30-
|
31-
LL | const BAR: u32 = IMPL_REF_BAR;
32-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3818
note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
3919
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
4020
|

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ error[E0391]: cycle detected when simplifying constant for the type system `DEFA
44
LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
note: ...which requires simplifying constant for the type system `DEFAULT_REF_BAR`...
8-
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
9-
|
10-
LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
177
note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`...
188
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
199
|
@@ -25,16 +15,6 @@ note: ...which requires simplifying constant for the type system `FooDefault::BA
2515
|
2616
LL | const BAR: u32 = DEFAULT_REF_BAR;
2717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28-
note: ...which requires simplifying constant for the type system `FooDefault::BAR`...
29-
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
30-
|
31-
LL | const BAR: u32 = DEFAULT_REF_BAR;
32-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3818
note: ...which requires const-evaluating + checking `FooDefault::BAR`...
3919
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
4020
|

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ error[E0391]: cycle detected when simplifying constant for the type system `TRAI
44
LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
note: ...which requires simplifying constant for the type system `TRAIT_REF_BAR`...
8-
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
9-
|
10-
LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
177
note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`...
188
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
199
|
@@ -25,16 +15,6 @@ note: ...which requires simplifying constant for the type system `<impl at $DIR/
2515
|
2616
LL | const BAR: u32 = TRAIT_REF_BAR;
2717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28-
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`...
29-
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
30-
|
31-
LL | const BAR: u32 = TRAIT_REF_BAR;
32-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3818
note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
3919
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
4020
|

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

Lines changed: 0 additions & 12 deletions
This file was deleted.

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

Lines changed: 0 additions & 20 deletions
This file was deleted.

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

Lines changed: 0 additions & 17 deletions
This file was deleted.

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

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
struct Foo<const N: u8 = { 255 + 1 }>;
22
//~^ ERROR evaluation of constant value failed
3+
//~| ERROR failed to evaluate
34
fn main() {}

src/test/ui/const-generics/defaults/default-param-wf-concrete.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 | struct Foo<const N: u8 = { 255 + 1 }>;
55
| ^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
66

7-
error: aborting due to previous error
7+
error: failed to evaluate the given constant
8+
--> $DIR/default-param-wf-concrete.rs:1:18
9+
|
10+
LL | struct Foo<const N: u8 = { 255 + 1 }>;
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/const-generics/defaults/wfness.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
struct Ooopsies<const N: u8 = { u8::MAX + 1 }>;
22
//~^ error: evaluation of constant value failed
3+
//~| ERROR failed to evaluate
34

45
trait Trait<const N: u8> {}
56
impl Trait<3> for () {}

src/test/ui/const-generics/defaults/wfness.stderr

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ error[E0080]: evaluation of constant value failed
44
LL | struct Ooopsies<const N: u8 = { u8::MAX + 1 }>;
55
| ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
66

7+
error: failed to evaluate the given constant
8+
--> $DIR/wfness.rs:1:23
9+
|
10+
LL | struct Ooopsies<const N: u8 = { u8::MAX + 1 }>;
11+
| ^
12+
713
error[E0277]: the trait bound `(): Trait<2_u8>` is not satisfied
8-
--> $DIR/wfness.rs:6:47
14+
--> $DIR/wfness.rs:7:47
915
|
1016
LL | struct WhereClause<const N: u8 = 2> where (): Trait<N>;
1117
| ^^^^^^^^ the trait `Trait<2_u8>` is not implemented for `()`
@@ -14,20 +20,20 @@ LL | struct WhereClause<const N: u8 = 2> where (): Trait<N>;
1420
<() as Trait<3_u8>>
1521

1622
error[E0277]: the trait bound `(): Trait<1_u8>` is not satisfied
17-
--> $DIR/wfness.rs:14:13
23+
--> $DIR/wfness.rs:15:13
1824
|
1925
LL | fn foo() -> DependentDefaultWfness {
2026
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait<1_u8>` is not implemented for `()`
2127
|
2228
= help: the following implementations were found:
2329
<() as Trait<3_u8>>
2430
note: required by a bound in `WhereClause`
25-
--> $DIR/wfness.rs:6:47
31+
--> $DIR/wfness.rs:7:47
2632
|
2733
LL | struct WhereClause<const N: u8 = 2> where (): Trait<N>;
2834
| ^^^^^^^^ required by this bound in `WhereClause`
2935

30-
error: aborting due to 3 previous errors
36+
error: aborting due to 4 previous errors
3137

3238
Some errors have detailed explanations: E0080, E0277.
3339
For more information about an error, try `rustc --explain E0080`.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ fn test<const N: usize>() -> [u8; N - 1] {
88

99
fn main() {
1010
test::<0>();
11+
//~^ ERROR failed to evaluate
12+
//~| ERROR failed to evaluate
1113
}

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@ error[E0080]: evaluation of `test::<0_usize>::{constant#0}` failed
44
LL | fn test<const N: usize>() -> [u8; N - 1] {
55
| ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow
66

7-
error: aborting due to previous error
7+
error: failed to evaluate the given constant
8+
--> $DIR/from-sig-fail.rs:10:5
9+
|
10+
LL | test::<0>();
11+
| ^^^^^^^^^
12+
|
13+
note: required by a bound in `test`
14+
--> $DIR/from-sig-fail.rs:4:35
15+
|
16+
LL | fn test<const N: usize>() -> [u8; N - 1] {
17+
| ^^^^^ required by this bound in `test`
18+
19+
error: failed to evaluate the given constant
20+
--> $DIR/from-sig-fail.rs:10:5
21+
|
22+
LL | test::<0>();
23+
| ^^^^^^^^^^^
24+
|
25+
note: required by a bound in `test`
26+
--> $DIR/from-sig-fail.rs:4:35
27+
|
28+
LL | fn test<const N: usize>() -> [u8; N - 1] {
29+
| ^^^^^ required by this bound in `test`
30+
31+
error: aborting due to 3 previous errors
832

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

src/test/ui/const-generics/generic_const_exprs/issue-62504.min.stderr

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ LL | ArrayHolder([0; Self::SIZE])
77
= note: expected array `[u32; X]`
88
found array `[u32; _]`
99

10-
error: constant expression depends on a generic parameter
10+
error: failed to evaluate the given constant
1111
--> $DIR/issue-62504.rs:18:25
1212
|
1313
LL | ArrayHolder([0; Self::SIZE])
1414
| ^^^^^^^^^^
15-
|
16-
= note: this may fail depending on what value the parameter takes
1715

1816
error: aborting due to 2 previous errors
1917

src/test/ui/const-generics/generic_const_exprs/issue-62504.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl<const X: usize> ArrayHolder<X> {
1818
ArrayHolder([0; Self::SIZE])
1919
//~^ ERROR mismatched types
2020
//[full]~^^ ERROR unconstrained generic constant
21-
//[min]~^^^ ERROR constant expression depends on a generic parameter
21+
//[min]~^^^ ERROR failed to evaluate
2222
}
2323
}
2424

src/test/ui/const-generics/generic_const_exprs/issue-80742.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ where
2929
fn main() {
3030
let dst = Inline::<dyn Debug>::new(0); //~ ERROR
3131
//~^ ERROR
32+
//~| ERROR failed to evaluate
3233
}

0 commit comments

Comments
 (0)