Skip to content

Commit abde4a5

Browse files
authored
Rollup merge of rust-lang#147171 - Qelxiros:hashmap_diag, r=fee1-dead
recommend using a HashMap if a HashSet's second generic parameter doesn't implement BuildHasher closes rust-lang#147147 ~The suggestion span is wrong, but I'm not sure how to find the right one.~ fixed I'm relatively new to the diagnostics ecosystem, so I'm not sure if `span_help` is the right choice. `span_suggestion_*` might be better, but the output from `x test` looks weird in that case.
2 parents ddc961f + 6fcadb1 commit abde4a5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/hash/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,7 @@ impl<H: Hasher + ?Sized> Hasher for &mut H {
633633
///
634634
/// [`build_hasher`]: BuildHasher::build_hasher
635635
/// [`HashMap`]: ../../std/collections/struct.HashMap.html
636+
#[cfg_attr(not(test), rustc_diagnostic_item = "BuildHasher")]
636637
#[stable(since = "1.7.0", feature = "build_hasher")]
637638
pub trait BuildHasher {
638639
/// Type of the hasher that will be created.

0 commit comments

Comments
 (0)