1
Fork 0
rust/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/spec-effectvar-ice.rs

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

23 lines
755 B
Rust
Raw Normal View History

//@ check-fail
// Fixes #119830
#![feature(effects)]
#![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]`
//~| error: the const parameter `host` is not constrained by the impl trait, self type, or predicates [E0207]
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: the const parameter `host` is not constrained by the impl trait, self type, or predicates [E0207]
2024-06-04 09:10:08 +01:00
//~| error: conflicting implementations of trait `Foo`
2024-06-04 09:10:08 +01:00
fn main() {}