rust/tests/ui/traits/const-traits/dont-observe-host.rs
2024-11-03 18:59:31 +00:00

23 lines
303 B
Rust

//@ compile-flags: -Znext-solver
//@ check-pass
#![feature(const_trait_impl)]
#[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;
}