//@ run-rustfix #![allow(unused_mut)] use std::borrow::{Borrow, BorrowMut}; use std::convert::{AsMut, AsRef}; struct Bar; impl AsRef for Bar { fn as_ref(&self) -> &Bar { self } } impl AsMut for Bar { fn as_mut(&mut self) -> &mut Bar { self } } fn foo>(_: T) {} fn qux>(_: T) {} fn bat>(_: T) {} fn baz>(_: T) {} pub fn main() { let bar = Bar; foo(bar); let _baa = bar; //~ ERROR use of moved value let mut bar = Bar; qux(bar); let _baa = bar; //~ ERROR use of moved value let bar = Bar; bat(bar); let _baa = bar; //~ ERROR use of moved value let mut bar = Bar; baz(bar); let _baa = bar; //~ ERROR use of moved value }