@@ -266,8 +266,7 @@ fn collect_alloc(
266266 }
267267 }
268268 GlobalAlloc :: Static ( _) => {
269- // Keep established behavior for direct pointer/reference types.
270- // Recovery is only for non-builtin-deref container paths.
269+ // Keep builtin-deref behavior; recover only non-builtin-deref cases.
271270 if kind. clone ( ) . builtin_deref ( true ) . is_none ( ) {
272271 let prov_ty = get_prov_ty ( ty, & offset) ;
273272 debug_log_println ! (
@@ -283,7 +282,7 @@ fn collect_alloc(
283282 . visited_allocs
284283 . insert ( val, ( p_ty, global_alloc. clone ( ) ) ) ;
285284 } else {
286- // Unknown is safer than recording an incorrect outer container type .
285+ // Recovery failed: do not treat outer container `ty` as pointee .
287286 val_collector
288287 . visited_allocs
289288 . insert ( val, ( opaque_placeholder_ty ( ) , global_alloc. clone ( ) ) ) ;
@@ -295,8 +294,7 @@ fn collect_alloc(
295294 }
296295 }
297296 GlobalAlloc :: VTable ( _, _) => {
298- // Same policy as static allocs: preserve direct-deref behavior,
299- // recover only on the fallback path.
297+ // Same policy as Static: keep builtin-deref, recover non-builtin-deref.
300298 if kind. clone ( ) . builtin_deref ( true ) . is_none ( ) {
301299 let prov_ty = get_prov_ty ( ty, & offset) ;
302300 debug_log_println ! (
@@ -312,7 +310,7 @@ fn collect_alloc(
312310 . visited_allocs
313311 . insert ( val, ( p_ty, global_alloc. clone ( ) ) ) ;
314312 } else {
315- // Unknown is safer than recording an incorrect outer container type.
313+ // Unknown is safer than wrong pointee type.
316314 val_collector
317315 . visited_allocs
318316 . insert ( val, ( opaque_placeholder_ty ( ) , global_alloc. clone ( ) ) ) ;
0 commit comments