File tree 2 files changed +6
-25
lines changed
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>) {
15
15
fn bar ( mut x : Pin < & mut Foo > ) {
16
16
foo ( x) ;
17
17
foo ( x) ; //~ ERROR use of moved value: `x`
18
+ }
18
19
19
- x. foo ( ) ; //~ ERROR use of moved value: `x`
20
+ fn baz ( mut x : Pin < & mut Foo > ) {
21
+ x. foo ( ) ;
20
22
x. foo ( ) ; //~ ERROR use of moved value: `x`
21
23
}
22
24
Original file line number Diff line number Diff line change @@ -17,31 +17,10 @@ LL | fn foo(_: Pin<&mut Foo>) {
17
17
| in this function
18
18
19
19
error[E0382]: use of moved value: `x`
20
- --> $DIR/feature-gate-pin_ergonomics.rs:19 :5
20
+ --> $DIR/feature-gate-pin_ergonomics.rs:22 :5
21
21
|
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>) {
43
23
| ----- move occurs because `x` has type `Pin<&mut Foo>`, which does not implement the `Copy` trait
44
- ...
45
24
LL | x.foo();
46
25
| ----- `x` moved due to this method call
47
26
LL | x.foo();
@@ -57,6 +36,6 @@ help: consider reborrowing the `Pin` instead of moving it
57
36
LL | x.as_mut().foo();
58
37
| +++++++++
59
38
60
- error: aborting due to 3 previous errors
39
+ error: aborting due to 2 previous errors
61
40
62
41
For more information about this error, try `rustc --explain E0382`.
You can’t perform that action at this time.
0 commit comments