about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/const-generics/generic_const_exprs/unknown-alias-defkind-anonconst-ice-116710.rs15
-rw-r--r--tests/ui/const-generics/generic_const_exprs/unknown-alias-defkind-anonconst-ice-116710.stderr19
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/ui/const-generics/generic_const_exprs/unknown-alias-defkind-anonconst-ice-116710.rs b/tests/ui/const-generics/generic_const_exprs/unknown-alias-defkind-anonconst-ice-116710.rs
new file mode 100644
index 00000000000..dd0b1e8c9f7
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/unknown-alias-defkind-anonconst-ice-116710.rs
@@ -0,0 +1,15 @@
+// ICE unknown alias DefKind: AnonConst
+// issue: rust-lang/rust#116710
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+struct A<const N: u32 = 1, const M: u32 = u8>;
+//~^ ERROR expected value, found builtin type `u8`
+
+trait Trait {}
+impl<const N: u32> Trait for A<N> {}
+
+impl<const N: u32> Trait for A<N> {}
+//~^ ERROR conflicting implementations of trait `Trait` for type `A<_>`
+
+pub fn main() {}
diff --git a/tests/ui/const-generics/generic_const_exprs/unknown-alias-defkind-anonconst-ice-116710.stderr b/tests/ui/const-generics/generic_const_exprs/unknown-alias-defkind-anonconst-ice-116710.stderr
new file mode 100644
index 00000000000..80ac96d4870
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/unknown-alias-defkind-anonconst-ice-116710.stderr
@@ -0,0 +1,19 @@
+error[E0423]: expected value, found builtin type `u8`
+  --> $DIR/unknown-alias-defkind-anonconst-ice-116710.rs:6:43
+   |
+LL | struct A<const N: u32 = 1, const M: u32 = u8>;
+   |                                           ^^ not a value
+
+error[E0119]: conflicting implementations of trait `Trait` for type `A<_>`
+  --> $DIR/unknown-alias-defkind-anonconst-ice-116710.rs:12:1
+   |
+LL | impl<const N: u32> Trait for A<N> {}
+   | --------------------------------- first implementation here
+LL |
+LL | impl<const N: u32> Trait for A<N> {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `A<_>`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0119, E0423.
+For more information about an error, try `rustc --explain E0119`.