Skip to content

Commit

Permalink
error: internal compiler error: adt::represent_type called on non-ADT…
Browse files Browse the repository at this point in the history
… type: &std ::io::IoError

Reference rust-lang/rust#20046
  • Loading branch information
Bruno Tavares committed Oct 24, 2015
1 parent 10e8088 commit 201ae0c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/20046.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#[derive(PartialEq)]
enum IoErrorKind { BrokenPipe, XXX }
struct IoError {
pub kind: IoErrorKind,
pub detail: Option<String>
}
fn main() {
let e: Result<u8, _> = 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)
};
}

0 comments on commit 201ae0c

Please sign in to comment.