Skip to content

Commit

Permalink
Explain why the 0 is a u32
Browse files Browse the repository at this point in the history
  • Loading branch information
camelid committed Aug 30, 2020
1 parent 7e2548f commit 37ea97c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions library/std/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ mod prim_bool {}
///
/// The reason is that, in the first example, there are many possible types that `!` could coerce
/// to, because the function can return one of many concrete types. However, in the second example,
/// the `else` branch returns a `0` of type `u32`, which is a concrete type that `!` can be coerced
/// to. See issue [#36375] for more information on this quirk of `!`.
/// the `else` branch returns a `0`, which the compiler infers from the return type to be of type
/// `u32`, which is a concrete type that `!` can be coerced to. See issue [#36375] for more
/// information on this quirk of `!`.
///
/// [#36375]: https://github.com/rust-lang/rust/issues/36375
///
Expand Down

0 comments on commit 37ea97c

Please sign in to comment.