Skip to content

Commit 64244b2

Browse files
committed
add test for the const_generics_defaults feature gate
1 parent ea8fa36 commit 64244b2

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
struct A<const N: usize = 3>;
2+
//~^ ERROR default values for const generic parameters are unstable
3+
4+
fn foo<const N: u8 = 6>() {}
5+
//~^ ERROR default values for const generic parameters are unstable
6+
7+
fn main() {}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error: default values for const generic parameters are unstable
2+
--> $DIR/feature-gate-const_generics_defaults.rs:1:27
3+
|
4+
LL | struct A<const N: usize = 3>;
5+
| ^
6+
|
7+
= help: add `#![feature(const_generics_defaults)]` to the crate attributes to enable
8+
9+
error: default values for const generic parameters are unstable
10+
--> $DIR/feature-gate-const_generics_defaults.rs:4:22
11+
|
12+
LL | fn foo<const N: u8 = 6>() {}
13+
| ^
14+
|
15+
= help: add `#![feature(const_generics_defaults)]` to the crate attributes to enable
16+
17+
error: aborting due to 2 previous errors
18+

0 commit comments

Comments
 (0)