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