Skip to content

Commit 80c9588

Browse files
authored
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
2 parents 29d9877 + 0df670f commit 80c9588

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/option.rs

+1
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,7 @@ impl<T> Option<T> {
959959
/// assert_eq!(None.unwrap_or_else(|| 2 * k), 20);
960960
/// ```
961961
#[inline]
962+
#[track_caller]
962963
#[stable(feature = "rust1", since = "1.0.0")]
963964
pub fn unwrap_or_else<F>(self, f: F) -> T
964965
where

0 commit comments

Comments
 (0)