diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/moves/suggest-clone.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/moves/suggest-clone.rs b/tests/ui/moves/suggest-clone.rs new file mode 100644 index 000000000..25dd9f006 --- /dev/null +++ b/tests/ui/moves/suggest-clone.rs @@ -0,0 +1,11 @@ +// run-rustfix + +#[derive(Clone)] +struct Foo; +impl Foo { + fn foo(self) {} +} +fn main() { + let foo = &Foo; + foo.foo(); //~ ERROR cannot move out +} |