Files
rust/library/core/tests
Jubilee 3313e760d0 Rollup merge of #132423 - RalfJung:const-eval-align-offset, r=dtolnay
remove const-support for align_offset and is_aligned

As part of the recent discussion to stabilize `ptr.is_null()` in const context, the general vibe was that it's okay for a const function to panic when the same operation would work at runtime (that's just a case of "dynamically detecting that something is not supported as a const operation"), but it is *not* okay for a const function to just return a different result.

Following that, `is_aligned` and `is_aligned_to` have their const status revoked in this PR, since they do return actively wrong results at const time. In the future we can consider having a new intrinsic or so that can check whether a pointer is "guaranteed to be aligned", but the current implementation based on `align_offset` does not have the behavior we want.

In fact `align_offset` itself behaves quite strangely in const, and that support needs a bunch of special hacks. That doesn't seem worth it. Instead, the users that can fall back to a different implementation should just use const_eval_select directly, and everything else should not be made const-callable. So this PR does exactly that, and entirely removes const support for align_offset.

Closes some tracking issues by removing the associated features:
Closes https://github.com/rust-lang/rust/issues/90962
Closes https://github.com/rust-lang/rust/issues/104203

Cc `@rust-lang/wg-const-eval` `@rust-lang/libs-api`
2024-11-03 20:08:13 -08:00
..
2024-07-21 12:05:02 -05:00
2024-02-07 16:46:28 +01:00
2022-10-08 11:48:53 +00:00
2024-07-29 08:26:52 +10:00
2024-10-09 17:17:50 -04:00
2023-04-26 02:10:22 -04:00
2024-10-15 20:30:23 -07:00
2023-04-16 11:38:52 +00:00
2024-01-11 15:04:48 +03:00
2023-12-10 10:56:22 +08:00
2024-07-29 20:33:11 +03:00
2024-07-29 08:26:52 +10:00
2023-04-16 11:38:52 +00:00
2024-05-01 22:19:11 -04:00
2024-10-17 09:33:39 -04:00
2024-09-13 15:18:30 -03:00
2023-07-12 21:38:55 -04:00
2024-09-09 16:17:34 +02:00
2024-06-19 21:44:47 +01:00
2022-09-27 19:23:52 +00:00
2024-10-16 21:24:38 +01:00
2024-11-03 17:00:44 +01:00
2024-07-29 08:26:52 +10:00
2023-11-26 08:50:39 -05:00
2024-04-24 15:27:47 -07:00
2022-12-30 14:00:42 +01:00
2023-01-02 10:33:23 -08:00
2024-01-24 14:24:57 +01:00
2022-07-08 21:18:15 +00:00