ty: handle UnsafeBinder in pointer_kind, metadata, and projections#565
Open
SebTardif wants to merge 1 commit into
Open
ty: handle UnsafeBinder in pointer_kind, metadata, and projections#565SebTardif wants to merge 1 commit into
SebTardif wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace several
todo!("FIXME(unsafe_binder)")paths with inner-type delegation after erasing binder regions, matching existingdiscriminant_ty/variant_rangehandling.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, conservativefalse)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
sty.rs./x.py test compiler/rustc_hir_typeck compiler/rustc_middle(optional)