|
1 | 1 | error[E0308]: mismatched types
|
2 |
| - --> $DIR/as-ref.rs:6:27 |
| 2 | + --> $DIR/as-ref.rs:7:29 |
3 | 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().map` |
| 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` |
8 | 8 |
|
9 | 9 | error[E0308]: mismatched types
|
10 |
| - --> $DIR/as-ref.rs:8:37 |
| 10 | + --> $DIR/as-ref.rs:8:39 |
11 | 11 | |
|
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` |
| 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` |
16 | 16 |
|
17 | 17 | error[E0308]: mismatched types
|
18 |
| - --> $DIR/as-ref.rs:11:27 |
| 18 | + --> $DIR/as-ref.rs:10:29 |
19 | 19 | |
|
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` |
| 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` |
24 | 24 |
|
25 | 25 | error[E0308]: mismatched types
|
26 |
| - --> $DIR/as-ref.rs:13:35 |
| 26 | + --> $DIR/as-ref.rs:11:37 |
27 | 27 | |
|
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` |
| 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` |
32 | 32 |
|
33 | 33 | error[E0308]: mismatched types
|
34 |
| - --> $DIR/as-ref.rs:16:27 |
| 34 | + --> $DIR/as-ref.rs:13:29 |
35 | 35 | |
|
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 |
| 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 |
42 | 42 | |
|
43 | 43 | = note: expected enum `Option<&usize>`
|
44 | 44 | found reference `&Option<usize>`
|
45 | 45 |
|
46 | 46 | error[E0308]: mismatched types
|
47 |
| - --> $DIR/as-ref.rs:19:35 |
| 47 | + --> $DIR/as-ref.rs:15:37 |
48 | 48 | |
|
49 |
| -LL | let y: Result<&usize, &usize> = x; |
50 |
| - | ---------------------- ^ expected enum `Result`, found reference |
51 |
| - | | |
52 |
| - | expected due to this |
| 49 | +LL | let y: Result<&usize, &usize> = x; |
| 50 | + | ---------------------- ^ expected enum `Result`, found reference |
| 51 | + | | |
| 52 | + | expected due to this |
53 | 53 | |
|
54 | 54 | = note: expected enum `Result<&usize, &usize>`
|
55 | 55 | found reference `&Result<usize, usize>`
|
56 | 56 | help: you can convert from `&Result<T, E>` to `Result<&T, &E>` using `.as_ref()`
|
57 | 57 | |
|
58 |
| -LL | let y: Result<&usize, &usize> = x.as_ref(); |
59 |
| - | ^^^^^^^^^^ |
| 58 | +LL | let y: Result<&usize, &usize> = x.as_ref(); |
| 59 | + | ^^^^^^^^^^ |
60 | 60 |
|
61 | 61 | error[E0308]: mismatched types
|
62 |
| - --> $DIR/as-ref.rs:23:34 |
| 62 | + --> $DIR/as-ref.rs:19:36 |
63 | 63 | |
|
64 |
| -LL | let y: Result<&usize, usize> = x; |
65 |
| - | --------------------- ^ expected enum `Result`, found reference |
66 |
| - | | |
67 |
| - | expected due to this |
| 64 | +LL | let y: Result<&usize, usize> = x; |
| 65 | + | --------------------- ^ expected enum `Result`, found reference |
| 66 | + | | |
| 67 | + | expected due to this |
68 | 68 | |
|
69 | 69 | = note: expected enum `Result<&usize, usize>`
|
70 | 70 | found reference `&Result<usize, usize>`
|
|
0 commit comments