diff options
| author | Adwin White <adwinw01@gmail.com> | 2025-08-12 17:13:13 +0800 |
|---|---|---|
| committer | Adwin White <adwinw01@gmail.com> | 2025-08-12 17:13:13 +0800 |
| commit | e13e1e4c0c3253d25e2571ed7e58b3a02e28e922 (patch) | |
| tree | 318a92530b9f133a98c06c03e334f7b9ae161a9b /tests | |
| parent | 61cb1e97fcf954c37d0a457a8084ed9ad8b3cb82 (diff) | |
| download | rust-e13e1e4c0c3253d25e2571ed7e58b3a02e28e922.tar.gz rust-e13e1e4c0c3253d25e2571ed7e58b3a02e28e922.zip | |
fix(debuginfo): handle false positives in overflow check
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/debuginfo/recursive-struct.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/debuginfo/recursive-struct.rs b/tests/debuginfo/recursive-struct.rs index 5be90992848..427a7100a4f 100644 --- a/tests/debuginfo/recursive-struct.rs +++ b/tests/debuginfo/recursive-struct.rs @@ -62,6 +62,7 @@ use self::Opt::{Empty, Val}; use std::boxed::Box as B; +use std::marker::PhantomData; enum Opt<T> { Empty, @@ -98,6 +99,11 @@ struct LongCycleWithAnonymousTypes { value: usize, } +struct Expanding<T> { + a: PhantomData<T>, + b: *const Expanding<(T, T)>, +} + // This test case makes sure that recursive structs are properly described. The Node structs are // generic so that we can have a new type (that newly needs to be described) for the different // cases. The potential problem with recursive types is that the DI generation algorithm gets @@ -205,6 +211,9 @@ fn main() { value: 30 }))))); + // This type can generate new instances infinitely if not handled properly. + std::hint::black_box(Expanding::<()> { a: PhantomData, b: std::ptr::null() }); + zzz(); // #break } |
