From 30108ca15c11f011f6d9e4c06a83cb4dc5644313 Mon Sep 17 00:00:00 2001 From: Volker-Weissmann <39418860+Volker-Weissmann@users.noreply.github.com> Date: Fri, 13 May 2022 18:37:07 +0200 Subject: [PATCH] Added note in documentation I added this note, because if you forget the `--target` flags, you get a really ugly error message. https://github.com/rust-lang/cargo/issues/10666 --- src/doc/unstable-book/src/compiler-flags/sanitizer.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/doc/unstable-book/src/compiler-flags/sanitizer.md b/src/doc/unstable-book/src/compiler-flags/sanitizer.md index 3f60caffef5b7..e83c4d98cc7a4 100644 --- a/src/doc/unstable-book/src/compiler-flags/sanitizer.md +++ b/src/doc/unstable-book/src/compiler-flags/sanitizer.md @@ -22,7 +22,10 @@ This feature allows for use of one of following sanitizers: To enable a sanitizer compile with `-Zsanitizer=address`,`-Zsanitizer=cfi`, `-Zsanitizer=hwaddress`, `-Zsanitizer=leak`, `-Zsanitizer=memory`, -`-Zsanitizer=memtag`, or `-Zsanitizer=thread`. +`-Zsanitizer=memtag`, or `-Zsanitizer=thread`. You might also need the `--target` and `build-std` flags. Example: +```shell +$ RUSTFLAGS=-Zsanitizer=address cargo build -Zbuild-std --target x86_64-unknown-linux-gnu +``` # AddressSanitizer