mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Rollup merge of #74522 - tmiasko:sanitizer-docs, r=nikomatsakis
Update sanitizer docs * Document AddressSanitizer memory leak detection defaults. * Remove CC & CFLAGS from MemorySanitizer example - they are now unnecessary for pure Rust projects (backtrace-rs moved away from libbacktrace).
This commit is contained in:
commit
15f8b80d95
@ -26,6 +26,9 @@ of bugs:
|
||||
* Double-free, invalid free
|
||||
* Memory leaks
|
||||
|
||||
The memory leak detection is enabled by default on Linux, and can be enabled
|
||||
with runtime flag `ASAN_OPTIONS=detect_leaks=1` on macOS.
|
||||
|
||||
AddressSanitizer is supported on the following targets:
|
||||
|
||||
* `x86_64-apple-darwin`
|
||||
@ -196,10 +199,6 @@ fn main() {
|
||||
|
||||
```shell
|
||||
$ export \
|
||||
CC=clang \
|
||||
CXX=clang++ \
|
||||
CFLAGS='-fsanitize=memory -fsanitize-memory-track-origins' \
|
||||
CXXFLAGS='-fsanitize=memory -fsanitize-memory-track-origins' \
|
||||
RUSTFLAGS='-Zsanitizer=memory -Zsanitizer-memory-track-origins' \
|
||||
RUSTDOCFLAGS='-Zsanitizer=memory -Zsanitizer-memory-track-origins'
|
||||
$ cargo clean
|
||||
|
Loading…
Reference in New Issue
Block a user