]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/issue-38371.stderr
check_pat_ref: use pattern_cause
[rust.git] / src / test / ui / mismatched_types / issue-38371.stderr
1 error[E0308]: mismatched types
2   --> $DIR/issue-38371.rs:4:8
3    |
4 LL | fn foo(&foo: Foo) {
5    |        ^^^^------
6    |        |     |
7    |        |     expected due to this
8    |        expected struct `Foo`, found reference
9    |        help: did you mean `foo`: `&Foo`
10    |
11    = note: expected struct `Foo`
12            found reference `&_`
13
14 error[E0308]: mismatched types
15   --> $DIR/issue-38371.rs:18:9
16    |
17 LL | fn agh(&&bar: &u32) {
18    |         ^^^^  ---- expected due to this
19    |         |
20    |         expected `u32`, found reference
21    |         help: you can probably remove the explicit borrow: `bar`
22    |
23    = note:   expected type `u32`
24            found reference `&_`
25
26 error[E0308]: mismatched types
27   --> $DIR/issue-38371.rs:21:8
28    |
29 LL | fn bgh(&&bar: u32) {
30    |        ^^^^^  --- expected due to this
31    |        |
32    |        expected `u32`, found reference
33    |
34    = note:   expected type `u32`
35            found reference `&_`
36
37 error[E0529]: expected an array or slice, found `u32`
38   --> $DIR/issue-38371.rs:24:9
39    |
40 LL | fn ugh(&[bar]: &u32) {
41    |         ^^^^^ pattern cannot match with input type `u32`
42
43 error: aborting due to 4 previous errors
44
45 Some errors have detailed explanations: E0308, E0529.
46 For more information about an error, try `rustc --explain E0308`.