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:
León Orell Valerian Liehr 2023-10-19 04:34:46 +02:00 committed by GitHub
commit 80c9588549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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