$ cargo run Compiling ownership v0.1.0 (file:///projects/ownership) error[E0596]: cannot borrow `*some_string` as mutable, as it is behind a `&` reference --> src/main.rs:8:5 | 7 | fn change(some_string: &String) { | ------- help: consider changing this to be a mutable reference: `&mut String` 8 | some_string.push_str(", world"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `some_string` is a `&` reference, so the data it refers to cannot be borrowed as mutable
For more information about this error, try `rustc --explain E0596`. error: could not compile `ownership` due to previous error
fnmain() { letx = 4; println!("the first x location is {:p}", &x); letx = 5; println!("the second x location is {:p}", &x); foriin0..10 { if x != 5 { // 永远不会输出, 因为 x 的值不会被改变 println!("the x value is {} and not equal to 5", x); } letx = i; } }
2022-11-0710:12:13【/tmp/clash_last_version】下载失败:【how to fix it, please visit the web page mentioned above.】 2022-11-0710:12:13【/tmp/clash_last_version】下载失败:【establish a secure connection to it. To learn more about this situation and】 2022-11-0710:12:13【/tmp/clash_last_version】下载失败:【curl failed to verify the legitimacy of the server and therefore could not】 2022-11-0710:12:13【/tmp/clash_last_version】下载失败:【】 2022-11-0710:12:13【/tmp/clash_last_version】下载失败:【More details here: https://curl.se/docs/sslcerts.html】 2022-11-0710:12:13【/tmp/clash_last_version】下载失败:【curl: (60) Cert verify failed: BADCERT_CN_MISMATCH】 2022-11-0710:10:57【/tmp/openclash_last_version】下载失败:【how to fix it, please visit the web page mentioned above.】 2022-11-0710:10:57【/tmp/openclash_last_version】下载失败:【establish a secure connection to it. To learn more about this situation and】 2022-11-0710:10:57【/tmp/openclash_last_version】下载失败:【curl failed to verify the legitimacy of the server and therefore could not】 2022-11-0710:10:57【/tmp/openclash_last_version】下载失败:【】 2022-11-0710:10:57【/tmp/openclash_last_version】下载失败:【More details here: https://curl.se/docs/sslcerts.html】 2022-11-0710:10:57【/tmp/openclash_last_version】下载失败:【curl: (60) Cert verify failed: BADCERT_CN_MISMATCH】 2022-11-0709:26:43【/tmp/clash_last_version】下载失败:【how to fix it, please visit the web page mentioned above.】 2022-11-0709:26:43【/tmp/clash_last_version】下载失败:【establish a secure connection to it. To learn more about this situation and】 2022-11-0709:26:43【/tmp/clash_last_version】下载失败:【curl failed to verify the legitimacy of the server and therefore could not】 2022-11-0709:26:43【/tmp/clash_last_version】下载失败:【】 2022-11-0709:26:43【/tmp/clash_last_version】下载失败:【More details here: https://curl.se/docs/sslcerts.html】 2022-11-0709:26:43【/tmp/clash_last_version】下载失败:【curl: (60) Cert verify failed: BADCERT_CN_MISMATCH】