Fix ICE when main is declared in an extern block

This commit is contained in:
asquared31415 2021-06-09 23:11:35 -04:00
parent 1639a16ebf
commit 9b2ba6d1a1
5 changed files with 32 additions and 2 deletions

View 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();
}

View 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