about summary refs log tree commit diff
path: root/src/test/ui/as-ref.stderr
blob: 27016445ec5ad02f2ed4e2f9ccb8612d4c529d5c (plain)
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
error[E0308]: mismatched types
  --> $DIR/as-ref.rs:16:27
   |
LL |   opt.map(|arg| takes_ref(arg));
   |       -                   ^^^ expected &Foo, found struct `Foo`
   |       |
   |       help: consider using `as_ref` instead: `as_ref().`
   |
   = note: expected type `&Foo`
              found type `Foo`

error[E0308]: mismatched types
  --> $DIR/as-ref.rs:18:37
   |
LL |   opt.and_then(|arg| Some(takes_ref(arg)));
   |       -                             ^^^ expected &Foo, found struct `Foo`
   |       |
   |       help: consider using `as_ref` instead: `as_ref().`
   |
   = note: expected type `&Foo`
              found type `Foo`

error[E0308]: mismatched types
  --> $DIR/as-ref.rs:21:27
   |
LL |   opt.map(|arg| takes_ref(arg));
   |       -                   ^^^ expected &Foo, found struct `Foo`
   |       |
   |       help: consider using `as_ref` instead: `as_ref().`
   |
   = note: expected type `&Foo`
              found type `Foo`

error[E0308]: mismatched types
  --> $DIR/as-ref.rs:23:35
   |
LL |   opt.and_then(|arg| Ok(takes_ref(arg)));
   |       -                           ^^^ expected &Foo, found struct `Foo`
   |       |
   |       help: consider using `as_ref` instead: `as_ref().`
   |
   = note: expected type `&Foo`
              found type `Foo`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0308`.