Skip to content

Commit f15b529

Browse files
committed
More restrictions on main
1 parent 7a4edcd commit f15b529

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/crates-and-source-files.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,14 @@ apply to the crate as a whole.
6767
```
6868

6969
A crate that contains a `main` [function] can be compiled to an executable. If a
70-
`main` function is present, it must take no arguments and its return type must
71-
be one of the following:
70+
`main` function is present, it must take no arguments, must not declare any
71+
[trait or lifetime bounds], must not have any [where clauses], and its return
72+
type must be one of the following:
7273

7374
* `()`
7475
* `bool`
7576
* `i32`
77+
<!-- `!` -->
7678
* `Result<T, E> where T: on this list, E: Error`
7779

7880
> Note: The implementation of which return types is allowed is the unstable
@@ -113,4 +115,6 @@ fn main() {
113115
[_shebang_]: https://en.wikipedia.org/wiki/Shebang_(Unix)
114116
[_utf8 byte order mark_]: https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8
115117
[function]: items/functions.html
116-
[`Termination`]: ../std/process/trait.Termination.html
118+
[`Termination`]: ../std/process/trait.Termination.html
119+
[where clause]: items/where-clauses.html
120+
[trait or lifetime bounds]: trait-bounds.html

0 commit comments

Comments
 (0)