- 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.
- Visual C++程序設計學習筆記
- Spring Cloud Alibaba微服務架構設計與開發實戰
- Hands-On Data Structures and Algorithms with JavaScript
- C#程序設計(慕課版)
- ASP.NET動態網頁設計教程(第三版)
- R語言編程指南
- Visual C++數字圖像處理技術詳解
- Mastering Drupal 8 Views
- PHP+MySQL+Dreamweaver動態網站開發從入門到精通(第3版)
- 從零開始學C#
- 軟件測試教程
- GameMaker Essentials
- Java Hibernate Cookbook
- Web開發的平民英雄:PHP+MySQL
- 微信小程序開發邊做邊學(微課視頻版)