Skip to content

Commit 0d9a2ab

Browse files
authored
It's only an issue without an impl Trait for !
1 parent fd985e2 commit 0d9a2ab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/std/src/primitive_docs.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ mod prim_bool {}
194194
/// # `!` and traits
195195
///
196196
/// When writing your own traits, `!` should have an `impl` whenever there is an obvious `impl`
197-
/// which doesn't `panic!`. The reason is that functions returning an `impl Trait` cannot diverge,
198-
/// i.e., returning `!`, as their only possible code path. As an example, this code doesn't
199-
/// compile:
197+
/// which doesn't `panic!`. The reason is that functions returning an `impl Trait` where `!`
198+
/// does not have an `impl` of `Trait` cannot diverge as their only possible code path. In other
199+
/// words, they can't return `!` from every code path. As an example, this code doesn't compile:
200200
///
201201
/// ```compile_fail
202202
/// use core::ops::Add;
@@ -206,7 +206,7 @@ mod prim_bool {}
206206
/// }
207207
/// ```
208208
///
209-
/// While this code does:
209+
/// But this code does:
210210
///
211211
/// ```
212212
/// use core::ops::Add;

0 commit comments

Comments
 (0)