Uh oh!
There was an error while loading. Please reload this page.
fix(debuginfo): disable overflow check for recursive non-enum types - #144407
Conversation
rustbot
commented
Jul 24, 2025
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
fee1-dead
commented
Jul 24, 2025
r? compiler |
fee1-dead
commented
Jul 24, 2025
cc @wesleywiser and @adwinwhite, this fixes regression #143241 most possibly caused by #138599 This should probably be tested |
tmiasko
commented
Jul 24, 2025
In principle, the original issue also applies to structs. For example: use std::marker::PhantomData;pubstructAB<T:'static>{puba:PhantomData<T>,pubb:*constAB<(T,T)>,}fnmain(){
std::hint::black_box(AB::<()>{a:PhantomData,b: std::ptr::null()});} |
godzie44
commented
Jul 24, 2025
Sad, i miss this example before. Btw, without the |
petrochenkov
commented
Jul 25, 2025
r? @wesleywiser as the reviewer of #138599 |
rustbot
commented
Jul 25, 2025
|
wesleywiser
left a comment
There was a problem hiding this comment.
Can you add a codegen regression test that verifies we emit the appropriate amount of debuginfo for the minimal repro you found?
https://github.com/rust-lang/rust/blob/master/tests/codegen-llvm/debuginfo-inline-callsite-location.rs might be a helpful example.
recursive non-enum types
1bef605 to
49eda8eComparegodzie44
commented
Jul 27, 2025
@rustbot ready |
wesleywiser
commented
Jul 28, 2025
bors
commented
Jul 28, 2025
…istency, r=wesleywiser fix(debuginfo): disable overflow check for recursive non-enum types Commit b10edb4 introduce an overflow check when generating debuginfo for expanding recursive types. While this check works correctly for enums, it can incorrectly prune valid debug information for structures. For example see rust-lang#143241 (rust-lang#143241 (comment)). Furthermore, for structures such check does not make sense, since structures with recursively expanding types simply will not compile (there is a `hir_analysis_recursive_generic_parameter` for that). closesrust-lang#143241
Rollup of 14 pull requests Successful merges: - #144022 (Implementation: `#[feature(sync_nonpoison)]`, `#[feature(nonpoison_mutex)]`) - #144167 (Document why `Range*<&T> as RangeBounds<T>` impls are not `T: ?Sized`, and give an alternative.) - #144407 (fix(debuginfo): disable overflow check for recursive non-enum types) - #144451 (fix: Reject upvar scrutinees for `loop_match`) - #144482 (Add explicit download methods to download module in bootstrap) - #144500 (thread name in stack overflow message) - #144511 (tidy: increase performance of auto extra checks feature) - #144586 (Update wasi-sdk to 27.0 in CI) - #144599 (bootstrap: enable tidy auto extra checks on tools profile) - #144600 (Ensure external paths passed via flags end up in rustdoc depinfo) - #144609 (feat: Right align line numbers) - #144623 (miri subtree update) - #144626 (cc dependencies: clarify comment) - #144627 (Add a test case for the issue #129882) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 13 pull requests Successful merges: - #144022 (Implementation: `#[feature(sync_nonpoison)]`, `#[feature(nonpoison_mutex)]`) - #144167 (Document why `Range*<&T> as RangeBounds<T>` impls are not `T: ?Sized`, and give an alternative.) - #144407 (fix(debuginfo): disable overflow check for recursive non-enum types) - #144451 (fix: Reject upvar scrutinees for `loop_match`) - #144482 (Add explicit download methods to download module in bootstrap) - #144500 (thread name in stack overflow message) - #144511 (tidy: increase performance of auto extra checks feature) - #144599 (bootstrap: enable tidy auto extra checks on tools profile) - #144600 (Ensure external paths passed via flags end up in rustdoc depinfo) - #144609 (feat: Right align line numbers) - #144623 (miri subtree update) - #144626 (cc dependencies: clarify comment) - #144627 (Add a test case for the issue #129882) r? `@ghost` `@rustbot` modify labels: rollup
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #144407 - godzie44:godzie44/fix_dwarf_inconsistency, r=wesleywiser fix(debuginfo): disable overflow check for recursive non-enum types Commit b10edb4 introduce an overflow check when generating debuginfo for expanding recursive types. While this check works correctly for enums, it can incorrectly prune valid debug information for structures. For example see #143241 (#143241 (comment)). Furthermore, for structures such check does not make sense, since structures with recursively expanding types simply will not compile (there is a `hir_analysis_recursive_generic_parameter` for that). closes#143241
Rollup of 13 pull requests Successful merges: - rust-lang/rust#144022 (Implementation: `#[feature(sync_nonpoison)]`, `#[feature(nonpoison_mutex)]`) - rust-lang/rust#144167 (Document why `Range*<&T> as RangeBounds<T>` impls are not `T: ?Sized`, and give an alternative.) - rust-lang/rust#144407 (fix(debuginfo): disable overflow check for recursive non-enum types) - rust-lang/rust#144451 (fix: Reject upvar scrutinees for `loop_match`) - rust-lang/rust#144482 (Add explicit download methods to download module in bootstrap) - rust-lang/rust#144500 (thread name in stack overflow message) - rust-lang/rust#144511 (tidy: increase performance of auto extra checks feature) - rust-lang/rust#144599 (bootstrap: enable tidy auto extra checks on tools profile) - rust-lang/rust#144600 (Ensure external paths passed via flags end up in rustdoc depinfo) - rust-lang/rust#144609 (feat: Right align line numbers) - rust-lang/rust#144623 (miri subtree update) - rust-lang/rust#144626 (cc dependencies: clarify comment) - rust-lang/rust#144627 (Add a test case for the issue rust-lang/rust#129882) r? `@ghost` `@rustbot` modify labels: rollup
Revert "fix(debuginfo): disable overflow check for recursive non-enum types" This reverts commit 49eda8e. Discussed during the T-compiler triage meeting with the [decision](https://rust-lang.zulipchat.com/#narrow/channel/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202025-08-28/near/536614591) to revert #144407 instead of attempting a forward fix.
Commit b10edb4 introduce an overflow check when generating debuginfo for expanding recursive types. While this check works correctly for enums, it can incorrectly prune valid debug information for structures.
For example see #143241 (#143241 (comment)). Furthermore, for structures such check does not make sense, since structures with recursively expanding types simply will not compile (there is a
hir_analysis_recursive_generic_parameterfor that).closes#143241