File tree Expand file tree Collapse file tree 2 files changed +6
-25
lines changed Expand file tree Collapse file tree 2 files changed +6
-25
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,10 @@ fn foo(_: Pin<&mut Foo>) {
1515fn bar ( mut x : Pin < & mut Foo > ) {
1616 foo ( x) ;
1717 foo ( x) ; //~ ERROR use of moved value: `x`
18+ }
1819
19- x. foo ( ) ; //~ ERROR use of moved value: `x`
20+ fn baz ( mut x : Pin < & mut Foo > ) {
21+ x. foo ( ) ;
2022 x. foo ( ) ; //~ ERROR use of moved value: `x`
2123}
2224
Original file line number Diff line number Diff line change @@ -17,31 +17,10 @@ LL | fn foo(_: Pin<&mut Foo>) {
1717 | in this function
1818
1919error[E0382]: use of moved value: `x`
20- --> $DIR/feature-gate-pin_ergonomics.rs:19 :5
20+ --> $DIR/feature-gate-pin_ergonomics.rs:22 :5
2121 |
22- LL | fn bar(mut x: Pin<&mut Foo>) {
23- | ----- move occurs because `x` has type `Pin<&mut Foo>`, which does not implement the `Copy` trait
24- LL | foo(x);
25- LL | foo(x);
26- | - value moved here
27- LL |
28- LL | x.foo();
29- | ^ value used here after move
30- |
31- note: consider changing this parameter type in function `foo` to borrow instead if owning the value isn't necessary
32- --> $DIR/feature-gate-pin_ergonomics.rs:12:11
33- |
34- LL | fn foo(_: Pin<&mut Foo>) {
35- | --- ^^^^^^^^^^^^^ this parameter takes ownership of the value
36- | |
37- | in this function
38-
39- error[E0382]: use of moved value: `x`
40- --> $DIR/feature-gate-pin_ergonomics.rs:20:5
41- |
42- LL | fn bar(mut x: Pin<&mut Foo>) {
22+ LL | fn baz(mut x: Pin<&mut Foo>) {
4323 | ----- move occurs because `x` has type `Pin<&mut Foo>`, which does not implement the `Copy` trait
44- ...
4524LL | x.foo();
4625 | ----- `x` moved due to this method call
4726LL | x.foo();
@@ -57,6 +36,6 @@ help: consider reborrowing the `Pin` instead of moving it
5736LL | x.as_mut().foo();
5837 | +++++++++
5938
60- error: aborting due to 3 previous errors
39+ error: aborting due to 2 previous errors
6140
6241For more information about this error, try `rustc --explain E0382`.
You can’t perform that action at this time.
0 commit comments