]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/const-generics/diagnostics.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / const-generics / diagnostics.rs
diff --git a/src/test/ui/const-generics/diagnostics.rs b/src/test/ui/const-generics/diagnostics.rs
new file mode 100644 (file)
index 0000000..1581af5
--- /dev/null
@@ -0,0 +1,18 @@
+#![crate_type="lib"]
+#![feature(min_const_generics)]
+#![allow(incomplete_features)]
+
+struct A<const N: u8>;
+trait Foo {}
+impl Foo for A<N> {}
+//~^ ERROR cannot find type
+//~| unresolved item provided when a constant
+
+struct B<const N: u8>;
+impl<N> Foo for B<N> {}
+//~^ ERROR type provided when a constant
+
+struct C<const C: u8, const N: u8>;
+impl<const N: u8> Foo for C<N, T> {}
+//~^ ERROR cannot find type
+//~| unresolved item provided when a constant