Auto merge of #6301 - alex-700:fix-map-clone, r=matthiaskrgr
do not trigger map_clone in the case of &mut fixes #6299 changelog: do not trigger map_clone in the case of &mut
This commit is contained in:
commit
96d5f45ade
3 changed files with 21 additions and 3 deletions
|
|
@ -44,4 +44,12 @@ fn main() {
|
|||
let v = vec![&mut d];
|
||||
let _: Vec<u32> = v.into_iter().map(|&mut x| x).collect();
|
||||
}
|
||||
|
||||
// Issue #6299
|
||||
{
|
||||
let mut aa = 5;
|
||||
let mut bb = 3;
|
||||
let items = vec![&mut aa, &mut bb];
|
||||
let _: Vec<_> = items.into_iter().map(|x| x.clone()).collect();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,4 +44,12 @@ fn main() {
|
|||
let v = vec![&mut d];
|
||||
let _: Vec<u32> = v.into_iter().map(|&mut x| x).collect();
|
||||
}
|
||||
|
||||
// Issue #6299
|
||||
{
|
||||
let mut aa = 5;
|
||||
let mut bb = 3;
|
||||
let items = vec![&mut aa, &mut bb];
|
||||
let _: Vec<_> = items.into_iter().map(|x| x.clone()).collect();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue