ZhangHanDong / tao-of-rust-codes

《Rust编程之道》随书源码
https://ruststudy.github.io/tao_of_rust_docs/tao_of_rust/
MIT License
1.18k stars 170 forks source link

[第5章] 5.6 代码清单5-47注释中foo不存在 #337

Closed m104ngc4594 closed 1 year ago

m104ngc4594 commented 1 year ago

页码与行数


文本或排版错误

暂无


代码错误

let f = *foo;  // 此处应该是 let f = *a;

Rust版本

$ rustc -V
rustc 1.67.0 (fc594f156 2023-01-24)

错误信息

Compiling playground v0.0.1 (/playground)
error[[E0425]](https://doc.rust-lang.org/stable/error-index.html#E0425): cannot find value `foo` in this scope
 --> src/main.rs:8:14
  |
8 |     let f = *foo;
  |              ^^^ not found in this scope

For more information about this error, try `rustc --explain E0425`.
error: could not compile `playground` due to previous error