rust/tests/ui/moves/pin-mut-reborrow-infer-var-issue-107419.fixed
Nilstrieb 832751fe1d Also erase substs for new infcx in pin move error
The code originally correctly erased the regions of the type it passed
to the newly created infcx. But after the `fn_sig` query was made to
return an `EarlyBinder<T>`, some substs that were around were
substituted there without erasing their regions. They were then passed
into the newly cerated infcx, which caused the ICE.
2023-01-28 20:43:16 +01:00

12 lines
212 B
Rust

// run-rustfix
use std::pin::Pin;
fn foo(_: &mut ()) {}
fn main() {
let mut uwu = ();
let mut r = Pin::new(&mut uwu);
foo(r.as_mut().get_mut());
foo(r.get_mut()); //~ ERROR use of moved value
}