Skip to content

Commit 03ac7e0

Browse files
committed
Add test
1 parent 5a6273e commit 03ac7e0

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![feature(const_trait_impl)]
2+
3+
pub trait A {}
4+
//~^ NOTE: this trait must be annotated with `#[const_trait]`
5+
6+
impl const A for () {}
7+
//~^ ERROR: const `impl`s must be for traits marked with `#[const_trait]`
8+
9+
fn main() {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: const `impl`s must be for traits marked with `#[const_trait]`
2+
--> $DIR/const-impl-requires-const-trait.rs:6:1
3+
|
4+
LL | impl const A for () {}
5+
| ^^^^^^^^^^^^^^^^^^^
6+
|
7+
note: this trait must be annotated with `#[const_trait]`
8+
--> $DIR/const-impl-requires-const-trait.rs:3:1
9+
|
10+
LL | pub trait A {}
11+
| ^^^^^^^^^^^
12+
13+
error: aborting due to previous error
14+

0 commit comments

Comments
 (0)