diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2016-05-09 12:50:21 -0700 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2016-05-09 14:59:38 -0700 |
| commit | fffaf665f2bdab15c2ea11d9f97df22c401c9f36 (patch) | |
| tree | bd5125394d3c0458a8730fd3b90c5c5a366e390e /src/test | |
| parent | c45d4816ca1e53afd57a3140daca7ee46f34672c (diff) | |
| parent | 62b19c627ebde2bbfa6021de146c502124da7975 (diff) | |
| download | rust-fffaf665f2bdab15c2ea11d9f97df22c401c9f36.tar.gz rust-fffaf665f2bdab15c2ea11d9f97df22c401c9f36.zip | |
Rollup merge of #33474 - frewsxcv:unwrap-err, r=alexcrichton
Utilize `Result::unwrap_err` in more places. None
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-make/static-unwinding/main.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/command-before-exec.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/no-landing-pads.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/panic-recover-propagate.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/sepcomp-unwind.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/terminate-in-initializer.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/unit-like-struct-drop-run.rs | 2 |
7 files changed, 9 insertions, 9 deletions
diff --git a/src/test/run-make/static-unwinding/main.rs b/src/test/run-make/static-unwinding/main.rs index ba4860be91d..1cd785334f6 100644 --- a/src/test/run-make/static-unwinding/main.rs +++ b/src/test/run-make/static-unwinding/main.rs @@ -25,7 +25,7 @@ fn main() { thread::spawn(move|| { let _a = A; lib::callback(|| panic!()); - }).join().err().unwrap(); + }).join().unwrap_err(); unsafe { assert_eq!(lib::statik, 1); diff --git a/src/test/run-pass/command-before-exec.rs b/src/test/run-pass/command-before-exec.rs index 16560637b69..72f952fb6c0 100644 --- a/src/test/run-pass/command-before-exec.rs +++ b/src/test/run-pass/command-before-exec.rs @@ -62,7 +62,7 @@ fn main() { let output = Command::new(&me).arg("bad").before_exec(|| { Err(Error::from_raw_os_error(102)) - }).output().err().unwrap(); + }).output().unwrap_err(); assert_eq!(output.raw_os_error(), Some(102)); let pid = unsafe { libc::getpid() }; diff --git a/src/test/run-pass/no-landing-pads.rs b/src/test/run-pass/no-landing-pads.rs index 8445bccf134..e718046ebbc 100644 --- a/src/test/run-pass/no-landing-pads.rs +++ b/src/test/run-pass/no-landing-pads.rs @@ -27,6 +27,6 @@ fn main() { thread::spawn(move|| -> () { let _a = A; panic!(); - }).join().err().unwrap(); + }).join().unwrap_err(); assert!(unsafe { !HIT }); } diff --git a/src/test/run-pass/panic-recover-propagate.rs b/src/test/run-pass/panic-recover-propagate.rs index d420ef99863..2c87c6b9268 100644 --- a/src/test/run-pass/panic-recover-propagate.rs +++ b/src/test/run-pass/panic-recover-propagate.rs @@ -28,10 +28,10 @@ fn main() { panic!("hi there"); }); - panic::propagate(result.err().unwrap()); + panic::propagate(result.unwrap_err()); }).join(); - let msg = *result.err().unwrap().downcast::<&'static str>().unwrap(); + let msg = *result.unwrap_err().downcast::<&'static str>().unwrap(); assert_eq!("hi there", msg); assert_eq!(1, A.load(Ordering::SeqCst)); } diff --git a/src/test/run-pass/sepcomp-unwind.rs b/src/test/run-pass/sepcomp-unwind.rs index 96e9c1ed2cc..3a93845a062 100644 --- a/src/test/run-pass/sepcomp-unwind.rs +++ b/src/test/run-pass/sepcomp-unwind.rs @@ -39,5 +39,5 @@ mod b { } fn main() { - thread::spawn(move|| { ::b::g() }).join().err().unwrap(); + thread::spawn(move|| { ::b::g() }).join().unwrap_err(); } diff --git a/src/test/run-pass/terminate-in-initializer.rs b/src/test/run-pass/terminate-in-initializer.rs index 2875f73fc6c..c9133bae854 100644 --- a/src/test/run-pass/terminate-in-initializer.rs +++ b/src/test/run-pass/terminate-in-initializer.rs @@ -24,13 +24,13 @@ fn test_ret() { let _x: Box<isize> = return; } fn test_panic() { fn f() { let _x: Box<isize> = panic!(); } - thread::spawn(move|| f() ).join().err().unwrap(); + thread::spawn(move|| f() ).join().unwrap_err(); } fn test_panic_indirect() { fn f() -> ! { panic!(); } fn g() { let _x: Box<isize> = f(); } - thread::spawn(move|| g() ).join().err().unwrap(); + thread::spawn(move|| g() ).join().unwrap_err(); } pub fn main() { diff --git a/src/test/run-pass/unit-like-struct-drop-run.rs b/src/test/run-pass/unit-like-struct-drop-run.rs index eaee3505a67..ec37be9420d 100644 --- a/src/test/run-pass/unit-like-struct-drop-run.rs +++ b/src/test/run-pass/unit-like-struct-drop-run.rs @@ -30,6 +30,6 @@ pub fn main() { let _b = Foo; }).join(); - let s = x.err().unwrap().downcast::<&'static str>().unwrap(); + let s = x.unwrap_err().downcast::<&'static str>().unwrap(); assert_eq!(&**s, "This panic should happen."); } |
