-
Notifications
You must be signed in to change notification settings - Fork 533
Document restrictions of the main function #345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This now also documents that trait and lifetime parameters aren't allowed and the newly added restriction of no where clauses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of small things.
src/crates-and-source-files.md
Outdated
|
||
* `()` | ||
* `bool` | ||
* `i32` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bool and i32 don't implement Termination at the moment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not from this PR, but binary crates are determined by the crate type, not the presence of main
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot on that page I don't like, but I wanted to keep this change self-contained.
src/crates-and-source-files.md
Outdated
<!-- `!` --> | ||
* `Result<T, E> where T: on this list, E: Error` | ||
|
||
> Note: The implementation of which return types is allowed is the unstable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are allowed.
'Is determined by'?
Thanks! |
Also updated a link for attributes and changed the first paragraph to a note.