Skip to content

Mention Result<!, E> in addition to Result<T, !> on never docs #48096

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
clarfonthey opened this issue Feb 9, 2018 · 1 comment
Closed

Mention Result<!, E> in addition to Result<T, !> on never docs #48096

clarfonthey opened this issue Feb 9, 2018 · 1 comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@clarfonthey
Copy link
Contributor

clarfonthey commented Feb 9, 2018

While the latter is mentioned as a way of saying "this computation will never fail if it returns," the former is a way of saying "this computation will never return unless it fails."

For example, it makes a lot of sense to make Command::exec return Result<!, Error>, even though it currently just returns Error (which can't be changed without breaking stability guarantees). Demonstrating both cases seems like a good idea.

@scottmcm
Copy link
Member

I also think Result<!, E> makes a very interesting return from main.

@pietroalbini pietroalbini added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels Feb 10, 2018
kennytm added a commit to kennytm/rust that referenced this issue May 9, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

3 participants