Skip to content

Implement entry_equiv for HashMap #17581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Implement entry_equiv for HashMap #17581

wants to merge 1 commit into from

Conversation

emma-borhanian
Copy link

No description provided.

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

@thestinger
Copy link
Contributor

I don't think we should add any more Equiv methods. There are better ways to deal with this common issue for the String and Vec cases like #17447 and Equiv doesn't cover the most general cases like those handled by find_with on TreeMap anyway. There are many types using T and taking &T, and Equiv is only able to handle it for a subset of the cases where equality is required - and it relies on an unstated assumption that the Hash implementation is the same.

@emma-borhanian
Copy link
Author

I don't think we should add any more Equiv methods.

Ah, that explanation sounds reasonable. I'll wait a bit and close if I don't get any positive feedback

@huonw
Copy link
Member

huonw commented Sep 27, 2014

Thanks for the contribution, nonetheless! 😄

@emma-borhanian
Copy link
Author

:)

lnicola pushed a commit to lnicola/rust that referenced this pull request Jul 11, 2024
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#12 [ 5/11] RUN npm install [email protected] [email protected] -g
#12 5.597 npm WARN deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
#12 5.654 npm WARN deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
#12 5.673 npm WARN deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
#12 5.718 npm WARN deprecated @humanwhocodes/[email protected]: Use @eslint/config-array instead
#12 5.765 npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
#12 5.765 npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
#12 5.771 npm WARN deprecated @humanwhocodes/[email protected]: Use @eslint/object-schema instead
#12 6.722 added 205 packages in 7s
#12 6.722 
#12 6.722 20 packages are looking for funding
#12 6.722   run `npm fund` for details
---
#16 3.716 Building wheels for collected packages: reuse
#16 3.717   Building wheel for reuse (pyproject.toml): started
#16 4.050   Building wheel for reuse (pyproject.toml): finished with status 'done'
#16 4.051   Created wheel for reuse: filename=reuse-1.1.0-cp310-cp310-manylinux_2_35_x86_64.whl size=181117 sha256=f5f58750481f69515c2c0d1d503daf565e2565c370d07fc6aeb95fe3498b4269
#16 4.051   Stored in directory: /tmp/pip-ephem-wheel-cache-euwlpub_/wheels/c2/3c/b9/1120c2ab4bd82694f7e6f0537dc5b9a085c13e2c69a8d0c76d
#16 4.054 Installing collected packages: boolean-py, binaryornot, setuptools, reuse, python-debian, markupsafe, license-expression, jinja2, chardet
#16 4.075   Attempting uninstall: setuptools
#16 4.076     Found existing installation: setuptools 59.6.0
#16 4.077     Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr
---
    Checking hir-ty v0.0.0 (/checkout/src/tools/rust-analyzer/crates/hir-ty)
    Checking miniz_oxide v0.7.2
   Compiling proc-macro-test v0.0.0 (/checkout/src/tools/rust-analyzer/crates/proc-macro-srv/proc-macro-test)
    Checking object v0.33.0
error[E0277]: the trait bound `EnumVariantContiguousIndex: rustc_pattern_analysis::Idx` is not satisfied
    |
    |
313 |     type VariantIdx = EnumVariantContiguousIndex;
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rustc_pattern_analysis::Idx` is not implemented for `EnumVariantContiguousIndex`
    = help: the following other types implement trait `rustc_pattern_analysis::Idx`:
              u32
              usize
note: required by a bound in `rustc_pattern_analysis::PatCx::VariantIdx`
note: required by a bound in `rustc_pattern_analysis::PatCx::VariantIdx`
   --> /cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.53.0/src/lib.rs:52:30
    |
52  |     type VariantIdx: Clone + Idx + fmt::Debug;
    |                              ^^^ required by this bound in `PatCx::VariantIdx`
    Checking libloading v0.8.3
    Checking time-core v0.1.2
    Checking num-conv v0.1.0
    Checking memmap2 v0.5.10
    Checking memmap2 v0.5.10
    Checking unicode-ident v1.0.12
error[E0308]: mismatched types
   --> crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs:467:48
    |
467 |                     ConstructorSet::Variants { variants, non_exhaustive: is_declared_nonexhaustive }
    |                                                ^^^^^^^^ expected `IndexVec<EnumVariantContiguousIndex, ...>`, found `IndexVec<_, VariantVisibility>`
    |
    = note: `IndexVec<_, VariantVisibility>` and `IndexVec<EnumVariantContiguousIndex, ...>` have similar names, but are actually distinct types
note: `IndexVec<_, VariantVisibility>` is defined in crate `rustc_index`
    |
    |
42  | pub struct IndexVec<I: Idx, T> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: `IndexVec<EnumVariantContiguousIndex, ...>` is defined in crate `ra_ap_rustc_index`
   --> /cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_index-0.53.0/src/vec.rs:42:1
    |
42  | pub struct IndexVec<I: Idx, T> {

    Checking time v0.3.36
    Checking flate2 v1.0.30
    Checking byteorder v1.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants