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`
9 error[E0308]: mismatched types
10 --> $DIR/deref-suggestion.rs:14:10
13 | ^ expected `u32`, found `&u32`
15 help: consider dereferencing the borrow
20 error[E0308]: mismatched types
21 --> $DIR/deref-suggestion.rs:30:9
23 LL | foo(&"aaa".to_owned());
24 | ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
26 help: consider removing the borrow
28 LL | foo("aaa".to_owned());
31 error[E0308]: mismatched types
32 --> $DIR/deref-suggestion.rs:32:9
34 LL | foo(&mut "aaa".to_owned());
35 | ^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
37 help: consider removing the borrow
39 LL | foo("aaa".to_owned());
42 error[E0308]: mismatched types
43 --> $DIR/deref-suggestion.rs:2:20
45 LL | ($x:expr) => { &$x }
46 | ^^^ expected `u32`, found `&{integer}`
48 LL | foo3(borrow!(0));
49 | ---------- in this macro invocation
51 = note: this error originates in the macro `borrow` (in Nightly builds, run with -Z macro-backtrace for more info)
53 error[E0308]: mismatched types
54 --> $DIR/deref-suggestion.rs:36:5
56 LL | assert_eq!(3i32, &3i32);
57 | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `&i32`
59 = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
61 error[E0308]: mismatched types
62 --> $DIR/deref-suggestion.rs:39:17
67 | expected `&u32`, found integer
68 | help: consider borrowing here: `u: &u`
70 error[E0308]: mismatched types
71 --> $DIR/deref-suggestion.rs:41:20
73 LL | let s = S { u: u };
76 | expected `&u32`, found integer
77 | help: consider borrowing here: `&u`
79 error[E0308]: mismatched types
80 --> $DIR/deref-suggestion.rs:44:17
83 | ^ expected `u32`, found `&{integer}`
85 help: consider dereferencing the borrow
87 LL | let r = R { i: *i };
90 error[E0308]: mismatched types
91 --> $DIR/deref-suggestion.rs:46:20
93 LL | let r = R { i: i };
94 | ^ expected `u32`, found `&{integer}`
96 help: consider dereferencing the borrow
98 LL | let r = R { i: *i };
101 error[E0308]: mismatched types
102 --> $DIR/deref-suggestion.rs:55:9
105 | ^ expected `i32`, found `&{integer}`
107 help: consider dereferencing the borrow
112 error[E0308]: mismatched types
113 --> $DIR/deref-suggestion.rs:63:9
116 | ^ expected `i32`, found `&{integer}`
118 help: consider dereferencing the borrow
123 error[E0308]: `if` and `else` have incompatible types
124 --> $DIR/deref-suggestion.rs:68:12
126 LL | let val = if true {
129 | | -- expected because of this
130 LL | | } else if true {
139 | |______`if` and `else` have incompatible types
140 | expected `i32`, found `&{integer}`
142 error: aborting due to 13 previous errors
144 For more information about this error, try `rustc --explain E0308`.