]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/generic_const_exprs/dependence_lint.rs
2 // compile-flags: -Zdeduplicate-diagnostics=yes
4 #![cfg_attr(gce, feature(generic_const_exprs))]
5 #![allow(incomplete_features)]
10 [0; size_of
::<*mut T
>()]; // lint on stable, error with `generic_const_exprs`
11 //[gce]~^ ERROR unconstrained
12 //[full]~^^ WARNING cannot use constants
13 //[full]~| WARNING this was previously accepted
14 let _
: [u8; size_of
::<*mut T
>()]; // error on stable, error with gce
15 //[full]~^ ERROR generic parameters may not be used
16 //[gce]~^^ ERROR unconstrained generic
17 [0; if false { size_of::<T>() }
else { 3 }
]; // lint on stable, error with gce
18 //[gce]~^ ERROR overly complex
19 //[full]~^^ WARNING cannot use constants
20 //[full]~| WARNING this was previously accepted
21 let _
: [u8; if true { size_of::<T>() }
else { 3 }
]; // error on stable, error with gce
22 //[full]~^ ERROR generic parameters may not be used
23 //[gce]~^^ ERROR overly complex