Do not suggest [T; n] instead of vec![T; n] if T is not Copy

This commit is contained in:
Samuel Tardieu 2023-12-16 14:02:50 +01:00
parent 29bdc8b2bc
commit 4cea5a8f33
3 changed files with 20 additions and 11 deletions

View file

@ -210,3 +210,10 @@ fn issue11861() {
// should not lint
m!(vec![1]);
}
fn issue_11958() {
fn f(_s: &[String]) {}
// should not lint, `String` is not `Copy`
f(&vec!["test".to_owned(); 2]);
}

View file

@ -210,3 +210,10 @@ fn issue11861() {
// should not lint
m!(vec![1]);
}
fn issue_11958() {
fn f(_s: &[String]) {}
// should not lint, `String` is not `Copy`
f(&vec!["test".to_owned(); 2]);
}