mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-05 05:04:24 +00:00
21 lines
487 B
Rust
21 lines
487 B
Rust
// 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();
|
|
}
|