]> git.proxmox.com Git - rustc.git/blame - src/test/ui/suggestions/as-ref.stderr
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / ui / suggestions / as-ref.stderr
CommitLineData
0731742a
XL
1error[E0308]: mismatched types
2 --> $DIR/as-ref.rs:6:27
3 |
4LL | opt.map(|arg| takes_ref(arg));
60c5eb7d 5 | --- ^^^ expected `&Foo`, found struct `Foo`
0731742a 6 | |
9fa01778 7 | help: consider using `as_ref` instead: `as_ref().map`
0731742a
XL
8
9error[E0308]: mismatched types
10 --> $DIR/as-ref.rs:8:37
11 |
12LL | opt.and_then(|arg| Some(takes_ref(arg)));
60c5eb7d 13 | -------- ^^^ expected `&Foo`, found struct `Foo`
0731742a 14 | |
9fa01778 15 | help: consider using `as_ref` instead: `as_ref().and_then`
0731742a
XL
16
17error[E0308]: mismatched types
18 --> $DIR/as-ref.rs:11:27
19 |
20LL | opt.map(|arg| takes_ref(arg));
60c5eb7d 21 | --- ^^^ expected `&Foo`, found struct `Foo`
0731742a 22 | |
9fa01778 23 | help: consider using `as_ref` instead: `as_ref().map`
0731742a
XL
24
25error[E0308]: mismatched types
26 --> $DIR/as-ref.rs:13:35
27 |
28LL | opt.and_then(|arg| Ok(takes_ref(arg)));
60c5eb7d 29 | -------- ^^^ expected `&Foo`, found struct `Foo`
0731742a 30 | |
9fa01778 31 | help: consider using `as_ref` instead: `as_ref().and_then`
0731742a
XL
32
33error[E0308]: mismatched types
34 --> $DIR/as-ref.rs:16:27
35 |
36LL | let y: Option<&usize> = x;
60c5eb7d
XL
37 | -------------- ^
38 | | |
1b1a35ee 39 | | expected enum `Option`, found `&Option<usize>`
60c5eb7d
XL
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
46error[E0308]: mismatched types
47 --> $DIR/as-ref.rs:19:35
48 |
49LL | let y: Result<&usize, &usize> = x;
6a06907d 50 | ---------------------- ^ expected enum `Result`, found reference
60c5eb7d
XL
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
56help: you can convert from `&Result<T, E>` to `Result<&T, &E>` using `.as_ref()`
57 |
58LL | let y: Result<&usize, &usize> = x.as_ref();
59 | ^^^^^^^^^^
60
61error[E0308]: mismatched types
62 --> $DIR/as-ref.rs:23:34
63 |
64LL | let y: Result<&usize, usize> = x;
6a06907d 65 | --------------------- ^ expected enum `Result`, found reference
60c5eb7d
XL
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
72error: aborting due to 7 previous errors
73
74For more information about this error, try `rustc --explain E0308`.