Improve E0137 error explanatIon

This commit is contained in:
Guillaume Gomez 2016-05-27 21:45:15 +02:00
parent ab7c35fa0f
commit a1e240ccec

View File

@ -392,9 +392,30 @@ function `main()`. If there are multiple such functions, please rename one.
"##,
E0137: r##"
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.
point into a Rust program. Example:
```
#![feature(main)]
#[main]
fn f() {} // ok!
```
"##,
E0138: r##"