Skip to content

Commit 34e95b1

Browse files
committed
Update these test cases.
1 parent d3c78d4 commit 34e95b1

4 files changed

Lines changed: 26 additions & 15 deletions

File tree

tests/ui/const-generics/mgca/unbraced_const_block_const_arg_gated.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ fn generic<const N: usize>() {
3333
const NON_TYPE_CONST: usize = const { 1 };
3434

3535

36-
type const TYPE_CONST: usize =
37-
//~^ ERROR: top-level `type const` are unstable [E0658]
38-
const { 1 };
39-
//~^ ERROR: unbraced const blocks as const args are experimental
36+
type const TYPE_CONST: usize = const { 1 };
37+
//~^ ERROR: `type const` syntax is experimental [E0658]
38+
//~| ERROR: top-level `type const` are unstable [E0658]
39+
//~| ERROR: unbraced const blocks as const args are experimental
4040

4141
static STATIC: usize = const { 1 };
4242

tests/ui/const-generics/mgca/unbraced_const_block_const_arg_gated.stderr

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,35 @@ LL | generic::<const { 1 }>();
4949
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
5050

5151
error[E0658]: unbraced const blocks as const args are experimental
52-
--> $DIR/unbraced_const_block_const_arg_gated.rs:38:1
52+
--> $DIR/unbraced_const_block_const_arg_gated.rs:36:32
5353
|
54-
LL | const { 1 };
55-
| ^^^^^^^^^^^
54+
LL | type const TYPE_CONST: usize = const { 1 };
55+
| ^^^^^^^^^^^
5656
|
5757
= note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
5858
= help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable
5959
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
6060

61+
error[E0658]: `type const` syntax is experimental
62+
--> $DIR/unbraced_const_block_const_arg_gated.rs:36:1
63+
|
64+
LL | type const TYPE_CONST: usize = const { 1 };
65+
| ^^^^^^^^^^
66+
|
67+
= note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
68+
= help: add `#![feature(mgca_type_const_syntax)]` to the crate attributes to enable
69+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
70+
6171
error[E0658]: top-level `type const` are unstable
6272
--> $DIR/unbraced_const_block_const_arg_gated.rs:36:1
6373
|
64-
LL | / type const TYPE_CONST: usize =
65-
LL | |
66-
LL | | const { 1 };
67-
| |____________^
74+
LL | type const TYPE_CONST: usize = const { 1 };
75+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6876
|
6977
= note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
7078
= help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable
7179
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
7280

73-
error: aborting due to 7 previous errors
81+
error: aborting due to 8 previous errors
7482

7583
For more information about this error, try `rustc --explain E0658`.

tests/ui/const-generics/type-relative-path-144547.min.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: generic parameters may not be used in const operations
2-
--> $DIR/type-relative-path-144547.rs:37:35
2+
--> $DIR/type-relative-path-144547.rs:40:35
33
|
44
LL | type SupportedArray<T> = [T; <Self::InfoType as LevelInfo>::SUPPORTED_SLOTS];
55
| ^^^^^^^^^^^^^^

tests/ui/const-generics/type-relative-path-144547.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
//@ revisions: min mgca
44
//@[mgca] check-pass
5-
5+
#![allow(incomplete_features)]
6+
#![feature(mgca_type_const_syntax)]
67
#![cfg_attr(mgca, feature(min_generic_const_args))]
7-
#![cfg_attr(mgca, expect(incomplete_features))]
8+
// FIXME(mgca) syntax is it's own feature flag before
9+
// expansion and is also an incomplete feature.
10+
//#![cfg_attr(mgca, expect(incomplete_features))]
811

912
trait UnderlyingImpl<const MAX_SIZE: usize> {
1013
type InfoType: LevelInfo;

0 commit comments

Comments
 (0)