about summary refs log tree commit diff
diff options
context:
space:
mode:
authorravenclaw900 <50060110+ravenclaw900@users.noreply.github.com>2023-10-01 09:42:37 -0500
committerravenclaw900 <50060110+ravenclaw900@users.noreply.github.com>2023-10-01 09:42:37 -0500
commitba0b7f0f0105f497cd8c6ddffef0c425473fdbb8 (patch)
treebc6e4afb8cd067cf21a372cb9fd13daf9391dfc0
parentc16823d757b376f90c5f5cbd542ce83235befbc4 (diff)
downloadrust-ba0b7f0f0105f497cd8c6ddffef0c425473fdbb8.tar.gz
rust-ba0b7f0f0105f497cd8c6ddffef0c425473fdbb8.zip
Add track_caller attribute to Result::unwrap_or_else
-rw-r--r--library/core/src/result.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/result.rs b/library/core/src/result.rs
index 6981abc9be1..50127b27f8b 100644
--- a/library/core/src/result.rs
+++ b/library/core/src/result.rs
@@ -1422,6 +1422,7 @@ impl<T, E> Result<T, E> {
     /// assert_eq!(Err("foo").unwrap_or_else(count), 3);
     /// ```
     #[inline]
+    #[track_caller]
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn unwrap_or_else<F: FnOnce(E) -> T>(self, op: F) -> T {
         match self {