]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/type-dependent/auxiliary/type_dependent_lib.rs
1 #![cfg_attr(full, feature(const_generics))]
2 #![cfg_attr(full, allow(incomplete_features))]
3 #![cfg_attr(min, feature(min_const_generics))]
5 pub struct Struct
<const N
: usize>(());
7 impl<const N
: usize> Struct
<N
> {
12 pub fn same_ty
<const M
: usize>(&self) -> (usize, usize) {
16 pub fn different_ty
<const M
: u8>(&self) -> (usize, u8) {
20 pub fn containing_ty
<T
, const M
: u8>(&self) -> (usize, u8) {
21 (std
::mem
::size_of
::<T
>() + N
, M
)
24 pub fn we_have_to_go_deeper
<const M
: usize>(&self) -> Struct
<M
> {
30 fn foo
<const M
: usize>(&self) -> usize;
33 impl Foo
for Struct
<7> {
34 fn foo
<const M
: usize>(&self) -> usize {