]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/const-param-elided-lifetime.rs
Forbid elided lifetimes within const generic parameter types.
[rust.git] / src / test / ui / const-generics / const-param-elided-lifetime.rs
1 #![feature(const_generics)]
2 //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
3
4 struct A<const N: &u8>;
5 //~^ ERROR `&` without an explicit lifetime name cannot be used here
6 trait B {}
7
8 impl<const N: &u8> A<N> { //~ ERROR `&` without an explicit lifetime name cannot be used here
9     fn foo<const M: &u8>(&self) {}
10     //~^ ERROR `&` without an explicit lifetime name cannot be used here
11 }
12
13 impl<const N: &u8> B for A<N> {}
14 //~^ ERROR `&` without an explicit lifetime name cannot be used here
15
16 fn bar<const N: &u8>() {}
17 //~^ ERROR `&` without an explicit lifetime name cannot be used here
18
19 fn main() {}