rust/tests
Matthias Krüger 40f5861de9
Rollup merge of #135426 - compiler-errors:no-resolve-assoc-ty, r=lcnr
Assert that `Instance::try_resolve` is only used on body-like things

`Instance::resolve` is not set up to resolve items that are not body-like things. The logic in `resolve_associated_item` very much encodes this assumption:

e7ad3ae331/compiler/rustc_ty_utils/src/instance.rs (L96-L386)

However, some diagnostics were using `Instance::resolve` on an associated type, and it was simply a lucky coicidence that nothing went wrong.

This PR adds an assertion to make sure we won't do this again in the future, and fixes two callsites:
1. `call_kind` which returns a `CallKind` enum to categorize what a call in MIR comes from, and was using `Instance::resolve` to point at the associated type `Deref::Target` for a specific self ty.
2. `MirBorrowckCtxt::explain_deref_coercion`, which was doing the same thing.

The logic was replaced with `specialization_graph::assoc_def`, which is the proper way of fetching the right `AssocItem` for a given impl.

r? `@lcnr` or re-roll :)
2025-01-13 15:57:14 +01:00
..
assembly Add new {x86_64,i686}-win7-windows-gnu targets 2025-01-06 15:32:17 +01:00
auxiliary tests/assembly/asm: Remove uses of rustc_attrs and lang_items features by using minicore 2024-12-18 02:59:07 +09:00
codegen Rollup merge of #134030 - folkertdev:min-fn-align, r=workingjubilee 2025-01-11 18:13:45 +01:00
codegen-units Eagerly collect mono items for non-generic closures 2025-01-10 01:27:13 +00:00
coverage add comment to test 2025-01-09 13:55:50 +01:00
coverage-run-rustdoc
crashes add more crash tests 2025-01-12 10:11:29 +01:00
debuginfo Update a bunch of library types for MCP807 2025-01-09 23:47:11 -08:00
incremental Add more info on type/trait mismatches for different crate versions 2024-12-07 18:18:08 +00:00
mir-opt Rollup merge of #135377 - compiler-errors:impossible-step, r=oli-obk 2025-01-12 12:07:58 +01:00
pretty Update tests to use new proc-macro header 2024-11-27 07:18:25 -08:00
run-make Replace the random substring of a linker argument with a placeholder and nullify the timestamp field of XCOFF files for file comparison. 2025-01-06 16:59:46 -05:00
rustdoc rustdoc: use import stability marker in display 2025-01-11 15:04:48 -07:00
rustdoc-gui Add GUI test for item info elements color 2024-12-28 20:54:00 +01:00
rustdoc-js Rollup merge of #134277 - notriddle:notriddle/inline-into, r=GuillaumeGomez 2024-12-16 20:00:20 +01:00
rustdoc-js-std rustdoc: treat allowed_through_unstable_modules as deprecation 2025-01-02 12:03:24 -07:00
rustdoc-json rustdoc-json: Include items in stripped modules in Crate::paths. 2025-01-10 23:51:45 +00:00
rustdoc-ui Remove some empty expected files to fix blessing 2025-01-12 12:49:24 +02:00
ui Rollup merge of #135426 - compiler-errors:no-resolve-assoc-ty, r=lcnr 2025-01-13 15:57:14 +01:00
ui-fulldeps Rollup merge of #134834 - dtolnay:unnamedcall, r=compiler-errors 2024-12-27 18:43:05 -08:00
COMPILER_TESTS.md