File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -270,8 +270,8 @@ mod prim_bool {}
270
270
///
271
271
/// # Never type fallback
272
272
///
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:
275
275
///
276
276
/// ```rust,ignore (illustrative-and-has-placeholders)
277
277
/// // this
@@ -297,8 +297,13 @@ mod prim_bool {}
297
297
/// { absurd(panic!()) }; // error: can't infer the type of `absurd`
298
298
/// ```
299
299
///
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
+ ///
302
307
/// This is what is known as "never type fallback".
303
308
///
304
309
/// Historically fallback was [`()`], causing confusing behavior where `!` spontaneously coerced
You can’t perform that action at this time.
0 commit comments