File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -419,9 +419,32 @@ fn f() {} // ok!
419
419
"## ,
420
420
421
421
E0138 : r##"
422
+ More than one function was declared with the `#[start]` attribute.
423
+
424
+ Erroneous code example:
425
+
426
+ ```compile_fail
427
+ #![feature(start)]
428
+
429
+ #[start]
430
+ fn foo(argc: isize, argv: *const *const u8) -> isize {}
431
+
432
+ #[start]
433
+ fn f(argc: isize, argv: *const *const u8) -> isize {}
434
+ // error: multiple 'start' functions
435
+ ```
436
+
422
437
This error indicates that the compiler found multiple functions with the
423
438
`#[start]` attribute. This is an error because there must be a unique entry
424
- point into a Rust program.
439
+ point into a Rust program. Example:
440
+
441
+
442
+ ```
443
+ #![feature(start)]
444
+
445
+ #[start]
446
+ fn foo(argc: isize, argv: *const *const u8) -> isize {} // ok!
447
+ ```
425
448
"## ,
426
449
427
450
// FIXME link this to the relevant turpl chapters for instilling fear of the
You can’t perform that action at this time.
0 commit comments