diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-02-07 17:00:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-07 17:00:16 +0100 |
| commit | 2f1eaeea772c2800cd45d263a6927db366f5bdc5 (patch) | |
| tree | 1f9f6d8e4553a4a0cee6a539eb2767bcf9259d09 /src/doc | |
| parent | b5e21dbb5cabdaaadc47a4d8e3f59979dcad2871 (diff) | |
| parent | 80adde2e337f4e0d784da401b2db37c5d4d3468b (diff) | |
| download | rust-2f1eaeea772c2800cd45d263a6927db366f5bdc5.tar.gz rust-2f1eaeea772c2800cd45d263a6927db366f5bdc5.zip | |
Rollup merge of #68164 - tmiasko:no-sanitize, r=nikomatsakis
Selectively disable sanitizer instrumentation Add `no_sanitize` attribute that allows to opt out from sanitizer instrumentation in an annotated function.
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/unstable-book/src/language-features/no-sanitize.md | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/doc/unstable-book/src/language-features/no-sanitize.md b/src/doc/unstable-book/src/language-features/no-sanitize.md new file mode 100644 index 00000000000..28c683934d4 --- /dev/null +++ b/src/doc/unstable-book/src/language-features/no-sanitize.md @@ -0,0 +1,29 @@ +# `no_sanitize` + +The tracking issue for this feature is: [#39699] + +[#39699]: https://github.com/rust-lang/rust/issues/39699 + +------------------------ + +The `no_sanitize` attribute can be used to selectively disable sanitizer +instrumentation in an annotated function. This might be useful to: avoid +instrumentation overhead in a performance critical function, or avoid +instrumenting code that contains constructs unsupported by given sanitizer. + +The precise effect of this annotation depends on particular sanitizer in use. +For example, with `no_sanitize(thread)`, the thread sanitizer will no longer +instrument non-atomic store / load operations, but it will instrument atomic +operations to avoid reporting false positives and provide meaning full stack +traces. + +## Examples + +``` rust +#![feature(no_sanitize)] + +#[no_sanitize(address)] +fn foo() { + // ... +} +``` |
