]> git.lizzy.rs Git - rust.git/blob - src/test/ui/legacy-const-generics-bad.rs
Auto merge of #84589 - In-line:zircon-thread-name, r=JohnTitor
[rust.git] / src / test / ui / legacy-const-generics-bad.rs
1 // aux-build:legacy-const-generics.rs
2
3 extern crate legacy_const_generics;
4
5 fn 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
16 fn main() {}