Document multiple return types in main
> UTF8BOM : `\uFEFF`
> SHEBANG : `#!` ~[`[` `\n`] ~`\n`<sup>*</sup>
-Although Rust, like any other language, can be implemented by an interpreter as
-well as a compiler, the only existing implementation is a compiler,
-and the language has
-always been designed to be compiled. For these reasons, this section assumes a
-compiler.
+
+> Note: Although Rust, like any other language, can be implemented by an
+> interpreter as well as a compiler, the only existing implementation is a
+> compiler,and the language has always been designed to be compiled. For these
+> reasons, this section assumes a compiler.
Rust's semantics obey a *phase distinction* between compile-time and
run-time.[^phase-distinction] Semantic rules that have a *static
@@ -66,9 +66,17 @@ apply to the crate as a whole.
#![warn(non_camel_case_types)]
```
-A crate that contains a `main` function can be compiled to an executable. If a
-`main` function is present, its return type must be `()`
-("[unit]") and it must take no arguments.
+A crate that contains a `main` [function] can be compiled to an executable. If a
+`main` function is present, it must take no arguments and its return type must
+be one of the following:
+
+* `()`
+* `bool`
+* `i32`
+* `Result<T, E> where T: on this list, E: Error`
+
+> Note: The implementation of which return types is allowed is the unstable
+> [`Termination`] trait.
The optional [_UTF8 byte order mark_] (UTF8BOM production) indicates that the
file is encoded in UTF8. It can only occur at the beginning of the file and
@@ -98,9 +106,11 @@ fn main() {
[module]: items/modules.html
[module path]: paths.html
-[attributes]: items-and-attributes.html
+[attributes]: attributes.html
[unit]: types.html#tuple-types
[_InnerAttribute_]: attributes.html
[_Item_]: items.html
[_shebang_]: https://en.wikipedia.org/wiki/Shebang_(Unix)
[_utf8 byte order mark_]: https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8
+[function]: items/functions.html
+[`Termination`]: ../std/process/trait.Termination.html
\ No newline at end of file
