]>
Commit | Line | Data |
---|---|---|
60c5eb7d XL |
1 | More than one function was declared with the `#[main]` attribute. |
2 | ||
3 | Erroneous code example: | |
4 | ||
5 | ```compile_fail,E0137 | |
6 | #![feature(main)] | |
7 | ||
8 | #[main] | |
9 | fn foo() {} | |
10 | ||
11 | #[main] | |
12 | fn f() {} // error: multiple functions with a `#[main]` attribute | |
13 | ``` | |
14 | ||
15 | This error indicates that the compiler found multiple functions with the | |
16 | `#[main]` attribute. This is an error because there must be a unique entry | |
17 | point into a Rust program. Example: | |
18 | ||
19 | ``` | |
20 | #![feature(main)] | |
21 | ||
22 | #[main] | |
23 | fn f() {} // ok! | |
24 | ``` |