mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
23 lines
346 B
Rust
23 lines
346 B
Rust
//@ build-pass
|
|
|
|
#![feature(adt_const_params)]
|
|
#![allow(incomplete_features)]
|
|
|
|
use std::marker::ConstParamTy;
|
|
|
|
#[derive(PartialEq, Eq, ConstParamTy)]
|
|
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 }>()
|
|
}
|