1 error[E0308]: mismatched types
2 --> $DIR/deref-suggestion.rs:8:9
5 | --- ^- help: try using a conversion method: `.to_string()`
7 | | expected struct `String`, found `&String`
8 | arguments to this function are incorrect
10 note: function defined here
11 --> $DIR/deref-suggestion.rs:5:4
13 LL | fn foo(_: String) {}
16 error[E0308]: mismatched types
17 --> $DIR/deref-suggestion.rs:14:10
20 | ---- ^ expected `u32`, found `&u32`
22 | arguments to this function are incorrect
24 note: function defined here
25 --> $DIR/deref-suggestion.rs:12:4
27 LL | fn foo3(_: u32) {}
29 help: consider dereferencing the borrow
34 error[E0308]: mismatched types
35 --> $DIR/deref-suggestion.rs:30:9
37 LL | foo(&"aaa".to_owned());
38 | --- ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
40 | arguments to this function are incorrect
42 note: function defined here
43 --> $DIR/deref-suggestion.rs:5:4
45 LL | fn foo(_: String) {}
47 help: consider removing the borrow
49 LL - foo(&"aaa".to_owned());
50 LL + foo("aaa".to_owned());
53 error[E0308]: mismatched types
54 --> $DIR/deref-suggestion.rs:32:9
56 LL | foo(&mut "aaa".to_owned());
57 | --- ^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
59 | arguments to this function are incorrect
61 note: function defined here
62 --> $DIR/deref-suggestion.rs:5:4
64 LL | fn foo(_: String) {}
66 help: consider removing the borrow
68 LL - foo(&mut "aaa".to_owned());
69 LL + foo("aaa".to_owned());
72 error[E0308]: mismatched types
73 --> $DIR/deref-suggestion.rs:34:10
75 LL | foo3(borrow!(0));
76 | ---- ^^^^^^^^^^ expected `u32`, found `&{integer}`
78 | arguments to this function are incorrect
80 note: function defined here
81 --> $DIR/deref-suggestion.rs:12:4
83 LL | fn foo3(_: u32) {}
86 error[E0308]: mismatched types
87 --> $DIR/deref-suggestion.rs:37:5
89 LL | assert_eq!(3i32, &3i32);
90 | ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `&i32`
92 = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
94 error[E0308]: mismatched types
95 --> $DIR/deref-suggestion.rs:40:17
100 | expected `&u32`, found integer
101 | help: consider borrowing here: `u: &u`
103 error[E0308]: mismatched types
104 --> $DIR/deref-suggestion.rs:42:20
106 LL | let s = S { u: u };
109 | expected `&u32`, found integer
110 | help: consider borrowing here: `&u`
112 error[E0308]: mismatched types
113 --> $DIR/deref-suggestion.rs:45:17
115 LL | let r = R { i };
116 | ^ expected `u32`, found `&{integer}`
118 help: consider dereferencing the borrow
120 LL | let r = R { i: *i };
123 error[E0308]: mismatched types
124 --> $DIR/deref-suggestion.rs:47:20
126 LL | let r = R { i: i };
127 | ^ expected `u32`, found `&{integer}`
129 help: consider dereferencing the borrow
131 LL | let r = R { i: *i };
134 error[E0308]: mismatched types
135 --> $DIR/deref-suggestion.rs:56:9
138 | ^ expected `i32`, found `&{integer}`
140 help: consider dereferencing the borrow
145 error[E0308]: mismatched types
146 --> $DIR/deref-suggestion.rs:64:9
149 | ^ expected `i32`, found `&{integer}`
151 help: consider dereferencing the borrow
156 error[E0308]: `if` and `else` have incompatible types
157 --> $DIR/deref-suggestion.rs:69:12
159 LL | let val = if true {
162 | | -- expected because of this
163 LL | | } else if true {
172 | |______`if` and `else` have incompatible types
173 | expected `i32`, found `&{integer}`
175 error: aborting due to 13 previous errors
177 For more information about this error, try `rustc --explain E0308`.