Add test for issue-36122
This commit is contained in:
parent
ce36ab2b06
commit
4e621a8b0c
2 changed files with 18 additions and 0 deletions
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…
Add table
Reference in a new issue