rust/compiler/rustc_middle/src
Trevor Gross 3b45f8f310
Rollup merge of #130764 - compiler-errors:inherent, r=estebank
Separate collection of crate-local inherent impls from error tracking

#119895 changed the return type of the `crate_inherent_impls` query from `CrateInherentImpls` to `Result<CrateInherentImpls, ErrorGuaranteed>` to avoid needing to use the non-parallel-friendly `track_errors()` to track if an error was reporting from within the query... This was mostly fine until #121113, which stopped halting compilation when we hit an `Err(ErrorGuaranteed)` in the `crate_inherent_impls` query.

Thus we proceed onwards to typeck, and since a return type of `Result<CrateInherentImpls, ErrorGuaranteed>` means that the query can *either* return one of "the list inherent impls" or "error has been reported", later on when we want to assemble method or associated item candidates for inherent impls, we were just treating any `Err(ErrorGuaranteed)` return value as if Rust had no inherent impls defined anywhere at all! This leads to basically every inherent method call failing with an error, lol, which was reported in #127798.

This PR changes the `crate_inherent_impls` query to return `(CrateInherentImpls, Result<(), ErrorGuaranteed>)`, i.e. returning the inherent impls collected *and* whether an error was reported in the query itself. It firewalls the latter part of that query into a new `crate_inherent_impls_validity_check` just for the `ensure()` call.

This fixes #127798.
2024-09-24 19:47:50 -04:00
..
dep_graph Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
hir Rollup merge of #130618 - m-ou-se:skip-query, r=compiler-errors 2024-09-23 23:49:11 -04:00
hooks Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
infer Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
middle Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
mir update doc comment 2024-09-24 23:12:02 +02:00
query Separate collection of crate-local inherent impls from error reporting 2024-09-24 10:12:05 -04:00
thir be even more precise about "cast" vs "coercion" 2024-09-24 23:12:02 +02:00
traits Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
ty Rollup merge of #130764 - compiler-errors:inherent, r=estebank 2024-09-24 19:47:50 -04:00
util Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
arena.rs coverage: CodeRegion is never stored in an arena 2024-08-28 22:03:48 +10:00
error.rs Use bool in favor of Option<()> for diagnostics 2024-08-21 01:31:11 -04:00
lib.rs Use associative type defaults in {Layout,FnAbi}OfHelpers. 2024-09-17 10:25:06 +10:00
lint.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
macros.rs lift_to_tcx -> lift_to_interner 2024-07-17 10:46:10 -04:00
metadata.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
tests.rs Give an item related to issue 27438 a more meaningful name 2024-04-30 22:27:19 +02:00
thir.rs be even more precise about "cast" vs "coercion" 2024-09-24 23:12:02 +02:00
values.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00