]> git.proxmox.com Git - rustc.git/blob - tests/ui/parser/foreign-const-semantic-fail.stderr
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / parser / foreign-const-semantic-fail.stderr
1 error: extern items cannot be `const`
2 --> $DIR/foreign-const-semantic-fail.rs:4:11
3 |
4 LL | const A: isize;
5 | ------^
6 | |
7 | help: try using a static value: `static`
8 |
9 = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
10
11 error: extern items cannot be `const`
12 --> $DIR/foreign-const-semantic-fail.rs:6:11
13 |
14 LL | const B: isize = 42;
15 | ------^
16 | |
17 | help: try using a static value: `static`
18 |
19 = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
20
21 error: incorrect `static` inside `extern` block
22 --> $DIR/foreign-const-semantic-fail.rs:6:11
23 |
24 LL | extern "C" {
25 | ---------- `extern` blocks define existing foreign statics and statics inside of them cannot have a body
26 ...
27 LL | const B: isize = 42;
28 | ^ -- the invalid body
29 | |
30 | cannot have a body
31 |
32 = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
33
34 error: aborting due to 3 previous errors
35