Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup: Use rustc's
same_types
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, `same_tys` 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 were 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
- Loading branch information