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:
Manish Goregaokar 2020-07-20 12:30:25 -07:00 committed by GitHub
commit 15f8b80d95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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