2022-03-23 02:54:07 -05:00
|
|
|
//@ build-pass
|
|
|
|
|
|
|
|
#![feature(adt_const_params)]
|
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
2023-05-16 23:05:46 -05:00
|
|
|
use std::marker::ConstParamTy;
|
|
|
|
|
|
|
|
#[derive(PartialEq, Eq, ConstParamTy)]
|
2022-03-23 02:54:07 -05:00
|
|
|
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 }>()
|
|
|
|
}
|