rust/compiler
Michael Goulet 9d46af12e0
Rollup merge of #141584 - compiler-errors:typing-env-synthetic-body, r=lcnr
Support `opaque_types_defined_by` for `SyntheticCoroutineBody`

We create a synthetic MIR body for the `AsyncFnOnce` impl for async closures. That body goes through all passes that a regular body does, including promotion.

Promotion sometimes requires computing that the type of an rvalue is `Freeze`, which requires computing the typing env of a body. This requires calling `opaque_types_defined_by` on the body's def id, which leads to an ICE today since we don't expect that query to be called for synthetic bodies.

While we could fix this by, for example, computing the typeck root of the body before calling a `TypingEnv` constructor, I think it's appropriate to do a more general fix here since I think it's reasonable that other passes might do analysis too.

Fixes rust-lang/rust#141466

r? ```@lcnr``` or ```@oli-obk```
2025-05-27 13:01:40 +02:00
..
rustc Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_abi Initial UnsafePinned/UnsafeUnpin impl [Part 1: Libs] 2025-04-13 01:11:04 -04:00
rustc_arena Introduce Arena::try_alloc_from_iter. 2025-04-19 01:13:18 +00:00
rustc_ast Remove out-of-date noop_* names. 2025-05-27 19:16:11 +10:00
rustc_ast_ir Use -Wunused_crate_dependencies for compiler crates. 2025-03-20 08:59:43 +11:00
rustc_ast_lowering Rename kw::Empty as sym::empty. 2025-05-22 11:55:22 +10:00
rustc_ast_passes update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_ast_pretty Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
rustc_attr_data_structures Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING 2025-05-24 23:54:17 +02:00
rustc_attr_parsing Rollup merge of #140539 - nnethercote:simplify-attribute_groups, r=jdonszelmann 2025-05-26 03:38:16 +02: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 Rollup merge of #139668 - matthewjasper:upper-bound-fix, r=compiler-errors 2025-05-22 16:02:26 +02:00
rustc_builtin_macros Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_codegen_cranelift Merge commit '979dcf8e2f' into sync_cg_clif-2025-05-25 2025-05-25 18:51:16 +00:00
rustc_codegen_gcc Cleanup CodegenFnAttrFlags 2025-05-24 20:31:37 +02:00
rustc_codegen_llvm Cleanup CodegenFnAttrFlags 2025-05-24 20:31:37 +02:00
rustc_codegen_ssa Auto merge of #138489 - tmiasko:call-tmps-lifetime, r=workingjubilee 2025-05-26 01:16:52 +00:00
rustc_const_eval Rollup merge of #141582 - RalfJung:cleanup, r=bjorn3 2025-05-27 13:01:39 +02:00
rustc_data_structures Rollup merge of #139668 - matthewjasper:upper-bound-fix, r=compiler-errors 2025-05-22 16:02:26 +02:00
rustc_driver Remove recursion_limit increases. 2025-04-02 16:25:27 +11:00
rustc_driver_impl compiler & tools: bump windows crate to dedupe versions 2025-05-17 15:26:38 +03:00
rustc_error_codes resolve: Support imports of associated types and glob imports from traits 2025-05-02 15:59:38 +03:00
rustc_error_messages update cfgs 2025-04-09 12:29:59 +01:00
rustc_errors compiler & tools: bump windows crate to dedupe versions 2025-05-17 15:26:38 +03:00
rustc_expand Remove out-of-date noop_* names. 2025-05-27 19:16:11 +10:00
rustc_feature Stabilize avx512_target_feature 2025-05-18 11:12:15 +05:30
rustc_fluent_macro update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_fs_util Retry if creating temp fails with access denied 2025-04-25 11:28:36 +00: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 Rename kw::Empty as sym::empty. 2025-05-22 11:55:22 +10:00
rustc_hir_analysis Use more detailed spans in dyn compat errors within bodies 2025-05-27 08:18:11 +00:00
rustc_hir_pretty update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_hir_typeck Rollup merge of #141580 - oli-obk:early-dyn-catches-the-incompat, r=compiler-errors 2025-05-27 13:01:38 +02:00
rustc_incremental Auto merge of #139758 - Zoxc:thread-local-graph, r=oli-obk 2025-05-07 12:39:54 +00:00
rustc_index Add copy_within to IndexSlice 2025-04-15 10:44:28 -04:00
rustc_index_macros In rustc_mir_tranform, iterate over index newtypes instead of ints 2025-04-12 11:53:07 +00:00
rustc_infer Auto merge of #141605 - jieyouxu:rollup-3gjqh5l, r=jieyouxu 2025-05-26 20:30:06 +00:00
rustc_interface Move -Zcrate-attr injection to just after crate root parsing 2025-05-21 14:32:40 +00:00
rustc_lexer Implement RFC 3503: frontmatters 2025-05-05 23:10:08 +08:00
rustc_lint Rollup merge of #141536 - Urgau:ambi_wide_ptr-cmp-diag, r=fee1-dead 2025-05-27 13:01:36 +02:00
rustc_lint_defs make enabling the neon target feature a FCW 2025-05-22 12:19:25 +02:00
rustc_llvm Experimental cygwin support in rustc 2025-05-15 23:34:11 +08:00
rustc_log Allow linking rustc and rustdoc against the same single tracing crate 2025-05-03 10:18:50 -07:00
rustc_macros Allow trailing comma after argument in query definition 2025-05-20 10:22:08 +00:00
rustc_metadata Introduce tcx.anon_const_kind query 2025-05-21 20:20:19 +01:00
rustc_middle Rollup merge of #141582 - RalfJung:cleanup, r=bjorn3 2025-05-27 13:01:39 +02:00
rustc_mir_build Rollup merge of #141513 - nia-e:allocbytes-extend, r=RalfJung 2025-05-27 01:29:20 +08:00
rustc_mir_dataflow update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_mir_transform Rollup merge of #141513 - nia-e:allocbytes-extend, r=RalfJung 2025-05-27 01:29:20 +08:00
rustc_monomorphize Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_next_trait_solver Auto merge of #141605 - jieyouxu:rollup-3gjqh5l, r=jieyouxu 2025-05-26 20:30:06 +00:00
rustc_parse Rollup merge of #141003 - clubby789:ternary-improve, r=compiler-errors 2025-05-16 07:19:41 +02:00
rustc_parse_format Remove duplicate impl of string unescape 2025-05-06 10:00:22 +00:00
rustc_passes Cleanup CodegenFnAttrFlags 2025-05-24 20:31:37 +02:00
rustc_pattern_analysis Revert "Fix stack overflow in exhaustiveness due to recursive HIR opaque type values" 2025-05-20 10:09:01 +00:00
rustc_privacy Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_query_impl Auto merge of #140145 - Zoxc:job-server-proxy, r=SparrowLii 2025-05-01 04:11:52 +00:00
rustc_query_system Handle rustc_query_system cases of rustc::potential_query_instability lint 2025-05-14 08:59:55 +03:00
rustc_resolve Rollup merge of #141376 - nnethercote:rename-kw-Empty, r=petrochenkov 2025-05-23 13:34:20 +02:00
rustc_sanitizers update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_serialize Zero the buffer passed from write_with 2025-04-25 07:14:27 +02:00
rustc_session current_dll_path: fix mistake in assertion message 2025-05-19 20:20:54 +02:00
rustc_smir extend allocbytes with associated type 2025-05-26 00:15:16 +02:00
rustc_span Rollup merge of #141376 - nnethercote:rename-kw-Empty, r=petrochenkov 2025-05-23 13:34:20 +02:00
rustc_symbol_mangling Rename kw::Empty as sym::empty. 2025-05-22 11:55:22 +10:00
rustc_target Enable xray support for Mac 2025-05-24 15:06:53 +08:00
rustc_trait_selection Auto merge of #141605 - jieyouxu:rollup-3gjqh5l, r=jieyouxu 2025-05-26 20:30:06 +00:00
rustc_traits Querify coroutine_hidden_types 2025-05-20 11:50:25 +00:00
rustc_transmute Rollup merge of #140509 - tmiasko:merge-contiguous-ranges, r=jswrenn 2025-05-02 19:37:56 +02:00
rustc_ty_utils Support opaque_types_defined_by for SyntheticCoroutineBody 2025-05-26 12:19:34 +00:00
rustc_type_ir Don't rerun goals if none of its vars have changed 2025-05-26 10:10:03 +00:00
rustc_type_ir_macros Split TypeFolder and FallibleTypeFolder 2025-04-15 18:30:35 +00:00
stable_mir Change rustc_driver dependency on stable_mir crate 2025-04-30 15:39:52 -07:00