This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments