1
Fork 0

cannot have divergence -> cannot diverge

This commit is contained in:
Camelid 2020-08-29 20:35:58 -07:00 committed by GitHub
parent 4aae781407
commit fd985e29dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -194,9 +194,9 @@ mod prim_bool {}
/// # `!` and traits /// # `!` and traits
/// ///
/// When writing your own traits, `!` should have an `impl` whenever there is an obvious `impl` /// 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 /// which doesn't `panic!`. The reason is that functions returning an `impl Trait` cannot diverge,
/// divergence, i.e., returning `!`, as their only possible code path. As an example, this code /// i.e., returning `!`, as their only possible code path. As an example, this code doesn't
/// doesn't compile: /// compile:
/// ///
/// ```compile_fail /// ```compile_fail
/// use core::ops::Add; /// use core::ops::Add;