]> git.lizzy.rs Git - rust.git/blob - tests/ui/inference/deref-suggestion.stderr
Rollup merge of #106849 - WaffleLapkin:unvec, r=Nilstrieb
[rust.git] / tests / ui / inference / deref-suggestion.stderr
1 error[E0308]: mismatched types
2   --> $DIR/deref-suggestion.rs:8:9
3    |
4 LL |     foo(s);
5    |     --- ^- help: try using a conversion method: `.to_string()`
6    |     |   |
7    |     |   expected struct `String`, found `&String`
8    |     arguments to this function are incorrect
9    |
10 note: function defined here
11   --> $DIR/deref-suggestion.rs:5:4
12    |
13 LL | fn foo(_: String) {}
14    |    ^^^ ---------
15
16 error[E0308]: mismatched types
17   --> $DIR/deref-suggestion.rs:14:10
18    |
19 LL |     foo3(u);
20    |     ---- ^ expected `u32`, found `&u32`
21    |     |
22    |     arguments to this function are incorrect
23    |
24 note: function defined here
25   --> $DIR/deref-suggestion.rs:12:4
26    |
27 LL | fn foo3(_: u32) {}
28    |    ^^^^ ------
29 help: consider dereferencing the borrow
30    |
31 LL |     foo3(*u);
32    |          +
33
34 error[E0308]: mismatched types
35   --> $DIR/deref-suggestion.rs:30:9
36    |
37 LL |     foo(&"aaa".to_owned());
38    |     --- ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
39    |     |
40    |     arguments to this function are incorrect
41    |
42 note: function defined here
43   --> $DIR/deref-suggestion.rs:5:4
44    |
45 LL | fn foo(_: String) {}
46    |    ^^^ ---------
47 help: consider removing the borrow
48    |
49 LL -     foo(&"aaa".to_owned());
50 LL +     foo("aaa".to_owned());
51    |
52
53 error[E0308]: mismatched types
54   --> $DIR/deref-suggestion.rs:32:9
55    |
56 LL |     foo(&mut "aaa".to_owned());
57    |     --- ^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
58    |     |
59    |     arguments to this function are incorrect
60    |
61 note: function defined here
62   --> $DIR/deref-suggestion.rs:5:4
63    |
64 LL | fn foo(_: String) {}
65    |    ^^^ ---------
66 help: consider removing the borrow
67    |
68 LL -     foo(&mut "aaa".to_owned());
69 LL +     foo("aaa".to_owned());
70    |
71
72 error[E0308]: mismatched types
73   --> $DIR/deref-suggestion.rs:34:10
74    |
75 LL |     foo3(borrow!(0));
76    |     ---- ^^^^^^^^^^ expected `u32`, found `&{integer}`
77    |     |
78    |     arguments to this function are incorrect
79    |
80 note: function defined here
81   --> $DIR/deref-suggestion.rs:12:4
82    |
83 LL | fn foo3(_: u32) {}
84    |    ^^^^ ------
85
86 error[E0308]: mismatched types
87   --> $DIR/deref-suggestion.rs:37:5
88    |
89 LL |     assert_eq!(3i32, &3i32);
90    |     ^^^^^^^^^^^^^^^^^^^^^^^
91    |     |
92    |     expected `i32`, found `&i32`
93    |     expected because this is `i32`
94    |
95    = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
96
97 error[E0308]: mismatched types
98   --> $DIR/deref-suggestion.rs:40:17
99    |
100 LL |     let s = S { u };
101    |                 ^
102    |                 |
103    |                 expected `&u32`, found integer
104    |                 help: consider borrowing here: `u: &u`
105
106 error[E0308]: mismatched types
107   --> $DIR/deref-suggestion.rs:42:20
108    |
109 LL |     let s = S { u: u };
110    |                    ^
111    |                    |
112    |                    expected `&u32`, found integer
113    |                    help: consider borrowing here: `&u`
114
115 error[E0308]: mismatched types
116   --> $DIR/deref-suggestion.rs:45:17
117    |
118 LL |     let r = R { i };
119    |                 ^ expected `u32`, found `&{integer}`
120    |
121 help: consider dereferencing the borrow
122    |
123 LL |     let r = R { i: *i };
124    |                 ++++
125
126 error[E0308]: mismatched types
127   --> $DIR/deref-suggestion.rs:47:20
128    |
129 LL |     let r = R { i: i };
130    |                    ^ expected `u32`, found `&{integer}`
131    |
132 help: consider dereferencing the borrow
133    |
134 LL |     let r = R { i: *i };
135    |                    +
136
137 error[E0308]: mismatched types
138   --> $DIR/deref-suggestion.rs:56:9
139    |
140 LL |         b
141    |         ^ expected `i32`, found `&{integer}`
142    |
143 help: consider dereferencing the borrow
144    |
145 LL |         *b
146    |         +
147
148 error[E0308]: mismatched types
149   --> $DIR/deref-suggestion.rs:64:9
150    |
151 LL |         b
152    |         ^ expected `i32`, found `&{integer}`
153    |
154 help: consider dereferencing the borrow
155    |
156 LL |         *b
157    |         +
158
159 error[E0308]: `if` and `else` have incompatible types
160   --> $DIR/deref-suggestion.rs:69:12
161    |
162 LL |        let val = if true {
163    |  ________________-
164 LL | |          *a
165    | |          -- expected because of this
166 LL | |      } else if true {
167    | | ____________^
168 LL | ||
169 LL | ||         b
170 LL | ||     } else {
171 LL | ||         &0
172 LL | ||     };
173    | ||     ^
174    | ||_____|
175    |  |_____`if` and `else` have incompatible types
176    |        expected `i32`, found `&{integer}`
177
178 error: aborting due to 13 previous errors
179
180 For more information about this error, try `rustc --explain E0308`.