diff --git a/src/20046.rs b/src/20046.rs new file mode 100644 index 00000000..35af3260 --- /dev/null +++ b/src/20046.rs @@ -0,0 +1,15 @@ +#[derive(PartialEq)] +enum IoErrorKind { BrokenPipe, XXX } +struct IoError { + pub kind: IoErrorKind, + pub detail: Option +} +fn main() { + let e: Result = Err(IoError{ kind: IoErrorKind::XXX, detail: None }); + match e { + Ok(_) => true, + Err(ref e) if e.kind == IoErrorKind::BrokenPipe => return, + Err(IoError { kind: IoErrorKind::BrokenPipe, ..}) => return, + Err(err) => panic!(err) + }; +}