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