fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
889 B23 linesraw
1error[E0308]: mismatched types
2  --> $DIR/format-borrow.rs:2:21
3   |
4LL |     let a: String = &String::from("a");
5   |            ------   ^^^^^^^^^^^^^^^^^^
6   |            |        |
7   |            |        expected struct `std::string::String`, found `&std::string::String`
8   |            |        help: consider removing the borrow: `String::from("a")`
9   |            expected due to this
10
11error[E0308]: mismatched types
12  --> $DIR/format-borrow.rs:4:21
13   |
14LL |     let b: String = &format!("b");
15   |            ------   ^^^^^^^^^^^^^
16   |            |        |
17   |            |        expected struct `std::string::String`, found `&std::string::String`
18   |            |        help: consider removing the borrow: `format!("b")`
19   |            expected due to this
20
21error: aborting due to 2 previous errors
22
23For more information about this error, try `rustc --explain E0308`.