Skip to content
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

Add info about ! and impl Trait #76099

Merged
merged 13 commits into from
Sep 2, 2020
6 changes: 3 additions & 3 deletions library/std/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ mod prim_bool {}
/// # `!` and traits
///
/// When writing your own traits, `!` should have an `impl` whenever there is an obvious `impl`
/// which doesn't `panic!`. The reason is that functions returning an `impl Trait` cannot have
/// divergence, i.e., returning `!`, as their only possible code path. As an example, this code
/// doesn't compile:
/// which doesn't `panic!`. The reason is that functions returning an `impl Trait` cannot diverge,
/// i.e., returning `!`, as their only possible code path. As an example, this code doesn't
camelid marked this conversation as resolved.
Show resolved Hide resolved
/// compile:
///
/// ```compile_fail
/// use core::ops::Add;
Expand Down