os-rust/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs

18 lines
305 B
Rust
Raw Normal View History

2022-01-11 23:52:24 +08:00
#![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() {}