Generally, when one does something on nightly that would work with a feature gate, but the feature gate is missing, the error should indicate the missing gate. For some const features, that is currently not the case, for example:
#![feature(const_raw_ptr_deref)]
// missing gate: #![feature(const_mut_refs)]
const WRITE: () = unsafe {
*std::ptr::null_mut() = 0;
};
fn main() {
}
error[E0019]: constant contains unimplemented expression type
--> src/main.rs:5:5
|
5 | *std::ptr::null_mut() = 0;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
This got triggered by #71630, but is orthogonal to the discussion around the unleash flag in #71631.
(I did not try to exhaustively explore this issue for all const gates.)
Cc @rust-lang/wg-const-eval
This issue has been assigned to @mibac138 via this comment.
Generally, when one does something on nightly that would work with a feature gate, but the feature gate is missing, the error should indicate the missing gate. For some const features, that is currently not the case, for example:
This got triggered by #71630, but is orthogonal to the discussion around the unleash flag in #71631.
(I did not try to exhaustively explore this issue for all const gates.)
Cc @rust-lang/wg-const-eval
This issue has been assigned to @mibac138 via this comment.