Stabilize expect_err feature, closes #39041

This commit is contained in:
Aaron Turon 2017-03-14 20:49:18 -07:00 committed by Alex Crichton
parent 33a5665988
commit 65b7c4ed31
1 changed files with 1 additions and 2 deletions

View File

@ -803,12 +803,11 @@ impl<T: fmt::Debug, E> Result<T, E> {
/// Basic usage:
///
/// ```{.should_panic}
/// # #![feature(result_expect_err)]
/// let x: Result<u32, &str> = Ok(10);
/// x.expect_err("Testing expect_err"); // panics with `Testing expect_err: 10`
/// ```
#[inline]
#[unstable(feature = "result_expect_err", issue = "39041")]
#[stable(feature = "result_expect_err", since = "1.17.0")]
pub fn expect_err(self, msg: &str) -> E {
match self {
Ok(t) => unwrap_failed(msg, t),