Skip to content

Commit 9148fc2

Browse files
committed
Add test for ICE #3717 fix
1 parent f204b7e commit 9148fc2

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

tests/ui/ice-3717.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use std::collections::HashSet;
2+
3+
fn main() {}
4+
5+
pub fn ice_3717(_: &HashSet<usize>) {
6+
let _ = [0u8; 0];
7+
let _: HashSet<usize> = HashSet::new();
8+
}

tests/ui/ice-3717.stderr

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error: parameter of type `HashSet` should be generalized over different hashers
2+
--> $DIR/ice-3717.rs:5:21
3+
|
4+
LL | pub fn ice_3717(_: &HashSet<usize>) {
5+
| ^^^^^^^^^^^^^^
6+
|
7+
= note: `-D clippy::implicit-hasher` implied by `-D warnings`
8+
help: consider adding a type parameter
9+
|
10+
LL | pub fn ice_3717<S: ::std::hash::BuildHasher + Default>(_: &HashSet<usize, S>) {
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
12+
help: ...and use generic constructor
13+
|
14+
LL | let _: HashSet<usize> = HashSet::default();
15+
| ^^^^^^^^^^^^^^^^^^
16+
17+
error: aborting due to previous error
18+

0 commit comments

Comments
 (0)