LL | let a: String = &String::from("a");
| ^^^^^^^^^^^^^^^^^^
| |
- | expected struct `std::string::String`, found reference
+ | expected struct `std::string::String`, found &std::string::String
| help: consider removing the borrow: `String::from("a")`
- |
- = note: expected type `std::string::String`
- found type `&std::string::String`
error[E0308]: mismatched types
--> $DIR/format-borrow.rs:4:21
LL | let b: String = &format!("b");
| ^^^^^^^^^^^^^
| |
- | expected struct `std::string::String`, found reference
+ | expected struct `std::string::String`, found &std::string::String
| help: consider removing the borrow: `format!("b")`
- |
- = note: expected type `std::string::String`
- found type `&std::string::String`
error: aborting due to 2 previous errors