about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-02-07 17:00:16 +0100
committerGitHub <noreply@github.com>2020-02-07 17:00:16 +0100
commit2f1eaeea772c2800cd45d263a6927db366f5bdc5 (patch)
tree1f9f6d8e4553a4a0cee6a539eb2767bcf9259d09 /src/doc
parentb5e21dbb5cabdaaadc47a4d8e3f59979dcad2871 (diff)
parent80adde2e337f4e0d784da401b2db37c5d4d3468b (diff)
downloadrust-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.md29
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() {
+  // ...
+}
+```