#![feature(const_generics)] #![allow(incomplete_features)] #[derive(PartialEq, Eq)] enum CompileFlag { A, B, } pub fn test_1() {} pub fn test_2(x: T) {} pub struct Example{ x: T, } impl Example { const ASSOC_FLAG: CompileFlag = CompileFlag::A; } pub fn main() { test_1::(); //~^ ERROR: expected type, found variant //~| ERROR: wrong number of const arguments //~| ERROR: wrong number of type arguments test_2::<_, CompileFlag::A>(0); //~^ ERROR: expected type, found variant //~| ERROR: wrong number of const arguments //~| ERROR: wrong number of type arguments let _: Example = Example { x: 0 }; //~^ ERROR: expected type, found variant //~| ERROR: wrong number of const arguments //~| ERROR: wrong number of type arguments let _: Example = Example { x: 0 }; //~^ ERROR: wrong number of const arguments //~| ERROR: wrong number of type arguments }