Skip to content

ty: handle UnsafeBinder in pointer_kind, metadata, and projections#565

Open
SebTardif wants to merge 1 commit into
mainfrom
fix-unsafe-binder-pointer-kind
Open

ty: handle UnsafeBinder in pointer_kind, metadata, and projections#565
SebTardif wants to merge 1 commit into
mainfrom
fix-unsafe-binder-pointer-kind

Conversation

@SebTardif

@SebTardif SebTardif commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

Replace several todo!("FIXME(unsafe_binder)") paths with inner-type delegation after erasing binder regions, matching existing discriminant_ty / variant_range handling.

Files:

  • compiler/rustc_hir_typeck/src/cast.rs (pointer_kind)
  • compiler/rustc_middle/src/ty/sty.rs (ptr_metadata_ty_or_tail)
  • compiler/rustc_middle/src/ty/util.rs (is_trivially_not_async_drop, conservative false)
  • compiler/rustc_trait_selection/src/traits/project.rs (DiscriminantKind / Pointee)

Closes #525
Closes #609
Closes #610

Note

Feature is still unstable (unsafe_binder); this removes latent ICEs when such types reach these queries during experimentation or incremental enablement. Remaining todos (const_eval validity, mangling, rustc_public) are out of scope.

Origin

Lines Commit Date Author
UnsafeBinder stubs 9a1c5eb5b385 2024-12-21 Michael Goulet

Test plan

  • Code review vs existing UnsafeBinder arms in sty.rs
  • ./x.py test compiler/rustc_hir_typeck compiler/rustc_middle (optional)

Avoid todo!() ICEs on unstable unsafe binders by following the inner
type after erasing binder regions (same pattern as discriminant_ty /
variant_range elsewhere).

- hir_typeck::pointer_kind: recurse into inner type
- ptr_metadata_ty_or_tail: delegate to inner
- is_trivially_not_async_drop: conservative false without TyCtxt
- project DiscriminantKind/Pointee: treat as inner type

Closes #525

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant