diff --git a/src/test/ui/const-generics/min_const_generics/const_fn_in_generics.rs b/src/test/ui/const-generics/min_const_generics/const_fn_in_generics.rs new file mode 100644 index 0000000000000..3370666cc5cd0 --- /dev/null +++ b/src/test/ui/const-generics/min_const_generics/const_fn_in_generics.rs @@ -0,0 +1,17 @@ +// run-pass + +#![feature(min_const_generics)] + +const fn identity() -> u32 { T } + +#[derive(Eq, PartialEq, Debug)] +pub struct ConstU32; + +pub fn new() -> ConstU32<{ identity::<3>() }> { + ConstU32::<{ identity::<3>() }> +} + +fn main() { + let v = new(); + assert_eq!(v, ConstU32::<3>); +}