Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 5 pull requests #68771

Merged
merged 11 commits into from
Feb 2, 2020
Next Next commit
Update option.rs
I updated the example of the `expect` examples so they won't contain depressing sentences any more !
astrolemonade authored Feb 1, 2020
commit 2ce14b8a19865ed359e9df7eb5e8e6186cae1e58
4 changes: 2 additions & 2 deletions src/libcore/option.rs
Original file line number Diff line number Diff line change
@@ -331,12 +331,12 @@ impl<T> Option<T> {
///
/// ```
/// let x = Some("value");
/// assert_eq!(x.expect("the world is ending"), "value");
/// assert_eq!(x.expect("fruits are healthy"), "value");
/// ```
///
/// ```{.should_panic}
/// let x: Option<&str> = None;
/// x.expect("the world is ending"); // panics with `the world is ending`
/// x.expect("fruits are healthy"); // panics with `fruits are healthy`
/// ```
#[inline]
#[track_caller]