]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/issues/issue-68366.rs
Replace "non trivial" with "non-trivial"
[rust.git] / src / test / ui / const-generics / issues / issue-68366.rs
1 // Checks that const expressions have a useful note explaining why they can't be evaluated.
2 // The note should relate to the fact that it cannot be shown forall N that it maps 1-1 to a new
3 // type.
4
5 // revisions: full min
6 #![cfg_attr(full, feature(const_generics))]
7 #![cfg_attr(full, allow(incomplete_features))]
8 #![cfg_attr(min, feature(min_const_generics))]
9
10 struct Collatz<const N: Option<usize>>;
11
12 impl <const N: usize> Collatz<{Some(N)}> {}
13 //~^ ERROR the const parameter
14 //[min]~^^ generic parameters must not be used inside of non-trivial constant values
15
16 struct Foo;
17
18 impl<const N: usize> Foo {}
19 //~^ ERROR the const parameter
20
21 fn main() {}