Use platform independent types

This commit is contained in:
Oliver Scherer 2018-10-14 17:45:35 +02:00
parent 8180e1b54c
commit 4dcf49121c
2 changed files with 4 additions and 5 deletions

View File

@ -1,6 +1,5 @@
use std::os::raw::c_char;
extern "C" {
pub static mut symbol: [c_char];
pub static mut symbol: [i8];
//~^ ERROR the size for values of type `[i8]` cannot be known at compilation time
}

View File

@ -1,8 +1,8 @@
error[E0277]: the size for values of type `[i8]` cannot be known at compilation time
--> $DIR/issue-54410.rs:3:28
--> $DIR/issue-54410.rs:2:28
|
LL | pub static mut symbol: [c_char];
| ^^^^^^^^ doesn't have a size known at compile-time
LL | pub static mut symbol: [i8];
| ^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[i8]`
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>