Skip to content

Commit d3c78d4

Browse files
committed
update feature gate test
1 parent 82c716e commit d3c78d4

2 files changed

Lines changed: 41 additions & 13 deletions

File tree

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
#![allow(incomplete_features)]
2-
#![feature(min_generic_const_args)]
3-
41
type const FOO: u8 = 10;
5-
//~^ ERROR `type const` syntax is experimental [E0658]
2+
//~^ ERROR `type const` syntax is experimental [E0658]
3+
//~| ERROR top-level `type const` are unstable [E0658]
64

75
trait Bar {
86
type const BAR: bool;
9-
//~^ ERROR `type const` syntax is experimental [E0658]
7+
//~^ ERROR `type const` syntax is experimental [E0658]
8+
//~| ERROR associated `type const` are unstable [E0658]
109
}
1110

1211
impl Bar for bool {
1312
type const BAR: bool = false;
14-
//~^ ERROR `type const` syntax is experimental [E0658]
13+
//~^ ERROR `type const` syntax is experimental [E0658]
14+
//~| ERROR associated `type const` are unstable [E0658]
1515
}
1616

17-
fn main() {
18-
19-
}
17+
fn main() { }

tests/ui/feature-gates/feature-gate-mgca-type-const-syntax.stderr

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: `type const` syntax is experimental
2-
--> $DIR/feature-gate-mgca-type-const-syntax.rs:5:1
2+
--> $DIR/feature-gate-mgca-type-const-syntax.rs:1:1
33
|
44
LL | type const FOO: u8 = 10;
55
| ^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | type const FOO: u8 = 10;
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010

1111
error[E0658]: `type const` syntax is experimental
12-
--> $DIR/feature-gate-mgca-type-const-syntax.rs:9:5
12+
--> $DIR/feature-gate-mgca-type-const-syntax.rs:6:5
1313
|
1414
LL | type const BAR: bool;
1515
| ^^^^^^^^^^
@@ -19,7 +19,7 @@ LL | type const BAR: bool;
1919
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2020

2121
error[E0658]: `type const` syntax is experimental
22-
--> $DIR/feature-gate-mgca-type-const-syntax.rs:14:5
22+
--> $DIR/feature-gate-mgca-type-const-syntax.rs:12:5
2323
|
2424
LL | type const BAR: bool = false;
2525
| ^^^^^^^^^^
@@ -28,6 +28,36 @@ LL | type const BAR: bool = false;
2828
= help: add `#![feature(mgca_type_const_syntax)]` to the crate attributes to enable
2929
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3030

31-
error: aborting due to 3 previous errors
31+
error[E0658]: top-level `type const` are unstable
32+
--> $DIR/feature-gate-mgca-type-const-syntax.rs:1:1
33+
|
34+
LL | type const FOO: u8 = 10;
35+
| ^^^^^^^^^^^^^^^^^^^^^^^^
36+
|
37+
= note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
38+
= help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable
39+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
40+
41+
error[E0658]: associated `type const` are unstable
42+
--> $DIR/feature-gate-mgca-type-const-syntax.rs:6:5
43+
|
44+
LL | type const BAR: bool;
45+
| ^^^^^^^^^^^^^^^^^^^^^
46+
|
47+
= note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
48+
= help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable
49+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
50+
51+
error[E0658]: associated `type const` are unstable
52+
--> $DIR/feature-gate-mgca-type-const-syntax.rs:12:5
53+
|
54+
LL | type const BAR: bool = false;
55+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56+
|
57+
= note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
58+
= help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable
59+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
60+
61+
error: aborting due to 6 previous errors
3262

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

0 commit comments

Comments
 (0)