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 Const unification is already infallible, remove the error handling logic 2022-09-22 08:20:13 +00:00
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 Use boxed slices in PatKind. 2022-09-02 07:26:22 +10:00
traits Neither require nor imply lifetime bounds on opaque type for well formedness 2022-09-21 13:11:54 +00:00
ty It's not about types or consts, but the lack of regions 2022-10-04 14:10:44 +00:00
util span: move MultiSpan 2022-04-05 07:01:00 +01:00
arena.rs cache collect_trait_impl_trait_tys 2022-09-14 20:50:52 +00:00
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 impl TypeVisitable in type traversal macros 2022-07-05 22:25:33 +01:00
metadata.rs rustc: Parameterize ty::Visibility over used ID 2022-09-07 13:35:41 +04:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
thir.rs remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
values.rs Make HandleCycleError an enum instead of a macro-generated closure 2022-09-06 19:26:08 -05:00