1 error[E0308]: mismatched types
2 --> $DIR/deref-suggestion.rs:18:9
4 LL | foo(s); //~ ERROR mismatched types
7 | expected struct `std::string::String`, found reference
8 | help: try using a conversion method: `s.to_string()`
10 = note: expected type `std::string::String`
11 found type `&std::string::String`
13 error[E0308]: mismatched types
14 --> $DIR/deref-suggestion.rs:23:10
16 LL | foo3(u); //~ ERROR mismatched types
19 | expected u32, found &u32
20 | help: consider dereferencing the borrow: `*u`
22 = note: expected type `u32`
25 error[E0308]: mismatched types
26 --> $DIR/deref-suggestion.rs:30:9
28 LL | foo(&"aaa".to_owned()); //~ ERROR mismatched types
31 | expected struct `std::string::String`, found reference
32 | help: consider removing the borrow: `"aaa".to_owned()`
34 = note: expected type `std::string::String`
35 found type `&std::string::String`
37 error[E0308]: mismatched types
38 --> $DIR/deref-suggestion.rs:31:9
40 LL | foo(&mut "aaa".to_owned()); //~ ERROR mismatched types
41 | ^^^^^^^^^^^^^^^^^^^^^
43 | expected struct `std::string::String`, found mutable reference
44 | help: consider removing the borrow: `"aaa".to_owned()`
46 = note: expected type `std::string::String`
47 found type `&mut std::string::String`
49 error[E0308]: mismatched types
50 --> $DIR/deref-suggestion.rs:12:20
52 LL | ($x:expr) => { &$x } //~ ERROR mismatched types
53 | ^^^ expected u32, found &{integer}
55 LL | foo3(borrow!(0));
56 | ---------- in this macro invocation
58 = note: expected type `u32`
59 found type `&{integer}`
61 error: aborting due to 5 previous errors
63 For more information about this error, try `rustc --explain E0308`.