rust/compiler
Matthias Krüger b17948ad52
Rollup merge of #139153 - compiler-errors:incr-comp-closure, r=oli-obk
Encode synthetic by-move coroutine body with a different `DefPathData`

See the included test. In the first revision rpass1, we have an async closure `{closure#0}` which has a coroutine as a child `{closure#0}::{closure#0}`. We synthesize a by-move coroutine body, which is `{closure#0}::{closure#1}` which depends on the mir_built query, which depends on the typeck query.

In the second revision rpass2, we've replaced the coroutine-closure by a closure with two children closure. Notably, the def path of the second child closure is the same as the synthetic def id from the last revision: `{closure#0}::{closure#1}`. When type-checking this closure, we end up trying to compute its def_span, which tries to fetch it from the incremental cache; this will try to force the dependencies from the last run, which ends up forcing the mir_built query, which ends up forcing the typeck query, which ends up with a query cycle.

The problem here is that we really should never have used the same `DefPathData` for the synthetic by-move coroutine body, since it's not a closure. Changing the `DefPathData` will mean that we can see that the def ids are distinct, which means we won't try to look up the closure's def span from the incremental cache, which will properly skip replaying the node's dependencies and avoid a query cycle.

Fixes #139142
2025-03-31 14:36:22 +02:00
..
rustc Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_abi BackendRepr::is_signed: comment why this may panics 2025-03-29 12:21:51 +01:00
rustc_arena Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_ast Rollup merge of #138898 - fmease:decrustify-parser-post-ty-ascr, r=compiler-errors 2025-03-26 19:40:28 +11:00
rustc_ast_ir Use -Wunused_crate_dependencies for compiler crates. 2025-03-20 08:59:43 +11:00
rustc_ast_lowering Simplify expansion for format_args!(). 2025-03-30 10:42:00 +02:00
rustc_ast_passes Rollup merge of #139063 - fmease:fix-tait-atpit-gating, r=oli-obk 2025-03-28 21:18:30 +01:00
rustc_ast_pretty expand: Leave traces when expanding cfg attributes 2025-03-26 15:30:12 +03:00
rustc_attr_data_structures add rustc_macro_edition_2021 2025-03-19 17:37:35 +01:00
rustc_attr_parsing Avoid kw::Empty when dealing with rustc_allowed_through_unstable_modules. 2025-03-25 16:48:03 +11:00
rustc_baked_icu_data Add unreachable_pub to RUSTC_LINT_FLAGS for compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_borrowck Don't use kw::Empty in hir::Lifetime::ident. 2025-03-28 10:15:23 +11:00
rustc_builtin_macros use slice::contains where applicable 2025-03-28 12:21:21 +00:00
rustc_codegen_cranelift Merge commit 'ba315abda7' into sync_cg_clif-2025-03-30 2025-03-30 15:43:48 +00:00
rustc_codegen_gcc Auto merge of #138503 - bjorn3:string_merging, r=tmiasko 2025-03-28 10:18:32 +00:00
rustc_codegen_llvm Auto merge of #138742 - taiki-e:riscv-vector, r=Amanieu 2025-03-30 02:21:56 +00:00
rustc_codegen_ssa use slice::contains where applicable 2025-03-28 12:21:21 +00:00
rustc_const_eval Rollup merge of #138713 - RalfJung:memory-hook-pointers, r=oli-obk 2025-03-21 06:56:47 +01:00
rustc_data_structures Add TyCtx::env_var_os 2025-03-26 15:46:05 +01:00
rustc_driver Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_driver_impl Implement supported-crate-types print request 2025-03-23 19:08:54 +08:00
rustc_error_codes Avoid kw::Empty when dealing with rustc_allowed_through_unstable_modules. 2025-03-25 16:48:03 +11:00
rustc_error_messages Rollup merge of #138404 - bjorn3:sysroot_handling_cleanup, r=petrochenkov,jieyouxu 2025-03-13 11:28:35 +01:00
rustc_errors Use abs_diff where applicable 2025-03-27 18:29:06 +00:00
rustc_expand Rollup merge of #138844 - petrochenkov:cfgtrace2, r=nnethercote 2025-03-27 13:11:17 -04:00
rustc_feature Remove attribute #[rustc_error] 2025-03-30 01:32:21 +03:00
rustc_fluent_macro Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_fs_util Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_graphviz Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_hashes Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_hir Encode synthetic by-move coroutine body with a different DefPathData 2025-03-30 22:53:21 +00:00
rustc_hir_analysis Remove terminating_scopes hash set. 2025-03-28 22:49:27 +01:00
rustc_hir_pretty Improve hir_pretty for struct expressions. 2025-03-30 11:21:51 +02:00
rustc_hir_typeck Rollup merge of #139086 - meithecatte:expr-use-visitor-cleanup, r=compiler-errors 2025-03-29 11:43:49 +01:00
rustc_incremental Auto merge of #138629 - Zoxc:graph-anon-hashmap, r=oli-obk 2025-03-24 15:02:09 +00:00
rustc_index Use {Decodable,Encodable}_NoContext in type_ir 2025-03-15 06:34:36 +00:00
rustc_index_macros Add unreachable_pub to RUSTC_LINT_FLAGS for compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_infer Obligation::as_goal 2025-03-23 18:18:47 +00:00
rustc_interface Remove attribute #[rustc_error] 2025-03-30 01:32:21 +03:00
rustc_lexer Revert "Rollup merge of #136355 - GuillaumeGomez:proc-macro_add_value_retrieval_methods, r=Amanieu" 2025-03-18 13:28:56 +01:00
rustc_lint Auto merge of #119220 - Urgau:uplift-invalid_null_ptr_usage, r=fee1-dead 2025-03-31 04:17:14 +00:00
rustc_lint_defs add FCW to warn about wasm ABI transition 2025-03-25 08:22:35 +01:00
rustc_llvm coverage: Add LLVM plumbing for expansion regions 2025-03-20 12:40:36 +11:00
rustc_log Use -Wunused_crate_dependencies for compiler crates. 2025-03-20 08:59:43 +11:00
rustc_macros Move codec module back into middle 2025-03-15 06:42:48 +00:00
rustc_metadata Revert "Auto merge of #129827 - bvanjoi:less-decoding, r=petrochenkov" 2025-03-30 11:14:33 +02:00
rustc_middle Rollup merge of #139153 - compiler-errors:incr-comp-closure, r=oli-obk 2025-03-31 14:36:22 +02:00
rustc_mir_build use slice::contains where applicable 2025-03-28 12:21:21 +00:00
rustc_mir_dataflow Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgr 2025-03-12 17:27:43 +00:00
rustc_mir_transform Drive-by get rid of a bunch of unnecessary :? 2025-03-27 17:45:18 +00:00
rustc_monomorphize Rollup merge of #138980 - tmiasko:collect-var-debug-info, r=compiler-errors 2025-03-27 15:57:25 +11:00
rustc_next_trait_solver Implement lint against using Interner and InferCtxtLike in random compiler crates 2025-03-26 04:39:38 +00:00
rustc_parse Rollup merge of #138749 - compiler-errors:closure-recovery, r=fmease 2025-03-31 14:36:21 +02:00
rustc_parse_format Slim rustc_parse_format dependencies down 2025-03-23 07:30:18 +01:00
rustc_passes Rollup merge of #138842 - Noratrieb:inline-exported, r=me,saethlin 2025-03-31 14:36:22 +02:00
rustc_pattern_analysis Auto merge of #133889 - compiler-errors:inh-unstable, r=Nadrieril 2025-03-20 14:31:34 +00:00
rustc_privacy privacy: Visit types and traits in impls in type privacy lints 2025-03-25 12:40:02 +03:00
rustc_query_impl Use a function to create QueryStackDeferred to ensure context is Copy 2025-03-26 13:09:36 +01:00
rustc_query_system Encode synthetic by-move coroutine body with a different DefPathData 2025-03-30 22:53:21 +00:00
rustc_resolve Rollup merge of #139075 - oli-obk:resolver-item-lifetime, r=compiler-errors 2025-03-28 21:18:32 +01:00
rustc_sanitizers Encode synthetic by-move coroutine body with a different DefPathData 2025-03-30 22:53:21 +00:00
rustc_serialize Convert rustc_serialize integration tests to unit tests. 2025-03-20 08:59:50 +11:00
rustc_session use slice::contains where applicable 2025-03-28 12:21:21 +00:00
rustc_smir Use -Wunused_crate_dependencies for compiler crates. 2025-03-20 08:59:43 +11:00
rustc_span Auto merge of #139083 - petrochenkov:ctxtdecod3, r=nnethercote 2025-03-31 08:44:14 +00:00
rustc_symbol_mangling Encode synthetic by-move coroutine body with a different DefPathData 2025-03-30 22:53:21 +00:00
rustc_target Auto merge of #137836 - madsmtm:openwrt-target-vendor, r=jieyouxu 2025-03-30 08:33:29 +00:00
rustc_trait_selection Rollup merge of #138176 - compiler-errors:rigid-sized-obl, r=lcnr 2025-03-31 14:36:20 +02:00
rustc_traits Rollup merge of #138394 - lcnr:yeet-variant, r=compiler-errors 2025-03-12 10:19:32 -07:00
rustc_transmute Add #[cfg(test)] for Transition in dfa 2025-03-18 07:17:16 +00:00
rustc_ty_utils Don't ICE when encountering placeholders in layout computation 2025-03-24 16:57:07 +00:00
rustc_type_ir Implement lint against using Interner and InferCtxtLike in random compiler crates 2025-03-26 04:39:38 +00:00
rustc_type_ir_macros Fold visit into ty 2025-03-15 06:34:36 +00:00
stable_mir use try_fold instead of fold 2025-03-28 12:14:09 +00:00