mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 20:23:59 +00:00
Rollup merge of #71637 - mibac138:cfg-sanitize, r=petrochenkov
Minor formatting changes in `cfg-sanitize.md`
This commit is contained in:
commit
3d1f958b6c
@ -11,26 +11,24 @@ depending on whether a particular sanitizer is enabled or not.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
``` rust
|
```rust
|
||||||
#![feature(cfg_sanitize)]
|
#![feature(cfg_sanitize)]
|
||||||
|
|
||||||
#[cfg(sanitize = "thread")]
|
#[cfg(sanitize = "thread")]
|
||||||
fn a() {
|
fn a() {
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(sanitize = "thread"))]
|
#[cfg(not(sanitize = "thread"))]
|
||||||
fn a() {
|
fn a() {
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
|
|
||||||
fn b() {
|
fn b() {
|
||||||
if cfg!(sanitize = "leak") {
|
if cfg!(sanitize = "leak") {
|
||||||
// ...
|
// ...
|
||||||
} else {
|
} else {
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user