From 322a7d6387a875d9f751c1b332f84c181e57ac64 Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 8 Aug 2019 19:16:08 -0400 Subject: [PATCH] Add test for issue 36804 --- src/test/ui/specialization/issue-36804.rs | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/test/ui/specialization/issue-36804.rs diff --git a/src/test/ui/specialization/issue-36804.rs b/src/test/ui/specialization/issue-36804.rs new file mode 100644 index 0000000000000..36cb939bc48fb --- /dev/null +++ b/src/test/ui/specialization/issue-36804.rs @@ -0,0 +1,31 @@ +// check-pass +#![feature(specialization)] + +pub struct Cloned(I); + +impl<'a, I, T: 'a> Iterator for Cloned +where + I: Iterator, + T: Clone, +{ + type Item = T; + + fn next(&mut self) -> Option { + unimplemented!() + } +} + +impl<'a, I, T: 'a> Iterator for Cloned +where + I: Iterator, + T: Copy, +{ + fn count(self) -> usize { + unimplemented!() + } +} + +fn main() { + let a = [1,2,3,4]; + Cloned(a.iter()).count(); +}