rust/tests/ui/mir/thir-constparam-temp.rs
2023-01-11 09:32:08 +00:00

21 lines
299 B
Rust

// build-pass
#![feature(adt_const_params)]
#![allow(incomplete_features)]
#[derive(PartialEq, Eq)]
struct Yikes;
impl Yikes {
fn mut_self(&mut self) {}
}
fn foo<const YIKES: Yikes>() {
YIKES.mut_self()
//~^ WARNING taking a mutable reference
}
fn main() {
foo::<{ Yikes }>()
}