]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/format-borrow.stderr
7f1cec2d21881761e178a3a146be085bfeff8d4a
[rust.git] / src / test / ui / suggestions / format-borrow.stderr
1 error[E0308]: mismatched types
2   --> $DIR/format-borrow.rs:2:21
3    |
4 LL |     let a: String = &String::from("a");
5    |                     ^^^^^^^^^^^^^^^^^^
6    |                     |
7    |                     expected struct `std::string::String`, found reference
8    |                     help: consider removing the borrow: `String::from("a")`
9    |
10    = note: expected struct `std::string::String`
11            found reference `&std::string::String`
12
13 error[E0308]: mismatched types
14   --> $DIR/format-borrow.rs:4:21
15    |
16 LL |     let b: String = &format!("b");
17    |                     ^^^^^^^^^^^^^
18    |                     |
19    |                     expected struct `std::string::String`, found reference
20    |                     help: consider removing the borrow: `format!("b")`
21    |
22    = note: expected struct `std::string::String`
23            found reference `&std::string::String`
24
25 error: aborting due to 2 previous errors
26
27 For more information about this error, try `rustc --explain E0308`.