blob: dde8eea45257f12c1f8456c3cd7c7f8d57d38cf9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// run-pass
struct Uwu<const N: u32 = 1, const M: u32 = N>;
trait Trait {}
impl<const N: u32> Trait for Uwu<N> {}
fn rawr<const N: u32>() -> impl Trait {
Uwu::<N>
}
trait Traitor<const N: u8 = 1, const M: u8 = N> { }
impl<const N: u8> Traitor<N> for u32 {}
impl Traitor<1, 1> for u64 {}
fn uwu<const N: u8>() -> impl Traitor<N> {
1_u32
}
fn owo() -> impl Traitor {
1_u64
}
fn main() {
rawr::<3>();
rawr::<7>();
uwu::<{ u8::MAX }>();
owo();
}
|