about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAdam Perry <adam.n.perry@gmail.com>2020-01-04 19:42:21 -0800
committerAdam Perry <adam.n.perry@gmail.com>2020-01-04 19:52:37 -0800
commit7a6af7eb0ef685c2dfd907f7e76a876174c9f665 (patch)
tree5c8cebce3845f2959155f37c86c19f3ac0f47cb6 /src/test
parent2e9d573d3f6bc9808e01cef914084fac15f42cc2 (diff)
Result's panics have `#[track_caller]`.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/rfc-2091-track-caller/std-panic-locations.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs b/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs
index 96620d6440f..c65027d9cac 100644
--- a/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs
+++ b/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs
@@ -26,4 +26,12 @@ fn main() {
     let yep: Option<()> = Some(());
     assert_panicked(|| yep.unwrap_none());
     assert_panicked(|| yep.expect_none(""));
+
+    let oops: Result<(), ()> = Err(());
+    assert_panicked(|| oops.unwrap());
+    assert_panicked(|| oops.expect(""));
+
+    let fine: Result<(), ()> = Ok(());
+    assert_panicked(|| fine.unwrap_err());
+    assert_panicked(|| fine.expect_err(""));
 }