2019-03-02 13:25:00 -06:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/format-borrow.rs:2:21
|
|
|
|
|
|
|
|
|
LL | let a: String = &String::from("a");
|
2023-01-02 20:00:33 -06:00
|
|
|
| ------ ^^^^^^^^^^^^^^^^^^ expected `String`, found `&String`
|
2021-06-28 13:22:47 -05:00
|
|
|
| |
|
2019-11-18 23:00:24 -06:00
|
|
|
| expected due to this
|
2021-06-28 13:22:47 -05:00
|
|
|
|
|
|
|
|
help: consider removing the borrow
|
|
|
|
|
|
2021-06-21 21:07:19 -05:00
|
|
|
LL - let a: String = &String::from("a");
|
|
|
|
LL + let a: String = String::from("a");
|
2022-06-08 12:34:57 -05:00
|
|
|
|
|
2022-10-12 04:07:30 -05:00
|
|
|
help: alternatively, consider changing the type annotation
|
|
|
|
|
|
|
|
|
LL | let a: &String = &String::from("a");
|
|
|
|
| +
|
2019-03-02 13:25:00 -06:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/format-borrow.rs:4:21
|
|
|
|
|
|
|
|
|
LL | let b: String = &format!("b");
|
2023-01-02 20:00:33 -06:00
|
|
|
| ------ ^^^^^^^^^^^^^ expected `String`, found `&String`
|
2021-06-28 13:22:47 -05:00
|
|
|
| |
|
2019-11-18 23:00:24 -06:00
|
|
|
| expected due to this
|
2021-06-28 13:22:47 -05:00
|
|
|
|
|
|
|
|
help: consider removing the borrow
|
|
|
|
|
|
2021-06-21 21:07:19 -05:00
|
|
|
LL - let b: String = &format!("b");
|
|
|
|
LL + let b: String = format!("b");
|
2022-06-08 12:34:57 -05:00
|
|
|
|
|
2022-10-12 04:07:30 -05:00
|
|
|
help: alternatively, consider changing the type annotation
|
|
|
|
|
|
|
|
|
LL | let b: &String = &format!("b");
|
|
|
|
| +
|
2019-03-02 13:25:00 -06:00
|
|
|
|
2021-06-02 12:06:45 -05:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/format-borrow.rs:6:21
|
|
|
|
|
|
|
|
|
LL | let c: String = &mut format!("c");
|
2023-01-02 20:00:33 -06:00
|
|
|
| ------ ^^^^^^^^^^^^^^^^^ expected `String`, found `&mut String`
|
2021-06-28 13:22:47 -05:00
|
|
|
| |
|
2021-06-02 12:06:45 -05:00
|
|
|
| expected due to this
|
2021-06-28 13:22:47 -05:00
|
|
|
|
|
|
|
|
help: consider removing the borrow
|
|
|
|
|
|
2021-06-21 21:07:19 -05:00
|
|
|
LL - let c: String = &mut format!("c");
|
|
|
|
LL + let c: String = format!("c");
|
2022-06-08 12:34:57 -05:00
|
|
|
|
|
2022-10-12 04:07:30 -05:00
|
|
|
help: alternatively, consider changing the type annotation
|
|
|
|
|
|
|
|
|
LL | let c: &mut String = &mut format!("c");
|
|
|
|
| ++++
|
2021-06-02 12:06:45 -05:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/format-borrow.rs:8:21
|
|
|
|
|
|
|
|
|
LL | let d: String = &mut (format!("d"));
|
2023-01-02 20:00:33 -06:00
|
|
|
| ------ ^^^^^^^^^^^^^^^^^^^ expected `String`, found `&mut String`
|
2021-06-28 13:22:47 -05:00
|
|
|
| |
|
2021-06-02 12:06:45 -05:00
|
|
|
| expected due to this
|
2021-06-28 13:22:47 -05:00
|
|
|
|
|
|
|
|
help: consider removing the borrow
|
|
|
|
|
|
2021-06-21 21:07:19 -05:00
|
|
|
LL - let d: String = &mut (format!("d"));
|
|
|
|
LL + let d: String = format!("d"));
|
2022-06-08 12:34:57 -05:00
|
|
|
|
|
2022-10-12 04:07:30 -05:00
|
|
|
help: alternatively, consider changing the type annotation
|
|
|
|
|
|
|
|
|
LL | let d: &mut String = &mut (format!("d"));
|
|
|
|
| ++++
|
2021-06-02 12:06:45 -05:00
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
2019-03-02 13:25:00 -06:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|