rust/tests/ui/traits/const-traits/do-not-const-check-override.rs

22 lines
367 B
Rust
Raw Normal View History

//@ check-pass
2024-06-30 17:08:45 +00:00
//@ compile-flags: -Znext-solver
#![allow(incomplete_features)]
#![feature(const_trait_impl, rustc_attrs, effects)]
2023-01-13 13:27:40 +00:00
#[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() {}