4821b84b92
for example: ```rust struct Y(u32); // x's type is '& mut Y' and it is used in `fn generic<T>(x: T) {}`. fn generic<T>(x: T) {} ``` fixes #127285
18 lines
238 B
Rust
18 lines
238 B
Rust
//@ run-rustfix
|
|
|
|
#![allow(dead_code)]
|
|
|
|
struct X(u32);
|
|
|
|
impl X {
|
|
fn f(&mut self) {
|
|
generic(&mut *self);
|
|
self.0 += 1;
|
|
//~^ ERROR: use of moved value: `self` [E0382]
|
|
}
|
|
}
|
|
|
|
fn generic<T>(_x: T) {}
|
|
|
|
fn main() {}
|