mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
17 lines
331 B
Rust
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>>`
|
|
}
|