about summary refs log tree commit diff
path: root/tests/ui/mir/thir-constparam-temp.rs
blob: 4ef73f35f8768ce8e1bf4979deec16ce0abb199c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//@ 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 }>()
}