rust/src/test/ui/issues/issue-17718-const-bad-values.stderr

33 lines
1.3 KiB
Plaintext
Raw Normal View History

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 [];
| ^^^^^^^ `&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
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 };
| ^^^^^^ `&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
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`.