]> git.proxmox.com Git - rustc.git/blame - src/test/ui/legacy-const-generics-bad.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / legacy-const-generics-bad.rs
CommitLineData
6a06907d
XL
1// aux-build:legacy-const-generics.rs
2
3extern crate legacy_const_generics;
4
5fn foo<const N: usize>() {
6 let a = 1;
7 legacy_const_generics::foo(0, a, 2);
8 //~^ ERROR attempt to use a non-constant value in a constant
9
10 legacy_const_generics::foo(0, N, 2);
11
12 legacy_const_generics::foo(0, N + 1, 2);
13 //~^ ERROR generic parameters may not be used in const operations
14}
15
16fn main() {}