mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
Add test for issue-36122
This commit is contained in:
parent
ce36ab2b06
commit
4e621a8b0c
6
src/test/ui/extern/issue-36122-accessing-externed-dst.rs
vendored
Normal file
6
src/test/ui/extern/issue-36122-accessing-externed-dst.rs
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
fn main() {
|
||||
extern {
|
||||
static symbol: [usize]; //~ ERROR: the size for values of type
|
||||
}
|
||||
println!("{}", symbol[0]);
|
||||
}
|
12
src/test/ui/extern/issue-36122-accessing-externed-dst.stderr
vendored
Normal file
12
src/test/ui/extern/issue-36122-accessing-externed-dst.stderr
vendored
Normal 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`.
|
Loading…
Reference in New Issue
Block a user