diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-12909.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-12909.rs b/src/test/ui/issues/issue-12909.rs new file mode 100644 index 000000000..a68d73a00 --- /dev/null +++ b/src/test/ui/issues/issue-12909.rs @@ -0,0 +1,20 @@ +// run-pass +#![allow(unused_variables)] +// pretty-expanded FIXME #23616 + +use std::collections::HashMap; + +fn copy<T: Copy>(&x: &T) -> T { + x +} + +fn main() { + let arr = [(1, 1), (2, 2), (3, 3)]; + + let v1: Vec<&_> = arr.iter().collect(); + let v2: Vec<_> = arr.iter().map(copy).collect(); + + let m1: HashMap<_, _> = arr.iter().map(copy).collect(); + let m2: HashMap<isize, _> = arr.iter().map(copy).collect(); + let m3: HashMap<_, usize> = arr.iter().map(copy).collect(); +} |