Skip to content

Commit b976142

Browse files
committed
add test for ice: unknown alias DefKind: AnonConst rust-lang#116710
Fixes rust-lang#116710
1 parent 7c43bc0 commit b976142

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// ICE unknown alias DefKind: AnonConst
2+
// issue: rust-lang/rust#116710
3+
#![feature(generic_const_exprs)]
4+
#![allow(incomplete_features)]
5+
6+
struct A<const N: u32 = 1, const M: u32 = u8>;
7+
//~^ ERROR expected value, found builtin type `u8`
8+
9+
trait Trait {}
10+
impl<const N: u32> Trait for A<N> {}
11+
12+
impl<const N: u32> Trait for A<N> {}
13+
//~^ ERROR conflicting implementations of trait `Trait` for type `A<_>`
14+
15+
pub fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0423]: expected value, found builtin type `u8`
2+
--> $DIR/unknown-alias-defkind-anonconst-ice-116710.rs:6:43
3+
|
4+
LL | struct A<const N: u32 = 1, const M: u32 = u8>;
5+
| ^^ not a value
6+
7+
error[E0119]: conflicting implementations of trait `Trait` for type `A<_>`
8+
--> $DIR/unknown-alias-defkind-anonconst-ice-116710.rs:12:1
9+
|
10+
LL | impl<const N: u32> Trait for A<N> {}
11+
| --------------------------------- first implementation here
12+
LL |
13+
LL | impl<const N: u32> Trait for A<N> {}
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `A<_>`
15+
16+
error: aborting due to 2 previous errors
17+
18+
Some errors have detailed explanations: E0119, E0423.
19+
For more information about an error, try `rustc --explain E0119`.

0 commit comments

Comments
 (0)