]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/const-expression-parameter.rs
pin docs: add some forward references
[rust.git] / src / test / ui / const-generics / const-expression-parameter.rs
1 #![feature(const_generics)]
2 //~^ WARN the feature `const_generics` is incomplete
3
4 fn i32_identity<const X: i32>() -> i32 {
5     5
6 }
7
8 fn foo_a() {
9     i32_identity::<-1>(); // ok
10 }
11
12 fn foo_b() {
13     i32_identity::<1 + 2>(); //~ ERROR expected one of `,` or `>`, found `+`
14 }
15
16 fn foo_c() {
17     i32_identity::< -1 >(); // ok
18 }
19
20 fn main() {
21     i32_identity::<5>(); // ok
22 }