E0138 - Error codes index
Description: Book listing all Rust error codes

# Error code E0138

More than one function was declared with the `#[start]` attribute.

Erroneous code example:

    #![allow(unused)]
    #![feature(start)]

    fn main() {
    #[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:

    #![allow(unused)]
    #![feature(start)]

    fn main() {
    #[start]
    fn foo(argc: isize, argv: *const *const u8) -> isize { 0 } // ok!
    }