rust/tests/ui/const-generics/try_unify_ignore_lifetimes.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
570 B
Rust
Raw Normal View History

2022-06-25 04:59:48 -05:00
// check-pass
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
struct Num<const N: usize>;
trait NumT {
const VALUE: usize;
}
impl<const N: usize> NumT for Num<N> {
const VALUE: usize = N;
}
struct Foo<'a, N: NumT>(&'a [u32; N::VALUE]) where [(); N::VALUE]:;
trait Bar {
type Size: NumT;
fn bar<'a>(foo: &Foo<'a, Self::Size>) where [(); Self::Size::VALUE]: {
todo!();
}
}
trait Baz<'a> {
type Size: NumT;
fn baz(foo: &Foo<'a, Self::Size>) where [(); Self::Size::VALUE]: {
todo!();
}
}
fn main() {}