Don't use typeck_root_def_id in codegen for finding closure's root#129716
Don't use typeck_root_def_id in codegen for finding closure's root#129716bors merged 1 commit intorust-lang:masterfrom
typeck_root_def_id in codegen for finding closure's root#129716Conversation
|
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
This comment has been minimized.
This comment has been minimized.
0370d5f to
ef2f5aa
Compare
|
I lack the necessary familiarity and context |
|
@cjgillot: Are you available to review this, or should I re-roll? |
|
I'll get to it this weekend, sorry for the delay. |
ef2f5aa to
63405fc
Compare
|
@rustbot ready |
|
@bors r+ rollup |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (13b5a4e): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary -2.6%, secondary -0.5%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary 1.5%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 760.015s -> 759.454s (-0.07%) |
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_idfor someDefKind::SyntheticCoroutineBodyjust returns itself (because it loops whileis_typeck_childistrue, and that returnsfalsefor this defkind), which means we don't end up peeling off the coroutine-specific generics, and we end up encountering an otherwise unreachableCoroutineWitnesstype leading to an ICE.This PR fixes
is_typeck_childto considerDefKind::SyntheticCorotuineBodyto be a typeck child, fixingtypeck_root_def_idand suppressing this debuginfo bug.Fixes #129702