1 error[E0308]: mismatched types
2 --> $DIR/as-ref.rs:16:27
4 LL | opt.map(|arg| takes_ref(arg));
5 | - ^^^ expected &Foo, found struct `Foo`
7 | help: consider using `as_ref` instead: `as_ref().`
9 = note: expected type `&Foo`
12 error[E0308]: mismatched types
13 --> $DIR/as-ref.rs:18:37
15 LL | opt.and_then(|arg| Some(takes_ref(arg)));
16 | - ^^^ expected &Foo, found struct `Foo`
18 | help: consider using `as_ref` instead: `as_ref().`
20 = note: expected type `&Foo`
23 error[E0308]: mismatched types
24 --> $DIR/as-ref.rs:21:27
26 LL | opt.map(|arg| takes_ref(arg));
27 | - ^^^ expected &Foo, found struct `Foo`
29 | help: consider using `as_ref` instead: `as_ref().`
31 = note: expected type `&Foo`
34 error[E0308]: mismatched types
35 --> $DIR/as-ref.rs:23:35
37 LL | opt.and_then(|arg| Ok(takes_ref(arg)));
38 | - ^^^ expected &Foo, found struct `Foo`
40 | help: consider using `as_ref` instead: `as_ref().`
42 = note: expected type `&Foo`
45 error: aborting due to 4 previous errors
47 For more information about this error, try `rustc --explain E0308`.