Skip to content

Commit b73bfd2

Browse files
Apply suggestions from code review
Co-authored-by: Jubilee <[email protected]>
1 parent 23b67de commit b73bfd2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

library/core/src/primitive_docs.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ mod prim_bool {}
270270
///
271271
/// # Never type fallback
272272
///
273-
/// When the compiler sees a value of type `!` it implicitly inserts a coercion (if possible),
274-
/// to allow type check to infer any type:
273+
/// When the compiler sees a value of type `!` it implicitly inserts a coercion (if possible)
274+
/// to allow type checker to infer any type:
275275
///
276276
/// ```rust,ignore (illustrative-and-has-placeholders)
277277
/// // this
@@ -297,8 +297,13 @@ mod prim_bool {}
297297
/// { absurd(panic!()) }; // error: can't infer the type of `absurd`
298298
/// ```
299299
///
300-
/// To prevent such errors, compiler remembers where it inserted `absurd` calls, and if it can't
301-
/// infer their type, it sets the type to the fallback type. `{ absurd::<Fallback>(panic!()) };`.
300+
/// To prevent such errors, the compiler remembers where it inserted `absurd` calls, and
301+
/// if it can't infer their type, it sets the type to the fallback type:
302+
/// ```rust, ignore
303+
/// type Fallback = /* An arbitrarily selected type! */;
304+
/// { absurd::<Fallback>(panic!()) }
305+
/// ```
306+
///
302307
/// This is what is known as "never type fallback".
303308
///
304309
/// Historically fallback was [`()`], causing confusing behavior where `!` spontaneously coerced

0 commit comments

Comments
 (0)