Fix ICE when main is declared in an extern block
This commit is contained in:
parent
1639a16ebf
commit
9b2ba6d1a1
5 changed files with 32 additions and 2 deletions
7
src/test/ui/extern/extern-main-issue-86110.rs
vendored
Normal file
7
src/test/ui/extern/extern-main-issue-86110.rs
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// missing and missing2 exist to make sure that the error only happens on a `main` declaration
|
||||
extern "C" {
|
||||
fn missing();
|
||||
fn main();
|
||||
//~^ the `main` function cannot be declared in an `extern` block
|
||||
fn missing2();
|
||||
}
|
||||
8
src/test/ui/extern/extern-main-issue-86110.stderr
vendored
Normal file
8
src/test/ui/extern/extern-main-issue-86110.stderr
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
error: the `main` function cannot be declared in an `extern` block
|
||||
--> $DIR/extern-main-issue-86110.rs:4:5
|
||||
|
|
||||
LL | fn main();
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue