Skip to content

Commit

Permalink
Rollup merge of rust-lang#116795 - DaniPopes:track-caller-option, r=c…
Browse files Browse the repository at this point in the history
…uviper

Add `#[track_caller]` to `Option::unwrap_or_else`

Same as rust-lang#116317 but for `Option`.

Closes rust-lang#115302
  • Loading branch information
fmease committed Oct 19, 2023
2 parents 29d9877 + 0df670f commit 80c9588
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 80c9588

Please sign in to comment.