]> git.lizzy.rs Git - rust.git/blob - src/test/ui/as-ref.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / as-ref.stderr
1 error[E0308]: mismatched types
2   --> $DIR/as-ref.rs:16:27
3    |
4 LL |   opt.map(|arg| takes_ref(arg));
5    |       -                   ^^^ expected &Foo, found struct `Foo`
6    |       |
7    |       help: consider using `as_ref` instead: `as_ref().`
8    |
9    = note: expected type `&Foo`
10               found type `Foo`
11
12 error[E0308]: mismatched types
13   --> $DIR/as-ref.rs:18:37
14    |
15 LL |   opt.and_then(|arg| Some(takes_ref(arg)));
16    |       -                             ^^^ expected &Foo, found struct `Foo`
17    |       |
18    |       help: consider using `as_ref` instead: `as_ref().`
19    |
20    = note: expected type `&Foo`
21               found type `Foo`
22
23 error[E0308]: mismatched types
24   --> $DIR/as-ref.rs:21:27
25    |
26 LL |   opt.map(|arg| takes_ref(arg));
27    |       -                   ^^^ expected &Foo, found struct `Foo`
28    |       |
29    |       help: consider using `as_ref` instead: `as_ref().`
30    |
31    = note: expected type `&Foo`
32               found type `Foo`
33
34 error[E0308]: mismatched types
35   --> $DIR/as-ref.rs:23:35
36    |
37 LL |   opt.and_then(|arg| Ok(takes_ref(arg)));
38    |       -                           ^^^ expected &Foo, found struct `Foo`
39    |       |
40    |       help: consider using `as_ref` instead: `as_ref().`
41    |
42    = note: expected type `&Foo`
43               found type `Foo`
44
45 error: aborting due to 4 previous errors
46
47 For more information about this error, try `rustc --explain E0308`.