Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improve E0138 error explanation
  • Loading branch information
GuillaumeGomez committed May 27, 2016
1 parent a1e240c commit 360d723
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/librustc/diagnostics.rs
Expand Up @@ -419,9 +419,32 @@ fn f() {} // ok!
"##,

E0138: r##"
More than one function was declared with the `#[start]` attribute.
Erroneous code example:
```compile_fail
#![feature(start)]
#[start]
fn foo(argc: isize, argv: *const *const u8) -> isize {}
#[start]
fn f(argc: isize, argv: *const *const u8) -> isize {}
// error: multiple 'start' functions
```
This error indicates that the compiler found multiple functions with the
`#[start]` attribute. This is an error because there must be a unique entry
point into a Rust program.
point into a Rust program. Example:
```
#![feature(start)]
#[start]
fn foo(argc: isize, argv: *const *const u8) -> isize {} // ok!
```
"##,

// FIXME link this to the relevant turpl chapters for instilling fear of the
Expand Down

0 comments on commit 360d723

Please sign in to comment.