]> git.proxmox.com Git - rustc.git/blame - src/test/ui/const-generics/issues/issue-61935.rs
New upstream version 1.49.0~beta.4+dfsg1
[rustc.git] / src / test / ui / const-generics / issues / issue-61935.rs
CommitLineData
1b1a35ee
XL
1// revisions: full min
2#![cfg_attr(full, feature(const_generics))]
3#![cfg_attr(full, allow(incomplete_features))]
4#![cfg_attr(min, feature(min_const_generics))]
f9f354fc
XL
5
6trait Foo {}
7
8impl<const N: usize> Foo for [(); N]
9 where
10 Self:FooImpl<{N==0}>
1b1a35ee 11//[full]~^ERROR constant expression depends on a generic parameter
29967ef6 12//[min]~^^ERROR generic parameters may not be used in const operations
f9f354fc
XL
13{}
14
15trait FooImpl<const IS_ZERO: bool>{}
16
17impl FooImpl<true> for [(); 0] {}
18
19impl<const N:usize> FooImpl<false> for [();N] {}
20
21fn foo(_: impl Foo) {}
22
23fn main() {
24 foo([]);
25 foo([()]);
26}