summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs
blob: 9c2c2cf1610a296465a9c1156b50e282cb871ae7 (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
30
31
32
33
34
35
36
37
// Tests that `~const` trait bounds can be used to specialize const trait impls.

// check-pass

#![feature(const_trait_impl)]
#![feature(rustc_attrs)]
#![feature(min_specialization)]

#[const_trait]
#[rustc_specialization_trait]
trait Specialize {}

#[const_trait]
trait Foo {}

impl<T> const Foo for T {}

impl<T> const Foo for T
where
    T: ~const Specialize,
{}

#[const_trait]
trait Bar {}

impl<T> const Bar for T
where
    T: ~const Foo,
{}

impl<T> const Bar for T
where
    T: ~const Foo,
    T: ~const Specialize,
{}

fn main() {}