about summary refs log tree commit diff
path: root/tests/ui/reborrow/custom_mut.rs
blob: 1e7c46932382246a4474da31626b0c3f63bedb90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#![feature(reborrow)]
use std::ops::Reborrow;

struct CustomMut<'a, T>(&'a mut T);
impl<'a, T> Reborrow for CustomMut<'a, T> {}

fn method(a: CustomMut<'_, ()>) {}

fn main() {
    let a = CustomMut(&mut ());
    let _ = method(a);
    let _ = method(a); //~ERROR use of moved value: `a`
}