about summary refs log tree commit diff
path: root/tests/ui/traits/const-traits/predicate-entailment-passes.rs
blob: 28ae21891f386a2f1c2e930179fd4a80924e792e (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
//@ compile-flags: -Znext-solver
//@ check-pass

#![feature(const_trait_impl)]

#[const_trait] trait Bar {}
impl const Bar for () {}

#[const_trait] trait TildeConst {
    fn foo<T>() where T: ~const Bar;
}
impl TildeConst for () {
    fn foo<T>() where T: Bar {}
}


#[const_trait] trait AlwaysConst {
    fn foo<T>() where T: const Bar;
}
impl AlwaysConst for i32 {
    fn foo<T>() where T: Bar {}
}
impl const AlwaysConst for u32 {
    fn foo<T>() where T: ~const Bar {}
}

fn main() {}