summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/raw-ptr-const-param.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/const-generics/raw-ptr-const-param.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/raw-ptr-const-param.rs b/src/test/ui/const-generics/raw-ptr-const-param.rs
new file mode 100644
index 000000000..27ef9e7d9
--- /dev/null
+++ b/src/test/ui/const-generics/raw-ptr-const-param.rs
@@ -0,0 +1,11 @@
+// revisions: full min
+
+#![cfg_attr(full, feature(adt_const_params))]
+#![cfg_attr(full, allow(incomplete_features))]
+
+struct Const<const P: *const u32>; //~ ERROR: using raw pointers as const generic parameters
+
+fn main() {
+ let _: Const<{ 15 as *const _ }> = Const::<{ 10 as *const _ }>;
+ let _: Const<{ 10 as *const _ }> = Const::<{ 10 as *const _ }>;
+}