Skip to content

Commit 53c0bab

Browse files
committed
update tests
1 parent 74b2918 commit 53c0bab

Some content is hidden

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

50 files changed

+277
-455
lines changed

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

-20
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

-20
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

-20
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

-20
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

-12
This file was deleted.

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

-20
This file was deleted.

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

-17
This file was deleted.

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

-17
This file was deleted.
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

+7-1
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

+1
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

+10-4
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

+2
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

+25-1
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-80742.rs

+1
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
}

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

+24-23
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
error[E0080]: evaluation of `Inline::<dyn std::fmt::Debug>::{constant#0}` failed
2-
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
3-
|
4-
LL | intrinsics::size_of::<T>()
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
6-
| |
7-
| size_of called on unsized type `dyn Debug`
8-
| inside `std::mem::size_of::<dyn Debug>` at $SRC_DIR/core/src/mem/mod.rs:LL:COL
9-
|
10-
::: $DIR/issue-80742.rs:22:10
11-
|
12-
LL | [u8; size_of::<T>() + 1]: ,
13-
| -------------- inside `Inline::<dyn Debug>::{constant#0}` at $DIR/issue-80742.rs:22:10
14-
151
error[E0599]: the function or associated item `new` exists for struct `Inline<dyn Debug>`, but its trait bounds were not satisfied
162
--> $DIR/issue-80742.rs:30:36
173
|
@@ -35,6 +21,23 @@ LL | pub trait Debug {
3521
= note: the following trait bounds were not satisfied:
3622
`dyn Debug: Sized`
3723

24+
error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time
25+
--> $DIR/issue-80742.rs:30:15
26+
|
27+
LL | let dst = Inline::<dyn Debug>::new(0);
28+
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
29+
|
30+
= help: the trait `Sized` is not implemented for `dyn Debug`
31+
note: required by a bound in `Inline`
32+
--> $DIR/issue-80742.rs:12:15
33+
|
34+
LL | struct Inline<T>
35+
| ^ required by this bound in `Inline`
36+
help: consider relaxing the implicit `Sized` restriction
37+
|
38+
LL | struct Inline<T: ?Sized>
39+
| ++++++++
40+
3841
error[E0080]: evaluation of `Inline::<dyn std::fmt::Debug>::{constant#0}` failed
3942
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
4043
|
@@ -49,22 +52,20 @@ LL | intrinsics::size_of::<T>()
4952
LL | [u8; size_of::<T>() + 1]: ,
5053
| -------------- inside `Inline::<dyn Debug>::{constant#0}` at $DIR/issue-80742.rs:14:10
5154

52-
error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time
55+
error: failed to evaluate the given constant
5356
--> $DIR/issue-80742.rs:30:15
5457
|
5558
LL | let dst = Inline::<dyn Debug>::new(0);
56-
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
59+
| ^^^^^^^^^^^^^^^^^^^
5760
|
58-
= help: the trait `Sized` is not implemented for `dyn Debug`
5961
note: required by a bound in `Inline`
60-
--> $DIR/issue-80742.rs:12:15
62+
--> $DIR/issue-80742.rs:14:10
6163
|
6264
LL | struct Inline<T>
63-
| ^ required by this bound in `Inline`
64-
help: consider relaxing the implicit `Sized` restriction
65-
|
66-
LL | struct Inline<T: ?Sized>
67-
| ++++++++
65+
| ------ required by a bound in this
66+
LL | where
67+
LL | [u8; size_of::<T>() + 1]: ,
68+
| ^^^^^^^^^^^^^^^^^^ required by this bound in `Inline`
6869

6970
error: aborting due to 4 previous errors
7071

0 commit comments

Comments
 (0)