rust/tests/ui/mir/thir-constparam-temp.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
345 B
Rust
Raw Normal View History

// 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 }>()
}