about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-07-12 23:37:39 +0000
committerbors <bors@rust-lang.org>2019-07-12 23:37:39 +0000
commite13fe7ff5e482b626714ac6ec41b8d44e7c22ed1 (patch)
treea060f5b049425798bdf7dc8470ae34c4e7e5b22b /src/libcore
parent71f9384e3bec467158a628e2d11e77ffada16a90 (diff)
parentfe4e32a4e655846976475ef0a7dc5837eab796fe (diff)
downloadrust-e13fe7ff5e482b626714ac6ec41b8d44e7c22ed1.tar.gz
rust-e13fe7ff5e482b626714ac6ec41b8d44e7c22ed1.zip
Auto merge of #62635 - Centril:rollup-potvfnk, r=Centril
Rollup of 12 pull requests

Successful merges:

 - #61535 (Coherence test when a generic type param has a default value from an associated type)
 - #62274 (rustc_mir: follow FalseUnwind's real_target edge in qualify_consts.)
 - #62431 (Add messages to `Option`'s and `Result`'s `must_use` annotation for `is_*`)
 - #62453 (in which we suggest anonymizing single-use lifetimes in paths )
 - #62568 (Replace unsafe_destructor_blind_to_params with may_dangle)
 - #62578 (Add test for #49919)
 - #62595 (Document that the crate keyword refers to the project root)
 - #62599 (move mem::uninitialized deprecation back by 1 release, to 1.39)
 - #62605 (Emit dropped unemitted errors to aid in ICE debugging)
 - #62607 (Correctly break out of recovery loop)
 - #62608 (`async unsafe fn` tests)
 - #62623 (downgrade indirect_structural_match lint to allow)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/mem/mod.rs2
-rw-r--r--src/libcore/option.rs5
-rw-r--r--src/libcore/result.rs4
3 files changed, 6 insertions, 5 deletions
diff --git a/src/libcore/mem/mod.rs b/src/libcore/mem/mod.rs
index b62d81affdd..f2729168763 100644
--- a/src/libcore/mem/mod.rs
+++ b/src/libcore/mem/mod.rs
@@ -472,7 +472,7 @@ pub unsafe fn zeroed<T>() -> T {
 /// [`MaybeUninit<T>`]: union.MaybeUninit.html
 /// [inv]: union.MaybeUninit.html#initialization-invariant
 #[inline]
-#[rustc_deprecated(since = "1.38.0", reason = "use `mem::MaybeUninit` instead")]
+#[rustc_deprecated(since = "1.39.0", reason = "use `mem::MaybeUninit` instead")]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub unsafe fn uninitialized<T>() -> T {
     MaybeUninit::uninit().assume_init()
diff --git a/src/libcore/option.rs b/src/libcore/option.rs
index 29169951e46..193cdb15b54 100644
--- a/src/libcore/option.rs
+++ b/src/libcore/option.rs
@@ -178,7 +178,7 @@ impl<T> Option<T> {
     /// ```
     ///
     /// [`Some`]: #variant.Some
-    #[must_use]
+    #[must_use = "if you intended to assert that this has a value, consider `.unwrap()` instead"]
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn is_some(&self) -> bool {
@@ -201,7 +201,8 @@ impl<T> Option<T> {
     /// ```
     ///
     /// [`None`]: #variant.None
-    #[must_use]
+    #[must_use = "if you intended to assert that this doesn't have a value, consider \
+                  `.and_then(|| panic!(\"`Option` had a value when expected `None`\"))` instead"]
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn is_none(&self) -> bool {
diff --git a/src/libcore/result.rs b/src/libcore/result.rs
index b64ad149cf4..ba72e1e75f8 100644
--- a/src/libcore/result.rs
+++ b/src/libcore/result.rs
@@ -277,7 +277,7 @@ impl<T, E> Result<T, E> {
     /// let x: Result<i32, &str> = Err("Some error message");
     /// assert_eq!(x.is_ok(), false);
     /// ```
-    #[must_use]
+    #[must_use = "if you intended to assert that this is ok, consider `.unwrap()` instead"]
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn is_ok(&self) -> bool {
@@ -302,7 +302,7 @@ impl<T, E> Result<T, E> {
     /// let x: Result<i32, &str> = Err("Some error message");
     /// assert_eq!(x.is_err(), true);
     /// ```
-    #[must_use]
+    #[must_use = "if you intended to assert that this is err, consider `.unwrap_err()` instead"]
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn is_err(&self) -> bool {