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

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

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.

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

Development

Successfully merging this pull request may close these issues.

hir_typeck: pointer_kind todo!() ICE on ty::UnsafeBinder

1 participant