diff options
Diffstat (limited to 'compiler/rustc_error_codes/src/error_codes/E0138.md')
-rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0138.md | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0138.md b/compiler/rustc_error_codes/src/error_codes/E0138.md new file mode 100644 index 000000000..3f5eaea9f --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0138.md @@ -0,0 +1,25 @@ +More than one function was declared with the `#[start]` attribute. + +Erroneous code example: + +```compile_fail,E0138 +#![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. Example: + +``` +#![feature(start)] + +#[start] +fn foo(argc: isize, argv: *const *const u8) -> isize { 0 } // ok! +``` |