2018-10-11 16:02:00 +00:00
error[E0277]: the size for values of type `[i8]` cannot be known at compilation time
2018-10-14 15:45:35 +00:00
--> $DIR/issue-54410.rs:2:28
2018-10-11 16:02:00 +00:00
|
2018-10-14 15:45:35 +00:00
LL | pub static mut symbol: [i8];
| ^^^^ doesn't have a size known at compile-time
2018-10-11 16:02:00 +00:00
|
2020-09-02 07:40:56 +00:00
= help: the trait `Sized` is not implemented for `[i8]`
2018-10-11 16:02:00 +00:00
2024-02-17 19:01:56 +00:00
warning: creating a shared reference to mutable static is discouraged
2024-02-09 12:17:55 +00:00
--> $DIR/issue-54410.rs:7:31
|
LL | println!("{:p}", unsafe { &symbol });
2024-02-17 19:01:56 +00:00
| ^^^^^^^ shared reference to mutable static
2024-02-09 12:17:55 +00:00
|
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
2024-02-17 19:01:56 +00:00
= note: this will be a hard error in the 2024 edition
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
= note: `#[warn(static_mut_refs)]` on by default
help: use `addr_of!` instead to create a raw pointer
2024-02-09 12:17:55 +00:00
|
LL | println!("{:p}", unsafe { addr_of!(symbol) });
| ~~~~~~~~~~~~~~~~
error: aborting due to 1 previous error; 1 warning emitted
2018-10-11 16:02:00 +00:00
For more information about this error, try `rustc --explain E0277`.