]> git.proxmox.com Git - rustc.git/blame - src/test/ui/const-generics/issues/issue-68366.rs
New upstream version 1.49.0~beta.4+dfsg1
[rustc.git] / src / test / ui / const-generics / issues / issue-68366.rs
CommitLineData
1b1a35ee
XL
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
10struct Collatz<const N: Option<usize>>;
11
12impl <const N: usize> Collatz<{Some(N)}> {}
13//~^ ERROR the const parameter
29967ef6 14//[min]~^^ generic parameters may not be used in const operations
1b1a35ee
XL
15
16struct Foo;
17
18impl<const N: usize> Foo {}
19//~^ ERROR the const parameter
20
21fn main() {}