#![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash struct Checked bool>; fn not_one(val: usize) -> bool { val != 1 } fn not_two(val: usize) -> bool { val != 2 } fn generic_arg(val: T) -> bool { true } fn generic(val: usize) -> bool { val != 1 } fn main() { let _: Option> = None; let _: Checked<{not_one}> = Checked::<{not_one}>; let _: Checked<{not_one}> = Checked::<{not_two}>; //~ mismatched types let _ = Checked::<{generic_arg}>; let _ = Checked::<{generic_arg::}>; let _ = Checked::<{generic_arg::}>; //~ mismatched types let _ = Checked::<{generic}>; //~ type annotations needed let _ = Checked::<{generic::}>; let _: Checked<{generic::}> = Checked::<{generic::}>; let _: Checked<{generic::}> = Checked::<{generic::}>; //~ mismatched types }