Skip to content

Commit 5576c5f

Browse files
committed
add adt_expr_unit_enum_extra-field test
1 parent 84b803e commit 5576c5f

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![feature(min_generic_const_args, adt_const_params)]
2+
3+
#[derive(Eq, PartialEq, std::marker::ConstParamTy)]
4+
enum E {
5+
S {}
6+
}
7+
8+
fn foo<const N: E>() {}
9+
10+
fn main() {
11+
E::S { x: const { 1 } };
12+
//~^ ERROR variant `E::S` has no field named `x` [E0559]
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0559]: variant `E::S` has no field named `x`
2+
--> $DIR/adt_expr_unit_enum_extra_field.rs:11:12
3+
|
4+
LL | E::S { x: const { 1 } };
5+
| ^ `E::S` does not have this field
6+
|
7+
= note: all struct fields are already assigned
8+
9+
error: aborting due to 1 previous error
10+
11+
For more information about this error, try `rustc --explain E0559`.

0 commit comments

Comments
 (0)