Skip to content

add find_mut method to the Map trait #5528

New issue

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

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

Already on GitHub? # to your account

Merged
merged 6 commits into from
Mar 26, 2013
Merged

add find_mut method to the Map trait #5528

merged 6 commits into from
Mar 26, 2013

Conversation

thestinger
Copy link
Contributor

This currently requires workarounds for the borrow checker not being flow-sensitive for LinearMap and TrieMap, but it can already be expressed for TreeMap and SmallIntMap without that.

bors added a commit that referenced this pull request Mar 26, 2013
This currently requires workarounds for the borrow checker not being flow-sensitive for `LinearMap` and `TrieMap`, but it can already be expressed for `TreeMap` and `SmallIntMap` without that.
@bors bors closed this Mar 26, 2013
@bors bors merged commit e8bf0a4 into rust-lang:incoming Mar 26, 2013
tesuji pushed a commit to tesuji/rustc that referenced this pull request Jun 9, 2020
Cleanup: Use rustc's `same_type` for our `same_tys`

This delegates our `same_tys` to [ty::TyS::same_type][same_type] to
remove some duplication.

Our `same_tys` was introduced 4 years ago in rust-lang#730. Before, it was
building an inference context to be able to call
`can_eq` to compare the types. The `rustc-dev-guide` has some more details
about `can_eq` in [Type Inference -> Trying equality][try_eq].

Now, using the rustc function, we are essentially comparing the `DefId`s
of the given types, which also makes more sense, IMO.

I also confirmed that the FIXME is resolved via a bit of `dbg!`, however
no UI tests seem to have been affected.

[same_type]: https://github.com/rust-lang/rust/blob/659951c4a0d7450e43f61c61c0e87d0ceae17087/src/librustc_middle/ty/util.rs#L777
[try_eq]: https://rustc-dev-guide.rust-lang.org/type-inference.html#trying-equality

---

changelog: none
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants