-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Conditional compilation for sanitizers #66245
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @GuillaumeGomez (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Would this work if you have more than one sanitizer enabled? For example, address and leak sanitizer can be used together (although I'm not sure if rustc currently supports that). |
It is possible to configure multiple key-value pairs with the same key, so if |
☔ The latest upstream changes (presumably #66070) made this pull request unmergeable. Please resolve the merge conflicts. |
Ping from triage: Thank you |
459e604
to
ea0c9eb
Compare
Rebased. |
☔ The latest upstream changes (presumably #66507) made this pull request unmergeable. Please resolve the merge conflicts. |
ea0c9eb
to
a3a3315
Compare
r? @oli-obk |
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.
The implementation looks fine to me. A tracking issue with some links to related work around sanitizers would be good though
------------------------ | ||
|
||
The `cfg_sanitize` feature makes it possible to execute different code | ||
depending on whether a particular is enabled or not. |
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.
a particular ... ?
d7c840f
to
dc83d94
Compare
I used #39699 as a tracking issue. |
dc83d94
to
41477ce
Compare
@bors r+ |
📌 Commit 41477cef469b97439bbb97dcc36d53aa55f494c9 has been approved by |
⌛ Testing commit 41477cef469b97439bbb97dcc36d53aa55f494c9 with merge 40a2ad9697b29102bd4d637a4076fe384982374f... |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
💔 Test failed - checks-azure |
☔ The latest upstream changes (presumably #66908) made this pull request unmergeable. Please resolve the merge conflicts. |
Configure sanitize option when compiling with a sanitizer to make it possible to execute different code depending on whether given sanitizer is enabled or not.
Rebased. |
@bors r+ |
📌 Commit c703ff2 has been approved by |
🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened |
Is there precedent for that, i.e., is there any existing |
A few examples: |
Hm, you are right. I guess that ship has sailed. Never mind then! |
Conditional compilation for sanitizers Configure sanitize option when compiling with a sanitizer to make it possible to execute different code depending on whether given sanitizer is enabled or not.
Conditional compilation for sanitizers Configure sanitize option when compiling with a sanitizer to make it possible to execute different code depending on whether given sanitizer is enabled or not.
⌛ Testing commit c703ff2 with merge 3713ae778689813f687db44c370edbe028912552... |
Conditional compilation for sanitizers Configure sanitize option when compiling with a sanitizer to make it possible to execute different code depending on whether given sanitizer is enabled or not.
@bors retry |
Rollup of 5 pull requests Successful merges: - #66245 (Conditional compilation for sanitizers) - #66654 (Handle const-checks for `&mut` outside of `HasMutInterior`) - #66822 (libunwind_panic: adjust miri panic hack) - #66827 (handle diverging functions forwarding their return place) - #66834 (rustbuild fixes) Failed merges: r? @ghost
Configure sanitize option when compiling with a sanitizer to make
it possible to execute different code depending on whether given
sanitizer is enabled or not.