about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndy Russell <arussell123@gmail.com>2018-10-04 15:50:01 -0400
committerAndy Russell <arussell123@gmail.com>2018-10-04 15:50:01 -0400
commite15e86b8437356e37c6825ba9412e3d2f2738f22 (patch)
tree508924985f41d7d68dc23574c5b117e279c5d49c
parent1ab1b1e6f859b45a8167a8225b05df766e218cff (diff)
downloadrust-e15e86b8437356e37c6825ba9412e3d2f2738f22.tar.gz
rust-e15e86b8437356e37c6825ba9412e3d2f2738f22.zip
add test for #24338
-rw-r--r--src/test/ui/issues/issue-24338.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-24338.rs b/src/test/ui/issues/issue-24338.rs
new file mode 100644
index 00000000000..0c5db8f1f9d
--- /dev/null
+++ b/src/test/ui/issues/issue-24338.rs
@@ -0,0 +1,30 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+//
+// compile-pass
+
+trait DictLike<'a> {
+    type ItemsIterator: Iterator<Item=u8>;
+    fn get(c: Self::ItemsIterator) {
+        c.into_iter();
+    }
+}
+
+trait DictLike2<'a> {
+    type ItemsIterator: Iterator<Item=u8>;
+
+    fn items(&self) -> Self::ItemsIterator;
+
+    fn get(&self)  {
+        for _ in self.items() {}
+    }
+}
+
+fn main() {}