Add test
This commit is contained in:
parent
5a6273e263
commit
03ac7e0d0b
2 changed files with 23 additions and 0 deletions
|
@ -0,0 +1,9 @@
|
|||
#![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]`
|
||||
|
||||
fn main() {}
|
|
@ -0,0 +1,14 @@
|
|||
error: const `impl`s must be for traits marked with `#[const_trait]`
|
||||
--> $DIR/const-impl-requires-const-trait.rs:6:1
|
||||
|
|
||||
LL | impl const A for () {}
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: this trait must be annotated with `#[const_trait]`
|
||||
--> $DIR/const-impl-requires-const-trait.rs:3:1
|
||||
|
|
||||
LL | pub trait A {}
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Add table
Reference in a new issue