rust/compiler
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
..
rustc Don't rerun the build script for the compiler each time on linux 2022-07-10 23:57:25 -05:00
rustc_apfloat Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_arena Make use of [wrapping_]byte_{add,sub} 2022-08-23 19:32:37 +04:00
rustc_ast Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_ast_lowering Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_ast_passes Rollup merge of #102273 - woppopo:relax_const_bound, r=fee1-dead 2022-09-26 19:19:21 +02:00
rustc_ast_pretty Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_attr Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_borrowck Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_builtin_macros Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_codegen_cranelift Stabilize bench_black_box 2022-09-27 17:38:51 +02:00
rustc_codegen_gcc Remove type argument of array_alloca and rename to byte_array_alloca 2022-10-02 13:42:14 +00:00
rustc_codegen_llvm Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_codegen_ssa Rollup merge of #102440 - sunfishcode:sunfishcode/wasm-no-export-tls-api, r=oli-obk 2022-10-05 17:27:33 +05:30
rustc_const_eval Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_data_structures Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_driver rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00
rustc_error_codes Cleanup some error code explanations 2022-10-03 08:53:06 +02:00
rustc_error_messages Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_errors Auto merge of #102726 - matthiaskrgr:rollup-2ghn38b, r=matthiaskrgr 2022-10-06 05:58:27 +00:00
rustc_expand Temporarily reinstate doctest=false 2022-10-05 09:53:49 +09:00
rustc_feature Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_fs_util Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_graphviz Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_hir Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_hir_analysis Rollup merge of #98496 - BoxyUwU:instancers_bad_equality, r=lcnr 2022-10-06 16:29:43 +02:00
rustc_hir_pretty Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_incremental Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_index Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_infer Rollup merge of #102496 - compiler-errors:into-suggestion, r=davidtwco 2022-10-05 17:27:33 +05:30
rustc_interface Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_lexer Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_lint Rollup merge of #102568 - compiler-errors:lint-unsatisfied-opaques, r=oli-obk 2022-10-04 16:11:02 +05:30
rustc_lint_defs Compute lint_levels by definition 2022-10-01 16:12:50 +02:00
rustc_llvm Avoid LLVM-deprecated Optional::hasValue 2022-09-26 16:51:18 -07:00
rustc_log Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_macros errors: rename typeck.ftl to hir_analysis.ftl 2022-10-03 13:52:17 +01:00
rustc_metadata Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_middle Rollup merge of #98496 - BoxyUwU:instancers_bad_equality, r=lcnr 2022-10-06 16:29:43 +02:00
rustc_mir_build Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_mir_dataflow Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_mir_transform Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_monomorphize Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_parse Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_parse_format Fix span of byte-escaped left format args brace 2022-09-28 13:47:17 -07:00
rustc_passes Merge the ~const and impl const checks and add some explanatory notes 2022-10-04 08:59:20 +00:00
rustc_plugin_impl Remove from compiler/ crates 2022-09-29 16:49:04 +09:00
rustc_privacy Shrink hir::def::Res. 2022-09-29 08:44:52 +10:00
rustc_query_impl Temporarily reinstate doctest=false 2022-10-05 09:53:49 +09:00
rustc_query_system Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_resolve Auto merge of #102726 - matthiaskrgr:rollup-2ghn38b, r=matthiaskrgr 2022-10-06 05:58:27 +00:00
rustc_save_analysis Shrink hir::def::Res. 2022-09-29 08:44:52 +10:00
rustc_serialize remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
rustc_session Remove expr_parentheses_needed from ParseSess 2022-09-30 01:39:20 +00:00
rustc_smir Only keep one version of ImplicitSelfKind. 2022-09-13 19:18:23 +02:00
rustc_span Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_symbol_mangling Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_target change might_permit_raw_init to fully detect LLVM UB, but not more than that 2022-10-05 09:22:50 +02:00
rustc_trait_selection Auto merge of #99324 - reez12g:issue-99144, r=jyn514 2022-10-06 03:01:57 +00:00
rustc_traits It's not about types or consts, but the lack of regions 2022-10-04 14:10:44 +00:00
rustc_transmute check if const is ADT or not 2022-10-03 17:51:18 +09:00
rustc_ty_utils Rollup merge of #98496 - BoxyUwU:instancers_bad_equality, r=lcnr 2022-10-06 16:29:43 +02:00
rustc_type_ir Remove from compiler/ crates 2022-09-29 16:49:04 +09:00