mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
21 lines
520 B
Rust
21 lines
520 B
Rust
//@ known-bug: #121858
|
|
#![allow(named_arguments_used_positionally)]
|
|
#![feature(generic_const_exprs)]
|
|
struct Inner<const N: usize, const M: usize>;
|
|
impl<const N: usize, const M: usize> Inner<N, M> where [(); N + M]: {
|
|
fn i() -> Self {
|
|
Self
|
|
}
|
|
}
|
|
|
|
struct Outer<const A: i64, const B: usize>(Inner<A, { B * 2 }>) where [(); A + (B * 2)]:;
|
|
impl<const A: usize, const B: usize> Outer<A, B> where [(); A + (B * 2)]: {
|
|
fn o() -> Union {
|
|
Self(Inner::i())
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
Outer::<1, 1>::o();
|
|
}
|