rust/compiler/rustc_middle
bors 13b5a4e43b Auto merge of #129716 - compiler-errors:closure-debuginfo, r=cjgillot
Don't use `typeck_root_def_id` in codegen for finding closure's root

Generating debuginfo in codegen currently peels off all the closure-specific generics (which presumably is done because they're redundant). This doesn't currently work correctly for the bodies we synthesize for async closures's returned coroutines (#128506), leading to #129702.

Specifically, `typeck_root_def_id` for some `DefKind::SyntheticCoroutineBody` just returns itself (because it loops while `is_typeck_child` is `true`, and that returns `false` for this defkind), which means we don't end up peeling off the coroutine-specific generics, and we end up encountering an otherwise unreachable `CoroutineWitness` type leading to an ICE.

This PR fixes `is_typeck_child` to consider `DefKind::SyntheticCorotuineBody` to be a typeck child, fixing `typeck_root_def_id` and suppressing this debuginfo bug.

Fixes #129702
2024-09-16 10:16:32 +00:00
..
src Auto merge of #129716 - compiler-errors:closure-debuginfo, r=cjgillot 2024-09-16 10:16:32 +00:00
Cargo.toml disable size asserts in the compiler when randomizing layouts 2024-08-31 23:56:45 +02:00
README.md
messages.ftl Re-implement a type-size based limit 2024-07-02 15:48:48 -04:00

README.md

For more information about how rustc works, see the rustc dev guide.