rust/tests/ui/traits/const-traits/dont-observe-host.rs
Michael Goulet 25c9253379 Add tests
2024-10-24 09:46:36 +00:00

24 lines
358 B
Rust

//@ compile-flags: -Znext-solver
//@ check-pass
#![feature(const_trait_impl, effects)]
//~^ WARN the feature `effects` is incomplete
#[const_trait]
trait Trait {
fn method() {}
}
impl const Trait for () {}
fn main() {
let mut x = const {
let x = <()>::method;
x();
x
};
let y = <()>::method;
y();
x = y;
}