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.

28 lines
1.1 KiB
Plaintext
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
2018-12-25 15:56:47 +00:00
--> $DIR/issue-17718-const-bad-values.rs:1:34
2018-07-15 21:11:54 +00:00
|
LL | const C1: &'static mut [usize] = &mut [];
| ^^^^^^^
2018-07-15 21:11:54 +00:00
2020-01-10 13:31:36 +00:00
error[E0013]: constants cannot refer to statics
2019-11-19 23:16:58 +00:00
--> $DIR/issue-17718-const-bad-values.rs:5:46
2018-07-15 21:11:54 +00: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
|
= help: consider extracting the value of the `static` to a `const`, and referring to that
2018-07-15 21:11:54 +00:00
2020-01-10 13:31:36 +00:00
error[E0013]: constants cannot refer to statics
2020-01-08 17:02:10 +00:00
--> $DIR/issue-17718-const-bad-values.rs:5:46
|
LL | const C2: &'static mut usize = unsafe { &mut S };
| ^
2020-01-10 13:31:36 +00:00
|
= help: consider extracting the value of the `static` to a `const`, and referring to that
2023-10-04 18:34:50 +00:00
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2020-01-08 17:02:10 +00:00
error: aborting due to 3 previous errors
2018-07-15 21:11:54 +00:00
2020-06-18 19:52:37 +00:00
Some errors have detailed explanations: E0013, E0764.
2018-07-15 21:11:54 +00:00
For more information about an error, try `rustc --explain E0013`.