]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #67305 - kappa:patch-1, r=jonas-schievink
authorMazdak Farrokhzad <twingoow@gmail.com>
Sun, 15 Dec 2019 04:57:28 +0000 (05:57 +0100)
committerGitHub <noreply@github.com>
Sun, 15 Dec 2019 04:57:28 +0000 (05:57 +0100)
Doc typo

1  2 
src/libcore/num/mod.rs

diff --combined src/libcore/num/mod.rs
index 88c14dfe7d1f82494e2f88f84abec3ba6da11419,d75228454128500652665057d7dbb28b140bd4bb..33715418ffd73d7ff6d4bc0d63260d43e51fbd3c
@@@ -4,7 -4,6 +4,7 @@@
  
  #![stable(feature = "rust1", since = "1.0.0")]
  
 +use crate::convert::Infallible;
  use crate::fmt;
  use crate::intrinsics;
  use crate::mem;
@@@ -144,7 -143,7 +144,7 @@@ NonZeroI8 NonZeroI16 NonZeroI32 NonZero
  
  /// Provides intentionally-wrapped arithmetic on `T`.
  ///
- /// Operations like `+` on `u32` values is intended to never overflow,
+ /// Operations like `+` on `u32` values are intended to never overflow,
  /// and in some debug configurations overflow is detected and results
  /// in a panic. While most arithmetic falls into this category, some
  /// code explicitly expects and relies upon modular arithmetic (e.g.,
@@@ -5033,18 -5032,8 +5033,18 @@@ impl fmt::Display for TryFromIntError 
  }
  
  #[stable(feature = "try_from", since = "1.34.0")]
 +impl From<Infallible> for TryFromIntError {
 +    fn from(x: Infallible) -> TryFromIntError {
 +        match x {}
 +    }
 +}
 +
 +#[unstable(feature = "never_type", issue = "35121")]
  impl From<!> for TryFromIntError {
      fn from(never: !) -> TryFromIntError {
 +        // Match rather than coerce to make sure that code like
 +        // `From<Infallible> for TryFromIntError` above will keep working
 +        // when `Infallible` becomes an alias to `!`.
          match never {}
      }
  }