- Linux上使用rust-gdb
- MacOs上使用rust-lldb [lldb]
https://doc.rust-lang.org/stable/rust-by-example/hello.html
lldb
cargo vs rustc
You might note that cargo uses rustc. It is not a compiler by itself. Instead, it could be seen as a convenience wrapper, providing shortcuts to the commands used in almost every project. Then, one obvious (but extremely rare) case when you'd prefer rustc over cargo is if you need something which is easier to achieve by manually instructing the compiler then by describing your goal to cargo.
cargo 是上一层,最终调用rustc 推荐cargo
https://doc.rust-lang.org/cargo/getting-started/index.html
- build release version with cargo but still keep debug info
- dead_code 编译器会报warning unused 如果加上这个,会过滤掉
cargo new [new path]
cargo init ## 用于当前的目录
rustup update
https://www.rust-lang.org/tools/install
cargo add anyhow
cargo1.62 之后,可以用上面的方法来增加package依赖包