rust/compiler/rustc_middle/src
Matthias Krüger dd0fa6f871
Rollup merge of #98496 - BoxyUwU:instancers_bad_equality, r=lcnr
make `compare_const_impl` a query and use it in `instance.rs`

Fixes #88365

the bug in #88365 was caused by some `instance.rs` code using the `PartialEq` impl on `Ty` to check that the type of the associated const in an impl is the same as the type of the associated const in the trait definition. This was wrong for two reasons:
- the check typeck does is that the impl type is a subtype of the trait definition's type (see `mismatched_impl_ty_2.rs` which [was ICEing](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f6d60ebe6745011f0d52ab2bc712025d) before this PR on stable)
- it assumes that if two types are equal then the `PartialEq` impl will reflect that which isnt true for higher ranked types or type level constants when `feature(generic_const_exprs)` is enabled (see `mismatched_impl_ty_3.rs` for higher ranked types which was [ICEing on stable](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=d7af131a655ed515b035624626c62c71))

r? `@lcnr`
2022-10-06 16:29:43 +02:00
..
dep_graph Allow query system to recover a HirId. 2022-10-01 15:58:42 +02:00
hir Rollup merge of #102538 - cjgillot:def-span-ctxt, r=fee1-dead 2022-10-02 20:42:21 +05:30
infer
middle Refactor rustc lint API 2022-10-01 10:03:06 +00:00
mir It's not about types or consts, but the lack of regions 2022-10-04 14:10:44 +00:00
query Rollup merge of #98496 - BoxyUwU:instancers_bad_equality, r=lcnr 2022-10-06 16:29:43 +02:00
thir
traits
ty It's not about types or consts, but the lack of regions 2022-10-04 14:10:44 +00:00
util
arena.rs
error.rs Add diagnostic struct for const eval error in rustc_middle 2022-10-03 12:29:49 -05:00
lib.rs remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
lint.rs Rollup merge of #102568 - compiler-errors:lint-unsatisfied-opaques, r=oli-obk 2022-10-04 16:11:02 +05:30
macros.rs
metadata.rs
tests.rs
thir.rs remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
values.rs