Skip to content

Commit 8827107

Browse files
committed
Auto merge of rust-lang#13230 - kyoto7250:fix_issue_13099, r=flip1995
Add a test for ice-3717.rs this PR is a part of rust-lang/rust-clippy#13099. Based on the changes introduced in rust-lang#13098 for introduce ui_test, we will update the uitest output. This is a fix for `ice-3717.rs`. Although fixes have already been made in rust-lang#13216, it seems that he is a first-time contributor. I thought it might be better for him to refer to my PR, so I created it accordingly. Since this is my first contribution in a while, please let me know if there are any issues or required changes. changelog: none r! `@flip1995`
2 parents e070784 + 5e25e7c commit 8827107

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

tests/ui/crashes/ice-3717.fixed

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![deny(clippy::implicit_hasher)]
2+
3+
use std::collections::HashSet;
4+
5+
fn main() {}
6+
7+
pub fn ice_3717<S: ::std::hash::BuildHasher + Default>(_: &HashSet<usize, S>) {
8+
//~^ ERROR: parameter of type `HashSet` should be generalized over different hashers
9+
let _ = [0u8; 0];
10+
let _: HashSet<usize> = HashSet::default();
11+
}

tests/ui/crashes/ice-3717.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#![deny(clippy::implicit_hasher)]
22

3-
//@no-rustfix: need to change the suggestion to a multipart suggestion
4-
53
use std::collections::HashSet;
64

75
fn main() {}

tests/ui/crashes/ice-3717.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: parameter of type `HashSet` should be generalized over different hashers
2-
--> tests/ui/crashes/ice-3717.rs:9:21
2+
--> tests/ui/crashes/ice-3717.rs:7:21
33
|
44
LL | pub fn ice_3717(_: &HashSet<usize>) {
55
| ^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)