2022-09-13 22:18:14 -05:00
|
|
|
// Tests that `T: Foo` and `T: ~const Foo` are treated as equivalent for the
|
2022-03-24 19:24:40 -05:00
|
|
|
// purposes of min_specialization.
|
|
|
|
|
|
|
|
// check-pass
|
|
|
|
|
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
#![feature(min_specialization)]
|
|
|
|
#![feature(const_trait_impl)]
|
|
|
|
|
|
|
|
#[rustc_specialization_trait]
|
|
|
|
trait Specialize {}
|
|
|
|
|
2022-11-05 23:12:57 -05:00
|
|
|
#[const_trait]
|
2022-03-24 19:24:40 -05:00
|
|
|
trait Foo {}
|
|
|
|
|
2022-11-05 23:12:57 -05:00
|
|
|
#[const_trait]
|
2022-03-24 19:24:40 -05:00
|
|
|
trait Bar {}
|
|
|
|
|
2022-09-13 22:18:14 -05:00
|
|
|
impl<T> Bar for T
|
2022-03-24 19:24:40 -05:00
|
|
|
where
|
2022-09-13 22:18:14 -05:00
|
|
|
T: Foo,
|
2022-03-24 19:24:40 -05:00
|
|
|
{}
|
|
|
|
|
2022-09-13 22:18:14 -05:00
|
|
|
impl<T> const Bar for T
|
2022-03-24 19:24:40 -05:00
|
|
|
where
|
2022-09-13 22:18:14 -05:00
|
|
|
T: ~const Foo,
|
2022-03-24 19:24:40 -05:00
|
|
|
T: Specialize,
|
|
|
|
{}
|
|
|
|
|
|
|
|
fn main() {}
|