Add test
This commit is contained in:
parent
7fd6ddfba2
commit
bf5130b502
2 changed files with 26 additions and 0 deletions
|
@ -0,0 +1,17 @@
|
|||
#![feature(const_fn_trait_bound)]
|
||||
#![feature(const_trait_impl)]
|
||||
|
||||
pub trait Tr {
|
||||
#[default_method_body_is_const]
|
||||
fn a(&self) {}
|
||||
|
||||
#[default_method_body_is_const]
|
||||
fn b(&self) {
|
||||
().a()
|
||||
//~^ ERROR calls in constant functions are limited
|
||||
}
|
||||
}
|
||||
|
||||
impl Tr for () {}
|
||||
|
||||
fn main() {}
|
|
@ -0,0 +1,9 @@
|
|||
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||
--> $DIR/default-method-body-is-const-same-trait-ck.rs:10:9
|
||||
|
|
||||
LL | ().a()
|
||||
| ^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0015`.
|
Loading…
Add table
Reference in a new issue