2020-06-15 17:05:24 +00:00
|
|
|
error[E0019]: mutable references are not allowed in 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 [];
|
2020-06-15 17:05:24 +00:00
|
|
|
| ^^^^^^^ `&mut` is only allowed in `const fn`
|
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
|
2020-01-08 17:02:10 +00:00
|
|
|
|
2020-06-15 17:05:24 +00:00
|
|
|
error[E0019]: mutable references are not allowed in constants
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/issue-17718-const-bad-values.rs:5:41
|
2018-07-15 21:11:54 +00:00
|
|
|
|
|
|
|
|
LL | const C2: &'static mut usize = unsafe { &mut S };
|
2020-06-15 17:05:24 +00:00
|
|
|
| ^^^^^^ `&mut` is only allowed in `const fn`
|
2018-07-15 21:11:54 +00:00
|
|
|
|
2020-01-08 17:02:10 +00:00
|
|
|
error: aborting due to 4 previous errors
|
2018-07-15 21:11:54 +00:00
|
|
|
|
2020-06-15 17:05:24 +00:00
|
|
|
Some errors have detailed explanations: E0013, E0019.
|
2018-07-15 21:11:54 +00:00
|
|
|
For more information about an error, try `rustc --explain E0013`.
|