about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-01-30 02:25:56 +0000
committerbors <bors@rust-lang.org>2020-01-30 02:25:56 +0000
commit3024c4e7396106eacedd7eb94d7b681b3e82f78a (patch)
treeb714bdf1ab25a8c68bdf5ba4a26ab93e792b1da0 /src/libcore
parentdc92dfc50725f21f775c059413e1d06d725daacf (diff)
parent9f497f93aa47f69626b9892747c6374349d5b989 (diff)
downloadrust-3024c4e7396106eacedd7eb94d7b681b3e82f78a.tar.gz
rust-3024c4e7396106eacedd7eb94d7b681b3e82f78a.zip
Auto merge of #68659 - Dylan-DPC:rollup-zo7zi9f, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #66648 (Implement clone_from for BTreeMap and BTreeSet)
 - #68468 (BTreeMap: tag and explain unsafe internal functions or assert preconditions)
 - #68626 (Use termize instead of term_size)
 - #68640 (Document remaining undocumented `From` implementations for IPs)
 - #68651 (Document `From` implementation for NonZero nums)
 - #68655 (Fix revision annotations in borrowck-feature-nll-overrides-migrate)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/num/mod.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs
index 91848abd68d..5d2c1d0de2c 100644
--- a/src/libcore/num/mod.rs
+++ b/src/libcore/num/mod.rs
@@ -91,8 +91,12 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s
 
             #[stable(feature = "from_nonzero", since = "1.31.0")]
             impl From<$Ty> for $Int {
-                fn from(nonzero: $Ty) -> Self {
-                    nonzero.0
+                doc_comment! {
+                    concat!(
+"Converts a `", stringify!($Ty), "` into an `", stringify!($Int), "`"),
+                    fn from(nonzero: $Ty) -> Self {
+                        nonzero.0
+                    }
                 }
             }