mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
Rollup merge of #116795 - DaniPopes:track-caller-option, r=cuviper
Add `#[track_caller]` to `Option::unwrap_or_else` Same as #116317 but for `Option`. Closes #115302
This commit is contained in:
commit
80c9588549
@ -959,6 +959,7 @@ impl<T> Option<T> {
|
||||
/// assert_eq!(None.unwrap_or_else(|| 2 * k), 20);
|
||||
/// ```
|
||||
#[inline]
|
||||
#[track_caller]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn unwrap_or_else<F>(self, f: F) -> T
|
||||
where
|
||||
|
Loading…
Reference in New Issue
Block a user