File: feature-gate-pin_ergonomics.stderr

package info (click to toggle)
rustc-web 1.85.0%2Bdfsg3-1~deb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-proposed-updates
  • size: 1,759,988 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,056; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (72 lines) | stat: -rw-r--r-- 2,818 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
error[E0658]: pinned reference syntax is experimental
  --> $DIR/feature-gate-pin_ergonomics.rs:13:14
   |
LL |     let _y: &pin mut Foo = x;
   |              ^^^
   |
   = note: see issue #130494 <https://github.com/rust-lang/rust/issues/130494> for more information
   = help: add `#![feature(pin_ergonomics)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: pinned reference syntax is experimental
  --> $DIR/feature-gate-pin_ergonomics.rs:16:18
   |
LL | fn foo_sugar(_: &pin mut Foo) {}
   |                  ^^^
   |
   = note: see issue #130494 <https://github.com/rust-lang/rust/issues/130494> for more information
   = help: add `#![feature(pin_ergonomics)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: pinned reference syntax is experimental
  --> $DIR/feature-gate-pin_ergonomics.rs:28:18
   |
LL | fn baz_sugar(_: &pin const Foo) {}
   |                  ^^^
   |
   = note: see issue #130494 <https://github.com/rust-lang/rust/issues/130494> for more information
   = help: add `#![feature(pin_ergonomics)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0382]: use of moved value: `x`
  --> $DIR/feature-gate-pin_ergonomics.rs:20:9
   |
LL | fn bar(x: Pin<&mut Foo>) {
   |        - move occurs because `x` has type `Pin<&mut Foo>`, which does not implement the `Copy` trait
LL |     foo(x);
   |         - value moved here
LL |     foo(x);
   |         ^ value used here after move
   |
note: consider changing this parameter type in function `foo` to borrow instead if owning the value isn't necessary
  --> $DIR/feature-gate-pin_ergonomics.rs:12:11
   |
LL | fn foo(x: Pin<&mut Foo>) {
   |    ---    ^^^^^^^^^^^^^ this parameter takes ownership of the value
   |    |
   |    in this function

error[E0382]: use of moved value: `x`
  --> $DIR/feature-gate-pin_ergonomics.rs:25:5
   |
LL | fn baz(mut x: Pin<&mut Foo>) {
   |        ----- move occurs because `x` has type `Pin<&mut Foo>`, which does not implement the `Copy` trait
LL |     x.foo();
   |       ----- `x` moved due to this method call
LL |     x.foo();
   |     ^ value used here after move
   |
note: `Foo::foo` takes ownership of the receiver `self`, which moves `x`
  --> $DIR/feature-gate-pin_ergonomics.rs:8:12
   |
LL |     fn foo(self: Pin<&mut Self>) {
   |            ^^^^
help: consider reborrowing the `Pin` instead of moving it
   |
LL |     x.as_mut().foo();
   |      +++++++++

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0382, E0658.
For more information about an error, try `rustc --explain E0382`.