File: unboxed-closures-type-mismatch-closure-from-another-scope.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 893,396 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,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (44 lines) | stat: -rw-r--r-- 1,556 bytes parent folder | download | duplicates (3)
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
error[E0425]: cannot find value `x` in this scope
  --> $DIR/unboxed-closures-type-mismatch-closure-from-another-scope.rs:2:21
   |
LL |     let x = match **x {
   |                     ^ not found in this scope

error[E0425]: cannot find value `y` in this scope
  --> $DIR/unboxed-closures-type-mismatch-closure-from-another-scope.rs:9:26
   |
LL |         closure(&mut p, &y);
   |                          ^ help: a local variable with a similar name exists: `p`

error[E0308]: mismatched types
  --> $DIR/unboxed-closures-type-mismatch-closure-from-another-scope.rs:9:17
   |
LL |         closure(&mut p, &y);
   |         ------- ^^^^^^ expected `&mut &i32`, found `&mut &()`
   |         |
   |         arguments to this function are incorrect
   |
   = note: expected mutable reference `&mut &i32`
              found mutable reference `&mut &()`
note: closure parameter defined here
  --> $DIR/unboxed-closures-type-mismatch-closure-from-another-scope.rs:8:39
   |
LL |         let mut closure = expect_sig(|p, y| *p = y);
   |                                       ^

error[E0423]: expected function, found macro `deref`
  --> $DIR/unboxed-closures-type-mismatch-closure-from-another-scope.rs:13:5
   |
LL |     deref(p);
   |     ^^^^^ not a function
   |
help: use the `.` operator to call the method `Deref::deref` on `&&()`
   |
LL -     deref(p);
LL +     p.deref();
   |

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0308, E0423, E0425.
For more information about an error, try `rustc --explain E0308`.