rust/tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check-override.rs

20 lines
293 B
Rust
Raw Normal View History

2023-01-13 07:27:40 -06:00
// check-pass
#![feature(const_trait_impl, rustc_attrs)]
#[const_trait]
trait Foo {
#[rustc_do_not_const_check]
fn into_iter(&self) { println!("FEAR ME!") }
}
impl const Foo for () {
fn into_iter(&self) {
// ^_^
}
}
const _: () = Foo::into_iter(&());
fn main() {}