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());
29 LL + foo("aaa".to_owned());
32 error[E0308]: mismatched types
33 --> $DIR/deref-suggestion.rs:32:9
35 LL | foo(&mut "aaa".to_owned());
36 | ^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
38 help: consider removing the borrow
40 LL - foo(&mut "aaa".to_owned());
41 LL + foo("aaa".to_owned());
44 error[E0308]: mismatched types
45 --> $DIR/deref-suggestion.rs:2:20
47 LL | ($x:expr) => { &$x }
48 | ^^^ expected `u32`, found `&{integer}`
50 LL | foo3(borrow!(0));
51 | ---------- in this macro invocation
53 = note: this error originates in the macro `borrow` (in Nightly builds, run with -Z macro-backtrace for more info)
55 error[E0308]: mismatched types
56 --> $DIR/deref-suggestion.rs:36:5
58 LL | assert_eq!(3i32, &3i32);
59 | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `&i32`
61 = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
63 error[E0308]: mismatched types
64 --> $DIR/deref-suggestion.rs:39:17
69 | expected `&u32`, found integer
70 | help: consider borrowing here: `u: &u`
72 error[E0308]: mismatched types
73 --> $DIR/deref-suggestion.rs:41:20
75 LL | let s = S { u: u };
78 | expected `&u32`, found integer
79 | help: consider borrowing here: `&u`
81 error[E0308]: mismatched types
82 --> $DIR/deref-suggestion.rs:44:17
85 | ^ expected `u32`, found `&{integer}`
87 help: consider dereferencing the borrow
89 LL | let r = R { i: *i };
92 error[E0308]: mismatched types
93 --> $DIR/deref-suggestion.rs:46:20
95 LL | let r = R { i: i };
96 | ^ expected `u32`, found `&{integer}`
98 help: consider dereferencing the borrow
100 LL | let r = R { i: *i };
103 error[E0308]: mismatched types
104 --> $DIR/deref-suggestion.rs:55:9
107 | ^ expected `i32`, found `&{integer}`
109 help: consider dereferencing the borrow
114 error[E0308]: mismatched types
115 --> $DIR/deref-suggestion.rs:63:9
118 | ^ expected `i32`, found `&{integer}`
120 help: consider dereferencing the borrow
125 error[E0308]: `if` and `else` have incompatible types
126 --> $DIR/deref-suggestion.rs:68:12
128 LL | let val = if true {
131 | | -- expected because of this
132 LL | | } else if true {
141 | |______`if` and `else` have incompatible types
142 | expected `i32`, found `&{integer}`
144 error: aborting due to 13 previous errors
146 For more information about this error, try `rustc --explain E0308`.