Files
rust/tests/ui/reborrow/custom_mut.rs

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

14 lines
290 B
Rust
Raw Normal View History

2025-08-30 21:16:56 +03:00
#![feature(reborrow)]
2025-09-27 01:11:01 +03:00
use std::ops::Reborrow;
2025-08-30 21:16:56 +03:00
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`
}