]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0138.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0138.md
1 More than one function was declared with the `#[start]` attribute.
2
3 Erroneous code example:
4
5 ```compile_fail,E0138
6 #![feature(start)]
7
8 #[start]
9 fn foo(argc: isize, argv: *const *const u8) -> isize {}
10
11 #[start]
12 fn f(argc: isize, argv: *const *const u8) -> isize {}
13 // error: multiple 'start' functions
14 ```
15
16 This error indicates that the compiler found multiple functions with the
17 `#[start]` attribute. This is an error because there must be a unique entry
18 point into a Rust program. Example:
19
20 ```
21 #![feature(start)]
22
23 #[start]
24 fn foo(argc: isize, argv: *const *const u8) -> isize { 0 } // ok!
25 ```