Add test for issue-36122

This commit is contained in:
Yuki Okushi 2019-11-14 16:50:32 +09:00
parent ce36ab2b06
commit 4e621a8b0c
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,6 @@
fn main() {
extern {
static symbol: [usize]; //~ ERROR: the size for values of type
}
println!("{}", symbol[0]);
}

View File

@ -0,0 +1,12 @@
error[E0277]: the size for values of type `[usize]` cannot be known at compilation time
--> $DIR/issue-36122-accessing-externed-dst.rs:3:24
|
LL | static symbol: [usize];
| ^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[usize]`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.