]>
Commit | Line | Data |
---|---|---|
0731742a | 1 | error[E0308]: mismatched types |
cdc7bbd5 | 2 | --> $DIR/as-ref.rs:7:29 |
0731742a | 3 | | |
cdc7bbd5 XL |
4 | LL | opt.map(|arg| takes_ref(arg)); |
5 | | --- ^^^ expected `&Foo`, found struct `Foo` | |
6 | | | | |
7 | | help: consider using `as_ref` instead: `as_ref().map` | |
0731742a XL |
8 | |
9 | error[E0308]: mismatched types | |
cdc7bbd5 | 10 | --> $DIR/as-ref.rs:8:39 |
0731742a | 11 | | |
cdc7bbd5 XL |
12 | LL | opt.and_then(|arg| Some(takes_ref(arg))); |
13 | | -------- ^^^ expected `&Foo`, found struct `Foo` | |
14 | | | | |
15 | | help: consider using `as_ref` instead: `as_ref().and_then` | |
0731742a XL |
16 | |
17 | error[E0308]: mismatched types | |
cdc7bbd5 | 18 | --> $DIR/as-ref.rs:10:29 |
0731742a | 19 | | |
cdc7bbd5 XL |
20 | LL | opt.map(|arg| takes_ref(arg)); |
21 | | --- ^^^ expected `&Foo`, found struct `Foo` | |
22 | | | | |
23 | | help: consider using `as_ref` instead: `as_ref().map` | |
0731742a XL |
24 | |
25 | error[E0308]: mismatched types | |
cdc7bbd5 | 26 | --> $DIR/as-ref.rs:11:37 |
0731742a | 27 | | |
cdc7bbd5 XL |
28 | LL | opt.and_then(|arg| Ok(takes_ref(arg))); |
29 | | -------- ^^^ expected `&Foo`, found struct `Foo` | |
30 | | | | |
31 | | help: consider using `as_ref` instead: `as_ref().and_then` | |
0731742a XL |
32 | |
33 | error[E0308]: mismatched types | |
cdc7bbd5 | 34 | --> $DIR/as-ref.rs:13:29 |
0731742a | 35 | | |
cdc7bbd5 XL |
36 | LL | let y: Option<&usize> = x; |
37 | | -------------- ^ | |
38 | | | | | |
39 | | | expected enum `Option`, found `&Option<usize>` | |
40 | | | help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`: `x.as_ref()` | |
41 | | expected due to this | |
0731742a | 42 | | |
1b1a35ee XL |
43 | = note: expected enum `Option<&usize>` |
44 | found reference `&Option<usize>` | |
0731742a XL |
45 | |
46 | error[E0308]: mismatched types | |
cdc7bbd5 | 47 | --> $DIR/as-ref.rs:15:37 |
0731742a | 48 | | |
cdc7bbd5 XL |
49 | LL | let y: Result<&usize, &usize> = x; |
50 | | ---------------------- ^ expected enum `Result`, found reference | |
51 | | | | |
52 | | expected due to this | |
0731742a | 53 | | |
6a06907d XL |
54 | = note: expected enum `Result<&usize, &usize>` |
55 | found reference `&Result<usize, usize>` | |
0731742a XL |
56 | help: you can convert from `&Result<T, E>` to `Result<&T, &E>` using `.as_ref()` |
57 | | | |
cdc7bbd5 | 58 | LL | let y: Result<&usize, &usize> = x.as_ref(); |
94222f64 | 59 | | ~~~~~~~~~~ |
0731742a XL |
60 | |
61 | error[E0308]: mismatched types | |
cdc7bbd5 | 62 | --> $DIR/as-ref.rs:19:36 |
0731742a | 63 | | |
cdc7bbd5 XL |
64 | LL | let y: Result<&usize, usize> = x; |
65 | | --------------------- ^ expected enum `Result`, found reference | |
66 | | | | |
67 | | expected due to this | |
0731742a | 68 | | |
6a06907d XL |
69 | = note: expected enum `Result<&usize, usize>` |
70 | found reference `&Result<usize, usize>` | |
0731742a XL |
71 | |
72 | error: aborting due to 7 previous errors | |
73 | ||
74 | For more information about this error, try `rustc --explain E0308`. |