3 struct MyError(()); // doesn't implement Debug
6 struct MyErrorWithParam<T> {
11 let res: Result<i32, ()> = Ok(0);
14 res.ok().expect("disaster!");
15 // the following should not warn, since `expect` isn't implemented unless
16 // the error type implements `Debug`
17 let res2: Result<i32, MyError> = Ok(0);
18 res2.ok().expect("oh noes!");
19 let res3: Result<u32, MyErrorWithParam<u8>> = Ok(0);
20 res3.ok().expect("whoof");
21 let res4: Result<u32, io::Error> = Ok(0);
22 res4.ok().expect("argh");
23 let res5: io::Result<u32> = Ok(0);
24 res5.ok().expect("oops");
25 let res6: Result<u32, &str> = Ok(0);
26 res6.ok().expect("meh");