From 57ee9fa9578ea996f1bdbe4d1b92cae5d4b5d34d Mon Sep 17 00:00:00 2001 From: Bruno Tavares Date: Sat, 24 Oct 2015 00:58:10 -0200 Subject: [PATCH] ICE: Unexpected type returned from struct_tai Reference rust-lang/rust#16812 --- src/16812_1.rs | 9 +++++++++ src/16812_2.rs | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/16812_1.rs create mode 100644 src/16812_2.rs diff --git a/src/16812_1.rs b/src/16812_1.rs new file mode 100644 index 00000000..6474bd6c --- /dev/null +++ b/src/16812_1.rs @@ -0,0 +1,9 @@ +enum Foo { + Bar(u32, [u32]), +} + +fn main() { + // Either of these lines can cause the ICE + let _x: &(u32, [u32]); + let _y: &Foo; +} diff --git a/src/16812_2.rs b/src/16812_2.rs new file mode 100644 index 00000000..03f4091d --- /dev/null +++ b/src/16812_2.rs @@ -0,0 +1,18 @@ +use std::path::Path; +use std::path::PathBuf; + +pub enum Source +{ + File(Path), // compiler error :( + //File(PathBuf), // works :) +} + +pub fn source_to_dbtype(src: &Source) -> u8 +{ + match src + { + &Source::File(..) => 1, + } +} + +fn main() {}