diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2025-08-19 14:18:16 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-19 14:18:16 +1000 |
| commit | 633cc0cc6cfc6b77da14864dbefb1dab25dcb8d0 (patch) | |
| tree | 145a2b42a2741b0f113868938d76e060d6988292 /compiler/rustc_span/src/symbol.rs | |
| parent | 027c7a5d857ff9692ce40bfd3bc9a90ef3764232 (diff) | |
| parent | 95bdb34494ad795f552cab7a0eb7bfd2e98ef033 (diff) | |
| download | rust-633cc0cc6cfc6b77da14864dbefb1dab25dcb8d0.tar.gz rust-633cc0cc6cfc6b77da14864dbefb1dab25dcb8d0.zip | |
Rollup merge of #142681 - 1c3t3a:sanitize-off-on, r=rcvalle
Remove the `#[no_sanitize]` attribute in favor of `#[sanitize(xyz = "on|off")]`
This came up during the sanitizer stabilization (rust-lang/rust#123617). Instead of a `#[no_sanitize(xyz)]` attribute, we would like to have a `#[sanitize(xyz = "on|off")]` attribute, which is more powerful and allows to be extended in the future (instead
of just focusing on turning sanitizers off). The implementation is done according to what was [discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/343119-project-exploit-mitigations/topic/Stabilize.20the.20.60no_sanitize.60.20attribute/with/495377292)).
The new attribute also works on modules, traits and impl items and thus enables usage as the following:
```rust
#[sanitize(address = "off")]
mod foo {
fn unsanitized(..) {}
#[sanitize(address = "on")]
fn sanitized(..) {}
}
trait MyTrait {
#[sanitize(address = "off")]
fn unsanitized_default(..) {}
}
#[sanitize(thread = "off")]
impl MyTrait for () {
...
}
```
r? ```@rcvalle```
Diffstat (limited to 'compiler/rustc_span/src/symbol.rs')
| -rw-r--r-- | compiler/rustc_span/src/symbol.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 3ed483db3c4..65a52b27d3b 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -1261,6 +1261,7 @@ symbols! { iterator, iterator_collect_fn, kcfi, + kernel_address, keylocker_x86, keyword, kind, |
