rust/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
542 B
Rust
Raw Normal View History

// 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() {}