2021-01-16 18:05:51 +00:00
|
|
|
error[E0764]: mutable references are not allowed in the final value of constants
|
2024-02-12 15:14:58 +01:00
|
|
|
--> $DIR/issue-17718-const-bad-values.rs:3:34
|
2018-07-15 14:11:54 -07:00
|
|
|
|
|
|
|
|
LL | const C1: &'static mut [usize] = &mut [];
|
2021-01-03 18:46:20 +00:00
|
|
|
| ^^^^^^^
|
2018-07-15 14:11:54 -07:00
|
|
|
|
2024-01-05 12:18:11 +01:00
|
|
|
error[E0658]: referencing statics in constants is unstable
|
2024-02-12 15:14:58 +01:00
|
|
|
--> $DIR/issue-17718-const-bad-values.rs:7:46
|
2018-07-15 14:11:54 -07:00
|
|
|
|
|
|
|
|
LL | const C2: &'static mut usize = unsafe { &mut S };
|
2019-11-19 23:16:58 +00:00
|
|
|
| ^
|
2020-01-10 13:31:36 +00:00
|
|
|
|
|
2024-01-05 12:18:11 +01:00
|
|
|
= note: see issue #119618 <https://github.com/rust-lang/rust/issues/119618> for more information
|
|
|
|
= help: add `#![feature(const_refs_to_static)]` to the crate attributes to enable
|
2024-02-05 21:24:32 +01:00
|
|
|
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
2024-01-05 12:18:11 +01:00
|
|
|
= note: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable.
|
|
|
|
= help: to fix this, the value can be extracted to a `const` and then used.
|
2018-07-15 14:11:54 -07:00
|
|
|
|
2024-08-17 14:19:34 +02:00
|
|
|
error: aborting due to 2 previous errors
|
2018-07-15 14:11:54 -07:00
|
|
|
|
2024-01-05 12:18:11 +01:00
|
|
|
Some errors have detailed explanations: E0658, E0764.
|
|
|
|
For more information about an error, try `rustc --explain E0658`.
|