about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/ui/const-generics/adt_const_params/opaque_type_with_non-universal_region_substs_ice-111911.rs13
-rw-r--r--tests/ui/const-generics/adt_const_params/opaque_type_with_non-universal_region_substs_ice-111911.stderr16
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/ui/const-generics/adt_const_params/opaque_type_with_non-universal_region_substs_ice-111911.rs b/tests/ui/const-generics/adt_const_params/opaque_type_with_non-universal_region_substs_ice-111911.rs
new file mode 100644
index 00000000000..05bd0d91168
--- /dev/null
+++ b/tests/ui/const-generics/adt_const_params/opaque_type_with_non-universal_region_substs_ice-111911.rs
@@ -0,0 +1,13 @@
+//@ edition:2021
+// issues rust-lang/rust#111911
+// test for ICE opaque type with non-universal region substs
+
+#![feature(adt_const_params)]
+#![allow(incomplete_features)]
+
+pub async fn foo<const X: &'static str>() {}
+//~^ ERROR const parameter `X` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+//~| ERROR const parameter `X` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+fn bar<const N: &'static u8>() -> impl Sized {}
+
+pub fn main() {}
diff --git a/tests/ui/const-generics/adt_const_params/opaque_type_with_non-universal_region_substs_ice-111911.stderr b/tests/ui/const-generics/adt_const_params/opaque_type_with_non-universal_region_substs_ice-111911.stderr
new file mode 100644
index 00000000000..1bdb9cd9501
--- /dev/null
+++ b/tests/ui/const-generics/adt_const_params/opaque_type_with_non-universal_region_substs_ice-111911.stderr
@@ -0,0 +1,16 @@
+error: const parameter `X` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+  --> $DIR/opaque_type_with_non-universal_region_substs_ice-111911.rs:8:43
+   |
+LL | pub async fn foo<const X: &'static str>() {}
+   |                                           ^^
+
+error: const parameter `X` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+  --> $DIR/opaque_type_with_non-universal_region_substs_ice-111911.rs:8:43
+   |
+LL | pub async fn foo<const X: &'static str>() {}
+   |                                           ^^
+   |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
+error: aborting due to 2 previous errors
+