- Rust Quick Start Guide
- Daniel Arbuckle
- 161字
- 2021-06-10 19:46:01
Debug and release builds
You may have noticed that the program was in a directory called target/debug. What's that about? By default, cargo builds our program in debug mode, which is what a programmer normally wants.
That means that the resulting program is instrumented to work with the rust-gdb debugging program so we can examine what is happening in its internals, and to provide useful information in crash dumps and such, as well as skipping the compiler's optimization phase. The optimizations are skipped because they rearrange things in such a way that it makes debugging information almost incomprehensible.
However, sometimes a program doesn't have any more bugs (that we know about) and we're ready to ship it out to others. To construct our final, optimized version of the program, we use cargo build --release.
This will construct the release version of the program, and leave it in target/release/foo. We can copy it from there and package it up for distribution.
- Java多線程編程實戰指南:設計模式篇(第2版)
- Spring 5.0 By Example
- 劍指Offer(專項突破版):數據結構與算法名企面試題精講
- BeagleBone Media Center
- Learn Swift by Building Applications
- 征服RIA
- TypeScript圖形渲染實戰:基于WebGL的3D架構與實現
- Troubleshooting PostgreSQL
- ADI DSP應用技術集錦
- Mastering Rust
- 從Java到Web程序設計教程
- 搞定J2EE:Struts+Spring+Hibernate整合詳解與典型案例
- SciPy Recipes
- ROS機器人編程實戰
- Elasticsearch Blueprints