summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0137.md
blob: d4e19170f3f7b5ce699a9f2f8e2bcc4a3f543563 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#### Note: this error code is no longer emitted by the compiler.

More than one function was declared with the `#[main]` attribute.

Erroneous code example:

```compile_fail
#![feature(main)]

#[main]
fn foo() {}

#[main]
fn f() {} // error: multiple functions with a `#[main]` attribute
```

This error indicates that the compiler found multiple functions with the
`#[main]` attribute. This is an error because there must be a unique entry
point into a Rust program. Example:

```compile_fail
#![feature(main)]

#[main]
fn f() {} // ok!
```