rust/tests/ui/traits/const-traits/effects/spec-effectvar-ice.rs
2024-11-03 18:59:31 +00:00

20 lines
569 B
Rust

// Fixes #119830
#![feature(min_specialization)]
#![feature(const_trait_impl)]
trait Specialize {}
trait Foo {}
impl<T> const Foo for T {}
//~^ error: const `impl` for trait `Foo` which is not marked with `#[const_trait]`
impl<T> const Foo for T where T: const Specialize {}
//~^ error: const `impl` for trait `Foo` which is not marked with `#[const_trait]`
//~| error: `const` can only be applied to `#[const_trait]` traits
//~| error: specialization impl does not specialize any associated items
//~| error: cannot specialize on trait `Specialize`
fn main() {}