Skip to content

Commit

Permalink
add a test for ice-3717.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoto7250 committed Aug 7, 2024
1 parent 5ead90f commit 5e25e7c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
11 changes: 11 additions & 0 deletions tests/ui/crashes/ice-3717.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#![deny(clippy::implicit_hasher)]

use std::collections::HashSet;

fn main() {}

pub fn ice_3717<S: ::std::hash::BuildHasher + Default>(_: &HashSet<usize, S>) {
//~^ ERROR: parameter of type `HashSet` should be generalized over different hashers
let _ = [0u8; 0];
let _: HashSet<usize> = HashSet::default();
}
2 changes: 0 additions & 2 deletions tests/ui/crashes/ice-3717.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#![deny(clippy::implicit_hasher)]

//@no-rustfix: need to change the suggestion to a multipart suggestion

use std::collections::HashSet;

fn main() {}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/crashes/ice-3717.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: parameter of type `HashSet` should be generalized over different hashers
--> tests/ui/crashes/ice-3717.rs:9:21
--> tests/ui/crashes/ice-3717.rs:7:21
|
LL | pub fn ice_3717(_: &HashSet<usize>) {
| ^^^^^^^^^^^^^^
Expand Down

0 comments on commit 5e25e7c

Please sign in to comment.