Repository navigation
use cfg!(overflow_checks) in overflow_checks intrinsic instead of cfg!(debug_assertions) - #166295
Conversation
|
Thanks for the pull request, and welcome! The Rust Project has assigned @JohnTitor (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions and our LLM policy for more information. Why was this reviewer chosen?The reviewer was selected based on:
|
|
As per request: @theemathas |
|
For context, I had an LLM do some investigation. It found the following, which I confirmed to be accurate.
So, I concluded that the fact that the |
This comment has been minimized.
This comment has been minimized.
|
Another small thing I found: the |
|
Do you mind splitting the docs change into another PR? (This PR has @theemathas's investigation of the overflow_checks change, so let's keep that here). You can request my review on the docs one with |
9910e93 to
01d4cf3
Compare
This comment has been minimized.
This comment has been minimized.
|
Given the investigation above, @bors r+ |
|
❌ Cannot approve commit 01d4cf3, because CI currently fails on this PR. Use |
|
Tomorrow I'll check and see if this is passing CI and approve it then if it is. r? @thomcc |
|
📌 Commit 7eca63a has been tentatively approved by It will be put into the queue for this repository once PR CI succeeds. 🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. Reason for tree closure: |
cfg!(overflow_checks) in overflow_checks intrinsic instead of cfg!(debug_assertions)
|
@bors squash |
This comment has been minimized.
This comment has been minimized.
… `cfg!(debug_assertions)` * use `cfg!(overflow_checks)` in `overflow_checks` intrinsic instead of `cfg!(debug_assertions)` * add missing `cfg_overflow_checks` feature
7eca63a to
f9becad
Compare
|
🔨 2 commits were squashed into f9becad. This pull request was unapproved. |
|
No need to have two commits for such a small change. |
|
📌 Commit f9becad has been tentatively approved by It will be put into the queue for this repository once PR CI succeeds. 🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. Reason for tree closure: |
…omcc
use `cfg!(overflow_checks)` in `overflow_checks` intrinsic instead of `cfg!(debug_assertions)`
The fallback implementation of the `overflow_checks()` intrinsic is currently defined as:
```rs
#[rustc_intrinsic]
pub const fn overflow_checks() -> bool {
cfg!(debug_assertions)
}
```
This seems to be an oversight from copypasting. Its docs state:
> This eventually evaluates `cfg!(overflow_checks)`
I changed its fallback body to `cfg!(overflow_checks)`.
If this is somehow intended behavior, I'd put a comment stating that this `cfg!` is intentionally `debug_assertions` instead of `overflow_checks`.
Note: The `overflow_checks` cfg *is* currently unstable, tracked at rust-lang#111466.
Also see <https://discord.com/channels/273534239310479360/957720175619215380/1573547547379765341>.
…uwer Rollup of 14 pull requests Successful merges: - #166266 (miri subtree update) - #164878 (Don't require `extern "llvm-intrinsic"` return structs to be `#[repr(packed)]`) - #165008 (Support `NonNull` pointers as `asm!` input operands) - #165892 (`rustc_builtin_macros` cleanup, part 10) - #165930 (Add red-green mark when dumping dep graph. Show DefIds if available) - #166280 (std: also mark doctests with skip_unsupported_miri_tests) - #166295 (use `cfg!(overflow_checks)` in `overflow_checks` intrinsic instead of `cfg!(debug_assertions)`) - #165618 (Implement RangeIntersect on core::range types) - #166012 (Added more queries to AdtDef in rustc_public to check for rust language types) - #166142 (Lower to `hir::Param`s for extern functions) - #166259 (fmt: Improve `Debug` for `FormattingOptions`) - #166269 (libcore: Revert some comment changes) - #166287 (Use `core::ptr` in `implicit_provenance_casts` help for `no_std` crates) - #166306 (bootstrap: Stop passing `-Ztrim-paths` to cargo now that it's stable in beta)
…omcc
use `cfg!(overflow_checks)` in `overflow_checks` intrinsic instead of `cfg!(debug_assertions)`
The fallback implementation of the `overflow_checks()` intrinsic is currently defined as:
```rs
#[rustc_intrinsic]
pub const fn overflow_checks() -> bool {
cfg!(debug_assertions)
}
```
This seems to be an oversight from copypasting. Its docs state:
> This eventually evaluates `cfg!(overflow_checks)`
I changed its fallback body to `cfg!(overflow_checks)`.
If this is somehow intended behavior, I'd put a comment stating that this `cfg!` is intentionally `debug_assertions` instead of `overflow_checks`.
Note: The `overflow_checks` cfg *is* currently unstable, tracked at rust-lang#111466.
Also see <https://discord.com/channels/273534239310479360/957720175619215380/1573547547379765341>.
…omcc
use `cfg!(overflow_checks)` in `overflow_checks` intrinsic instead of `cfg!(debug_assertions)`
The fallback implementation of the `overflow_checks()` intrinsic is currently defined as:
```rs
#[rustc_intrinsic]
pub const fn overflow_checks() -> bool {
cfg!(debug_assertions)
}
```
This seems to be an oversight from copypasting. Its docs state:
> This eventually evaluates `cfg!(overflow_checks)`
I changed its fallback body to `cfg!(overflow_checks)`.
If this is somehow intended behavior, I'd put a comment stating that this `cfg!` is intentionally `debug_assertions` instead of `overflow_checks`.
Note: The `overflow_checks` cfg *is* currently unstable, tracked at rust-lang#111466.
Also see <https://discord.com/channels/273534239310479360/957720175619215380/1573547547379765341>.
…uwer Rollup of 19 pull requests Successful merges: - #166266 (miri subtree update) - #164878 (Don't require `extern "llvm-intrinsic"` return structs to be `#[repr(packed)]`) - #165008 (Support `NonNull` pointers as `asm!` input operands) - #165892 (`rustc_builtin_macros` cleanup, part 10) - #165930 (Add red-green mark when dumping dep graph. Show DefIds if available) - #166280 (std: also mark doctests with skip_unsupported_miri_tests) - #166295 (use `cfg!(overflow_checks)` in `overflow_checks` intrinsic instead of `cfg!(debug_assertions)`) - #164485 (Stabilize unchecked `nonzero_ops`) - #165618 (Implement RangeIntersect on core::range types) - #165782 (Make unsafe unknown diagnostic attributes an error again) - #165833 (Deallocate with the right provenance on Windows) - #165834 (Implement tidy alphabetical --bless on Windows) - #165889 (Fix docs of alloc fn: Allocator API stabilized) - #165923 (Don't load/store a LLVM aggregate type when returning an array from a generic SIMD intrinsic) - #166012 (Added more queries to AdtDef in rustc_public to check for rust language types) - #166186 (OpenOptions::append: clarify docs) - #166216 (Stop using #![no_core] in profiler_builtins) - #166259 (fmt: Improve `Debug` for `FormattingOptions`) - #166263 (Show slice split results for empty and singleton slices)
…uwer Rollup of 18 pull requests Successful merges: - #164878 (Don't require `extern "llvm-intrinsic"` return structs to be `#[repr(packed)]`) - #165008 (Support `NonNull` pointers as `asm!` input operands) - #165892 (`rustc_builtin_macros` cleanup, part 10) - #165930 (Add red-green mark when dumping dep graph. Show DefIds if available) - #166280 (std: also mark doctests with skip_unsupported_miri_tests) - #166295 (use `cfg!(overflow_checks)` in `overflow_checks` intrinsic instead of `cfg!(debug_assertions)`) - #164485 (Stabilize unchecked `nonzero_ops`) - #165618 (Implement RangeIntersect on core::range types) - #165782 (Make unsafe unknown diagnostic attributes an error again) - #165833 (Deallocate with the right provenance on Windows) - #165834 (Implement tidy alphabetical --bless on Windows) - #165889 (Fix docs of alloc fn: Allocator API stabilized) - #165923 (Don't load/store a LLVM aggregate type when returning an array from a generic SIMD intrinsic) - #166012 (Added more queries to AdtDef in rustc_public to check for rust language types) - #166186 (OpenOptions::append: clarify docs) - #166216 (Stop using #![no_core] in profiler_builtins) - #166259 (fmt: Improve `Debug` for `FormattingOptions`) - #166263 (Show slice split results for empty and singleton slices)
…uwer Rollup of 18 pull requests Successful merges: - #164878 (Don't require `extern "llvm-intrinsic"` return structs to be `#[repr(packed)]`) - #165008 (Support `NonNull` pointers as `asm!` input operands) - #165892 (`rustc_builtin_macros` cleanup, part 10) - #165930 (Add red-green mark when dumping dep graph. Show DefIds if available) - #166280 (std: also mark doctests with skip_unsupported_miri_tests) - #166295 (use `cfg!(overflow_checks)` in `overflow_checks` intrinsic instead of `cfg!(debug_assertions)`) - #164485 (Stabilize unchecked `nonzero_ops`) - #165618 (Implement RangeIntersect on core::range types) - #165782 (Make unsafe unknown diagnostic attributes an error again) - #165833 (Deallocate with the right provenance on Windows) - #165834 (Implement tidy alphabetical --bless on Windows) - #165889 (Fix docs of alloc fn: Allocator API stabilized) - #165923 (Don't load/store a LLVM aggregate type when returning an array from a generic SIMD intrinsic) - #166012 (Added more queries to AdtDef in rustc_public to check for rust language types) - #166186 (OpenOptions::append: clarify docs) - #166216 (Stop using #![no_core] in profiler_builtins) - #166259 (fmt: Improve `Debug` for `FormattingOptions`) - #166263 (Show slice split results for empty and singleton slices)
Rollup merge of #166295 - BioTomateDE:intrinsics-stuff, r=thomcc use `cfg!(overflow_checks)` in `overflow_checks` intrinsic instead of `cfg!(debug_assertions)` The fallback implementation of the `overflow_checks()` intrinsic is currently defined as: ```rs #[rustc_intrinsic] pub const fn overflow_checks() -> bool { cfg!(debug_assertions) } ``` This seems to be an oversight from copypasting. Its docs state: > This eventually evaluates `cfg!(overflow_checks)` I changed its fallback body to `cfg!(overflow_checks)`. If this is somehow intended behavior, I'd put a comment stating that this `cfg!` is intentionally `debug_assertions` instead of `overflow_checks`. Note: The `overflow_checks` cfg *is* currently unstable, tracked at #111466. Also see <https://discord.com/channels/273534239310479360/957720175619215380/1573547547379765341>.
The fallback implementation of the
overflow_checks()intrinsic is currently defined as:This seems to be an oversight from copypasting. Its docs state:
I changed its fallback body to
cfg!(overflow_checks).If this is somehow intended behavior, I'd put a comment stating that this
cfg!is intentionallydebug_assertionsinstead ofoverflow_checks.Note: The
overflow_checkscfg is currently unstable, tracked at #111466.Also see https://discord.com/channels/273534239310479360/957720175619215380/1573547547379765341.