Auto merge of #23512 - oli-obk:result_ok_unwrap, r=alexcrichton
because then the call to `unwrap()` will not print the error object.
This commit is contained in:
commit
e2fa53e593
21 changed files with 62 additions and 53 deletions
|
|
@ -12,7 +12,7 @@ use std::thread;
|
|||
|
||||
pub fn main() {
|
||||
let t = thread::spawn(move|| child((10, 20, 30, 40, 50, 60, 70, 80, 90)) );
|
||||
t.join().ok().unwrap();
|
||||
t.join().ok().unwrap(); // forget Err value, since it doesn't implement Debug
|
||||
}
|
||||
|
||||
fn child(args: (int, int, int, int, int, int, int, int, int)) {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@ pub fn main() {
|
|||
let _b = Foo;
|
||||
}).join();
|
||||
|
||||
let s = x.err().unwrap().downcast::<&'static str>().ok().unwrap();
|
||||
let s = x.err().unwrap().downcast::<&'static str>().unwrap();
|
||||
assert_eq!(&**s, "This panic should happen.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue