- 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.
- Learn Type:Driven Development
- 造個小程序:與微信一起干件正經事兒
- Python自動化運維快速入門
- PyTorch Artificial Intelligence Fundamentals
- Python進階編程:編寫更高效、優雅的Python代碼
- Koa開發:入門、進階與實戰
- 用戶體驗增長:數字化·智能化·綠色化
- OpenStack Orchestration
- Creating Data Stories with Tableau Public
- Cocos2d-x Game Development Blueprints
- 奔跑吧 Linux內核
- OpenCV 3.0 Computer Vision with Java
- Kotlin進階實戰
- Clojure Web Development Essentials
- Vue.js 3.x高效前端開發(視頻教學版)