Skip to content

Commit 7d12e9d

Browse files
committed
Add test for issue-36122
1 parent 3f07f1c commit 7d12e9d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn main() {
2+
extern {
3+
static symbol: [usize]; //~ ERROR: the size for values of type
4+
}
5+
println!("{}", symbol[0]);
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0277]: the size for values of type `[usize]` cannot be known at compilation time
2+
--> $DIR/issue-36122-accessing-externed-dst.rs:3:24
3+
|
4+
LL | static symbol: [usize];
5+
| ^^^^^^^ doesn't have a size known at compile-time
6+
|
7+
= help: the trait `std::marker::Sized` is not implemented for `[usize]`
8+
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)