1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
// 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 }>() }