Files
rust/tests/ui/suggestions/ufcs-for-deref-inner-clone.fixed
T

17 lines
331 B
Rust

//@ run-rustfix
use std::ops::Deref;
struct MyBox<T>(T);
impl<T> Deref for MyBox<T> {
type Target = T;
fn deref(&self) -> &Self::Target {
&self.0
}
}
pub fn main() {
let _x = <Vec<i32> as Clone>::clone(&MyBox(vec![1, 2])).into_iter();
//~^ ERROR cannot move out of dereference of `MyBox<Vec<i32>>`
}