Skip to content

Commit

Permalink
Improve E0137 error explanatIon
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed May 27, 2016
1 parent ab7c35f commit a1e240c
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/librustc/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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##"
Expand Down

0 comments on commit a1e240c

Please sign in to comment.