We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c4c6340 + 4fd70e4 commit 6789540Copy full SHA for 6789540
src/test/ui/const-generics/trait-const-args.rs
@@ -0,0 +1,29 @@
1
+// check-pass
2
+#![allow(incomplete_features)]
3
+#![feature(const_generics)]
4
+
5
+struct Const<const N: usize>;
6
+trait Foo<const N: usize> {}
7
8
+impl<const N: usize> Foo<N> for Const<N> {}
9
10
+fn foo_impl(_: impl Foo<3>) {}
11
12
+fn foo_explicit<T: Foo<3>>(_: T) {}
13
14
+fn foo_where<T>(_: T)
15
+where
16
+ T: Foo<3>,
17
+{
18
+}
19
20
+fn main() {
21
+ foo_impl(Const);
22
+ foo_impl(Const::<3>);
23
24
+ foo_explicit(Const);
25
+ foo_explicit(Const::<3>);
26
27
+ foo_where(Const);
28
+ foo_where(Const::<3>);
29
0 commit comments