]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0137.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0137.md
1 #### Note: this error code is no longer emitted by the compiler.
2
3 More than one function was declared with the `#[main]` attribute.
4
5 Erroneous code example:
6
7 ```compile_fail
8 #![feature(main)]
9
10 #[main]
11 fn foo() {}
12
13 #[main]
14 fn f() {} // error: multiple functions with a `#[main]` attribute
15 ```
16
17 This error indicates that the compiler found multiple functions with the
18 `#[main]` attribute. This is an error because there must be a unique entry
19 point into a Rust program. Example:
20
21 ```compile_fail
22 #![feature(main)]
23
24 #[main]
25 fn f() {} // ok!
26 ```