Description
#79684 removed debug_assert!
from intrinsic::copy[_nonoverlapping]
to make it const
:
rust/library/core/src/intrinsics.rs
Lines 2045 to 2049 in 5dab47d
rust/library/core/src/intrinsics.rs
Lines 2130 to 2131 in 5dab47d
We can't do these checks at compile-time, since
is_aligned_and_not_null
, for example, involves ptr->int cast to check the alignment:rust/library/core/src/intrinsics.rs
Lines 1950 to 1952 in 5dab47d
So, as the FIXME suggests, we should enable the checks only at runtime. Recently const_eval_select
intrinsic was implemented, it allows for exactly this use case - running different code in CTFE and runtime.
cc @rust-lang/lang, @rust-lang/libs and @rust-lang/wg-const-eval (it seems like use of const_eval_select
requires approval of all of the above teams)
@rustbot label +T-lang +T-libs +A-const-eval +A-const-fn