-
Notifications
You must be signed in to change notification settings - Fork 13.4k
TRPL: attributes & conditional compilation #24673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
These can nest arbitrarily: | ||
|
||
```rust | ||
#[cfg(any(not(unix), all(macos, target_arch = "powerpc")))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macos
here should be target_os = "macos"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Could this also make a mention of the |
b787295
to
3d694ad
Compare
@alexcrichton i have not actually used |
There's some example usage in backtrace.rs, specifically here and here |
Example added. neat! |
3d694ad
to
a5c547f
Compare
lgtm |
therefore, which code gets compiled. Let’s take this code: | ||
|
||
```rust | ||
#[cfg(feature = foo)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this'll need to be feature = "foo"
(with the quotes)
r=me with a minor nit, thanks! |
a5c547f
to
a5ae4cc
Compare
@bors: r=alexcrichton rollup |
📌 Commit a5ae4cc has been approved by |
r? @alexcrichton