summaryrefslogtreecommitdiffstats
path: root/tests/ui/typeck/issue-31173.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/typeck/issue-31173.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/typeck/issue-31173.rs b/tests/ui/typeck/issue-31173.rs
new file mode 100644
index 000000000..f678df5b4
--- /dev/null
+++ b/tests/ui/typeck/issue-31173.rs
@@ -0,0 +1,15 @@
+use std::vec::IntoIter;
+
+pub fn get_tok(it: &mut IntoIter<u8>) {
+ let mut found_e = false;
+
+ let temp: Vec<u8> = it
+ .take_while(|&x| {
+ found_e = true;
+ false
+ })
+ .cloned() //~ ERROR to be an iterator that yields `&_`, but it yields `u8`
+ .collect(); //~ ERROR the method
+}
+
+fn main() {}