summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/min_const_generics/const_fn_in_generics.rs
blob: 0c10af6c43f560527c125a22d34d79ea59a44b05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// run-pass

const fn identity<const T: u32>() -> u32 { T }

#[derive(Eq, PartialEq, Debug)]
pub struct ConstU32<const U: u32>;

pub fn new() -> ConstU32<{ identity::<3>() }> {
  ConstU32::<{ identity::<3>() }>
}

fn main() {
  let v = new();
  assert_eq!(v, ConstU32::<3>);
}