#![feature(adt_const_params)] #![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: unresolved item provided when a constant was expected test_2::<_, CompileFlag::A>(0); //~^ ERROR: expected type, found variant //~| ERROR: unresolved item provided when a constant was expected let _: Example = Example { x: 0 }; //~^ ERROR: expected type, found variant //~| ERROR: unresolved item provided when a constant was expected let _: Example = Example { x: 0 }; //~^ ERROR: type provided when a constant was expected }