Oli Scherer

Results 704 comments of Oli Scherer

Note that we can "just" add such a `std::is_constant_evaluated` function and make it `unsafe` to make it clear what's going on. The unsafe documentation would then state that the result...

We have changed course. Discussion is in https://github.com/rust-lang/rust/pull/64683/files/223c832b3894fe6ce6d61d4f459f0aa827bec264#discussion_r327153517 The TLDR is that we'd create an intrinsic ```rust pub fn const_eval_select(arg: ARG, called_in_const: F, called_at_rt: G) -> RET; ``` that calls...

I think we race-conditioned on posting. See my above post for a solution that is much simpler to implement, since it doesn't pollute the const part of a function with...

We should probably open an issue in the stdarch repository to kick off the discussion on whether most (all?) intrinsics that are "just math" should get this treatment.

Here's an example of how to wrap `_mulx_u64`: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=fceb186657495c471f96667a4e7b79e9

we can "just" rename `const_eval_select` and create an intrinsic that takes an additional const generic string argument, which can then be used via some flag. So if you pass no...

> Regarding `const` and `asm!`, I'm curious if there might be some way to integrate `const_eval_select` into CPU feature detection macros like `is_x86_feature_detected!`. Not exactly. The problem is that you...

Further datapoint: we could use unconst in the future to mark functions explicitly not meant to be const. then, in a future edition we can remove the need to mark...

> Adding another keyword like unconst which means essentially the same thing (but for a different set of operations), feels like it does not add any gains. The counterargument is...

There is now an RFC with a way to permit arbitrary `unsafe` (if there is an impl for it): https://github.com/rust-lang/rfcs/pull/3016 I'm going ahead and close this issue