1 // This tests feature gates for const impls in the standard library.
3 // revisions: stock gated
6 #![cfg_attr(gated, feature(const_trait_impl, const_default_impls))]
8 fn non_const_context() -> Vec<usize> {
12 const fn const_context() -> Vec<usize> {
14 //[stock]~^ ERROR cannot call non-const fn
18 const VAL: Vec<usize> = const_context();
20 assert_eq!(VAL, non_const_context());