@@ -319,6 +319,83 @@ async fn foo() {}
319319
320320Switch to the Rust 2018 edition to use `async fn`.
321321"## ,
322+
323+ // This shouldn't really ever trigger since the repeated value error comes first
324+ E0136 : r##"
325+ A binary can only have one entry point, and by default that entry point is the
326+ function `main()`. If there are multiple such functions, please rename one.
327+ "## ,
328+
329+ E0137 : r##"
330+ More than one function was declared with the `#[main]` attribute.
331+
332+ Erroneous code example:
333+
334+ ```compile_fail,E0137
335+ #![feature(main)]
336+
337+ #[main]
338+ fn foo() {}
339+
340+ #[main]
341+ fn f() {} // error: multiple functions with a `#[main]` attribute
342+ ```
343+
344+ This error indicates that the compiler found multiple functions with the
345+ `#[main]` attribute. This is an error because there must be a unique entry
346+ point into a Rust program. Example:
347+
348+ ```
349+ #![feature(main)]
350+
351+ #[main]
352+ fn f() {} // ok!
353+ ```
354+ "## ,
355+
356+ E0138 : r##"
357+ More than one function was declared with the `#[start]` attribute.
358+
359+ Erroneous code example:
360+
361+ ```compile_fail,E0138
362+ #![feature(start)]
363+
364+ #[start]
365+ fn foo(argc: isize, argv: *const *const u8) -> isize {}
366+
367+ #[start]
368+ fn f(argc: isize, argv: *const *const u8) -> isize {}
369+ // error: multiple 'start' functions
370+ ```
371+
372+ This error indicates that the compiler found multiple functions with the
373+ `#[start]` attribute. This is an error because there must be a unique entry
374+ point into a Rust program. Example:
375+
376+ ```
377+ #![feature(start)]
378+
379+ #[start]
380+ fn foo(argc: isize, argv: *const *const u8) -> isize { 0 } // ok!
381+ ```
382+ "## ,
383+
384+ E0601 : r##"
385+ No `main` function was found in a binary crate. To fix this error, add a
386+ `main` function. For example:
387+
388+ ```
389+ fn main() {
390+ // Your program will start here.
391+ println!("Hello world!");
392+ }
393+ ```
394+
395+ If you don't know the basics of Rust, you can go look to the Rust Book to get
396+ started: https://doc.rust-lang.org/book/
397+ "## ,
398+
322399;
323400 E0226 , // only a single explicit lifetime bound is permitted
324401 E0472 , // asm! is unsupported on this target
0 commit comments