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.
1 parent 1cd97ca commit 23c4a46Copy full SHA for 23c4a46
src/test/ui/const-generics/min_const_generics/const_fn_in_generics.rs
@@ -0,0 +1,17 @@
1
+// run-pass
2
+
3
+#![feature(min_const_generics)]
4
5
+const fn identity<const T: u32>() -> u32 { T }
6
7
+#[derive(Eq, PartialEq, Debug)]
8
+pub struct ConstU32<const U: u32>;
9
10
+pub fn new() -> ConstU32<{ identity::<3>() }> {
11
+ ConstU32::<{ identity::<3>() }>
12
+}
13
14
+fn main() {
15
+ let v = new();
16
+ assert_eq!(v, ConstU32::<3>);
17
0 commit comments