-
Notifications
You must be signed in to change notification settings - Fork 13.6k
fix(debuginfo): disable overflow check for recursive non-enum types #144407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix(debuginfo): disable overflow check for recursive non-enum types #144407
Conversation
recursive non-enum types
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
r? compiler |
cc @wesleywiser and @adwinwhite, this fixes regression #143241 most possibly caused by #138599 This should probably be tested |
In principle, the original issue also applies to structs. For example: use std::marker::PhantomData;
pub struct AB<T: 'static> {
pub a: PhantomData<T>,
pub b: *const AB<(T, T)>,
}
fn main() {
std::hint::black_box(AB::<()> { a: PhantomData, b: std::ptr::null() });
} |
Sad, i miss this example before. Btw, without the |
r? @wesleywiser as the reviewer of #138599 |
|
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).