rust/src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs

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

11 lines
286 B
Rust
Raw Normal View History

2022-08-28 04:17:12 +00:00
#![feature(const_trait_impl)]
pub trait A {}
//~^ NOTE: this trait must be annotated with `#[const_trait]`
impl const A for () {}
//~^ ERROR: const `impl`s must be for traits marked with `#[const_trait]`
//~| ERROR: ~const can only be applied to `#[const_trait]` traits
2022-08-28 04:17:12 +00:00
fn main() {}