2022-08-10 02:42:10 -05:00
|
|
|
const_eval_unstable_in_stable =
|
2022-06-28 23:26:05 -05:00
|
|
|
const-stable function cannot use `#[feature({$gate})]`
|
2022-08-10 02:42:10 -05:00
|
|
|
.unstable_sugg = if it is not part of the public API, make this function unstably const
|
|
|
|
.bypass_sugg = otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
|
2022-06-28 23:46:01 -05:00
|
|
|
|
2022-08-10 02:42:10 -05:00
|
|
|
const_eval_thread_local_access =
|
2022-06-29 00:32:32 -05:00
|
|
|
thread-local statics cannot be accessed at compile-time
|
|
|
|
|
2022-08-10 02:42:10 -05:00
|
|
|
const_eval_static_access =
|
2022-07-07 22:46:18 -05:00
|
|
|
{$kind}s cannot refer to statics
|
2022-06-29 00:32:32 -05:00
|
|
|
.help = consider extracting the value of the `static` to a `const`, and referring to that
|
2022-08-10 02:42:10 -05:00
|
|
|
.teach_note = `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable.
|
|
|
|
.teach_help = To fix this, the value can be extracted to a `const` and then used.
|
2022-06-29 00:46:25 -05:00
|
|
|
|
2022-08-10 02:42:10 -05:00
|
|
|
const_eval_raw_ptr_to_int =
|
2022-06-29 00:46:25 -05:00
|
|
|
pointers cannot be cast to integers during const eval
|
|
|
|
.note = at compile-time, pointers do not have an integer value
|
|
|
|
.note2 = avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
|
|
|
|
|
2022-08-10 02:42:10 -05:00
|
|
|
const_eval_raw_ptr_comparison =
|
2022-06-29 00:46:25 -05:00
|
|
|
pointers cannot be reliably compared during const eval
|
|
|
|
.note = see issue #53020 <https://github.com/rust-lang/rust/issues/53020> for more information
|
|
|
|
|
2022-08-10 02:42:10 -05:00
|
|
|
const_eval_panic_non_str = argument to `panic!()` in a const context must have type `&str`
|
2022-06-29 01:22:15 -05:00
|
|
|
|
2022-08-10 02:42:10 -05:00
|
|
|
const_eval_mut_deref =
|
2022-07-07 22:46:18 -05:00
|
|
|
mutation through a reference is not allowed in {$kind}s
|
|
|
|
|
2022-08-10 02:42:10 -05:00
|
|
|
const_eval_transient_mut_borrow = mutable references are not allowed in {$kind}s
|
2022-07-07 22:46:18 -05:00
|
|
|
|
2022-08-10 02:42:10 -05:00
|
|
|
const_eval_transient_mut_borrow_raw = raw mutable references are not allowed in {$kind}s
|