os-rust/tests/ui/consts/issue-17718-const-bad-values.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
1.1 KiB
Text
Raw Normal View History

2021-01-16 18:05:51 +00:00
error[E0764]: mutable references are not allowed in the final value of constants
--> $DIR/issue-17718-const-bad-values.rs:3:34
2018-07-15 14:11:54 -07:00
|
LL | const C1: &'static mut [usize] = &mut [];
| ^^^^^^^
2018-07-15 14:11:54 -07:00
error[E0658]: referencing statics in constants is unstable
--> $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
|
= 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
= 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
Some errors have detailed explanations: E0658, E0764.
For more information about an error, try `rustc --explain E0658`.