Skip to content

Commit d3de333

Browse files
committed
update all UI tests
1 parent cd25fdf commit d3de333

Some content is hidden

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

44 files changed

+211
-241
lines changed

tests/ui/closures/issue-52437.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ fn main() {
22
[(); &(&'static: loop { |x| {}; }) as *const _ as usize]
33
//~^ ERROR: invalid label name `'static`
44
//~| ERROR: type annotations needed
5+
//~| ERROR: mismatched types
56
}

tests/ui/closures/issue-52437.stderr

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ help: consider giving this closure parameter an explicit type
1515
LL | [(); &(&'static: loop { |x: /* Type */| {}; }) as *const _ as usize]
1616
| ++++++++++++
1717

18-
error: aborting due to 2 previous errors
18+
error[E0308]: mismatched types
19+
--> $DIR/issue-52437.rs:2:5
20+
|
21+
LL | fn main() {
22+
| - expected `()` because of default return type
23+
LL | [(); &(&'static: loop { |x| {}; }) as *const _ as usize]
24+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `[(); &(&'static: loop { |x| {}; }) as *const _ as usize]`
25+
26+
error: aborting due to 3 previous errors
1927

20-
For more information about this error, try `rustc --explain E0282`.
28+
Some errors have detailed explanations: E0282, E0308.
29+
For more information about an error, try `rustc --explain E0282`.

tests/ui/const-generics/bad-generic-in-copy-impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[derive(Copy, Clone)]
22
pub struct Foo {
33
x: [u8; SIZE],
4-
//~^ ERROR mismatched types
4+
//~^ ERROR the constant `1` is not of type `usize`
55
}
66

77
const SIZE: u32 = 1;
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
error[E0308]: mismatched types
2-
--> $DIR/bad-generic-in-copy-impl.rs:3:13
1+
error: the constant `1` is not of type `usize`
2+
--> $DIR/bad-generic-in-copy-impl.rs:3:8
33
|
44
LL | x: [u8; SIZE],
5-
| ^^^^ expected `usize`, found `u32`
5+
| ^^^^^^^^^^ expected `usize`, found `u32`
66

77
error: aborting due to previous error
88

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

tests/ui/const-generics/bad-subst-const-kind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ trait Q {
66
}
77

88
impl<const N: u64> Q for [u8; N] {
9-
//~^ ERROR mismatched types
9+
//~^ ERROR the constant `N` is not of type `usize`
1010
const ASSOC: usize = 1;
1111
}
1212

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
error[E0308]: mismatched types
2-
--> $DIR/bad-subst-const-kind.rs:8:31
1+
error: the constant `N` is not of type `usize`
2+
--> $DIR/bad-subst-const-kind.rs:8:26
33
|
44
LL | impl<const N: u64> Q for [u8; N] {
5-
| ^ expected `usize`, found `u64`
5+
| ^^^^^^^ expected `usize`, found `u64`
66

77
error: aborting due to previous error
88

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

tests/ui/const-generics/const-param-type-depends-on-const-param.min.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LL | pub struct SelfDependent<const N: [u8; N]>;
1414
|
1515
= note: const parameters may not be used in the type of const parameters
1616

17-
error: `[u8; N]` is forbidden as the type of a const generic parameter
17+
error: `[u8; [const error]]` is forbidden as the type of a const generic parameter
1818
--> $DIR/const-param-type-depends-on-const-param.rs:11:47
1919
|
2020
LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
@@ -23,7 +23,7 @@ LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
2323
= note: the only supported types are integers, `bool` and `char`
2424
= help: more complex types are supported with `#![feature(adt_const_params)]`
2525

26-
error: `[u8; N]` is forbidden as the type of a const generic parameter
26+
error: `[u8; [const error]]` is forbidden as the type of a const generic parameter
2727
--> $DIR/const-param-type-depends-on-const-param.rs:15:35
2828
|
2929
LL | pub struct SelfDependent<const N: [u8; N]>;

tests/ui/const-generics/const-param-type-depends-on-const-param.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
1212
//~^ ERROR: the type of const parameters must not depend on other generic parameters
13-
//[min]~^^ ERROR `[u8; N]` is forbidden
13+
//[min]~^^ ERROR `[u8; [const error]]` is forbidden
1414

1515
pub struct SelfDependent<const N: [u8; N]>;
1616
//~^ ERROR: the type of const parameters must not depend on other generic parameters
17-
//[min]~^^ ERROR `[u8; N]` is forbidden
17+
//[min]~^^ ERROR `[u8; [const error]]` is forbidden
1818

1919
fn main() {}

tests/ui/const-generics/issue-97007.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// check-pass
1+
// known-bug: unknown
2+
// this should pass but currently does not because `generic_const_exprs` is very prone
3+
// to randomly encountering cycle errors on well formed code.
24

35
#![feature(adt_const_params, generic_const_exprs)]
46
#![allow(incomplete_features)]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
error[E0391]: cycle detected when building an abstract representation for `lib::<impl at $DIR/issue-97007.rs:55:5: 55:81>::proceed_to::{constant#0}`
2+
--> $DIR/issue-97007.rs:58:25
3+
|
4+
LL | ) -> Walk<NEXT, { walk(REMAINING, CURRENT, NEXT) }> {
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
note: ...which requires building THIR for `lib::<impl at $DIR/issue-97007.rs:55:5: 55:81>::proceed_to::{constant#0}`...
8+
--> $DIR/issue-97007.rs:58:25
9+
|
10+
LL | ) -> Walk<NEXT, { walk(REMAINING, CURRENT, NEXT) }> {
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
note: ...which requires type-checking `lib::<impl at $DIR/issue-97007.rs:55:5: 55:81>::proceed_to::{constant#0}`...
13+
--> $DIR/issue-97007.rs:58:25
14+
|
15+
LL | ) -> Walk<NEXT, { walk(REMAINING, CURRENT, NEXT) }> {
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17+
= note: ...which again requires building an abstract representation for `lib::<impl at $DIR/issue-97007.rs:55:5: 55:81>::proceed_to::{constant#0}`, completing the cycle
18+
note: cycle used when checking that `lib::<impl at $DIR/issue-97007.rs:55:5: 55:81>::proceed_to` is well-formed
19+
--> $DIR/issue-97007.rs:56:9
20+
|
21+
LL | / pub fn proceed_to<const NEXT: usize>(
22+
LL | | self,
23+
LL | | ) -> Walk<NEXT, { walk(REMAINING, CURRENT, NEXT) }> {
24+
| |___________________________________________________________^
25+
26+
error: aborting due to previous error
27+
28+
For more information about this error, try `rustc --explain E0391`.

0 commit comments

Comments
 (0)