Rust 程序设计语言 简体中文版 1.85.0
v0.3.0 Compiling rand v0.8.5 Compiling guessing_game v0.1.0 (file:///projects/guessing_game) error[E0308]: mismatched types --> src/main.rs:23:21 | 23 | match guess.cmp(&secret_number) { more information about this error, try `rustc --explain E0308`. 31/562Rust 程序设计语言 简体中文版 error: could not compile `guessing_game` (bin "guessing_game") due to 1 previous error 错误的核心表明这里有 不匹配的类型(mismatched variables 的新项目。 接着,在新建的 variables 目录,打开 src/main.rs 并将代码替换为如下代码,这些代码还不能 编译,我们会首次检查到不可变错误(immutability error): 文件名:src/main.rs fn main() { let x = 5; println!("The value of x is: {x}"); x = 6;0 码力 | 562 页 | 3.23 MB | 9 天前3
共 1 条
- 1