Commit Graph

14 Commits

Author SHA1 Message Date
Ben Kimock e36dc78edd Add some track_caller info to precondition panics 2025-05-21 09:10:06 -04:00
scottmcm 4626521831 Update tests/mir-opt/inline/unchecked_shifts.rs
Co-authored-by: Waffle Maybe <waffle.lapkin@gmail.com>
2024-04-02 17:21:20 +00:00
Scott McMurray 0601f0c66d De-LLVM the unchecked shifts [MCP#693]
This is just one part of the MCP, but it's the one that IMHO removes the most noise from the standard library code.

Seems net simpler this way, since MIR already supported heterogeneous shifts anyway, and thus it's not more work for backends than before.
2024-03-30 03:32:11 -07:00
Ben Kimock 07994c9310 Enable more mir-opt tests in debug builds 2024-03-22 20:14:39 -04:00
许杰友 Jieyou Xu (Joe) 6e48b96692 [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
bors 75b064d269 Auto merge of #117029 - rmehri01:mir_opt_filecheck_inline_tests, r=cjgillot
Add FileCheck annotations to MIR-opt inlining tests

Part of #116971, adds FileCheck annotations to MIR-opt tests in `tests/mir-opt/inline`.

I left out a few (such as `inline_cycle`) where it mentioned that the particular outcome of inlining isn't important, just that the inliner doesn't get stuck in an infinite loop.

r? cjgillot
2023-11-01 20:37:38 +00:00
Matthias Krüger 260e07b0cb Rollup merge of #115626 - clarfonthey:unchecked-math, r=thomcc
Clean up unchecked_math, separate out unchecked_shifts

Tracking issue: #85122

Changes:

1. Remove `const_inherent_unchecked_arith` flag and make const-stability flags the same as the method feature flags. Given the number of other unsafe const fns already stabilised, it makes sense to just stabilise these in const context when they're stabilised.
2. Move `unchecked_shl` and `unchecked_shr` into a separate `unchecked_shifts` flag, since the semantics for them are unclear and they'll likely be stabilised separately as a result.
3. Add an `unchecked_neg` method exclusively to signed integers, under the `unchecked_neg` flag. This is because it's a new API and probably needs some time to marinate before it's stabilised, and while it *would* make sense to have a similar version for unsigned integers since `checked_neg` also exists for those there is absolutely no case where that would be a good idea, IMQHO.

The longer-term goal here is to prepare the `unchecked_math` methods for an FCP and stabilisation since they've existed for a while, their semantics are clear, and people seem in favour of stabilising them.
2023-11-01 11:29:41 +01:00
Ryan Mehri 6e047c07a6 FileCheck unchecked_shifts 2023-10-25 15:25:38 -07:00
Camille GILLOT 4ff03cd1a4 Allow to run filecheck in mir-opt tests. 2023-10-19 15:51:52 +00:00
ltdk 91405ab74a Clean up unchecked_math, separate out unchecked_shifts 2023-10-13 02:17:08 -04:00
Scott McMurray 3ec4eeddef [libs] Simplify unchecked_{shl,shr}
There's no need for the `const_eval_select` dance here.  And while I originally wrote the `.try_into().unwrap_unchecked()` implementation here, it's kinda a mess in MIR -- this new one is substantially simpler, as shown by the old one being above the inlining threshold but the new one being below it.
2023-06-16 16:03:19 -07:00
Pietro Albini 070cc836e9 properly mark tests that require panic=abort 2023-06-12 09:34:15 +02:00
Gary Guo 04126398c2 Ignore many tests on wasm32 2023-04-06 10:08:07 +01:00
Ben Kimock a98ddb6de1 Enable inlining of diverging functions 2023-03-18 14:29:13 -04:00