Bug
Classic trait projection (assemble_candidates_from_impls in rustc_trait_selection) still has todo!("FIXME(unsafe_binder)") for ty::UnsafeBinder when assembling built-in candidates for:
- DiscriminantKind (known-discriminant match arm)
- Pointee / metadata (struct-tail match arm)
These are separate from the new solver path in #584 / PR #587 (rustc_next_trait_solver normalizes_to), which has its own todo! arms.
Affected code
compiler/rustc_trait_selection/src/traits/project.rs (two sites)
Impact
ICE when projecting DiscriminantKind or Pointee metadata for unsafe-binder types on the classic selection/projection path.
Origin
| Lines |
Commit |
Date |
Author |
| DiscriminantKind / Pointee arms |
9a1c5eb5b385 |
2024-12-21 |
Michael Goulet |
Suggested fix
Delegate to the erased inner type (same pattern as discriminant_ty / PR #565 for pointer_kind and ptr_metadata_ty_or_tail): instantiate bound regions with erased, then treat like the inner type for candidate assembly.
Related
Bug
Classic trait projection (
assemble_candidates_from_implsinrustc_trait_selection) still hastodo!("FIXME(unsafe_binder)")forty::UnsafeBinderwhen assembling built-in candidates for:These are separate from the new solver path in #584 / PR #587 (
rustc_next_trait_solvernormalizes_to), which has its owntodo!arms.Affected code
compiler/rustc_trait_selection/src/traits/project.rs(two sites)Impact
ICE when projecting DiscriminantKind or Pointee metadata for unsafe-binder types on the classic selection/projection path.
Origin
9a1c5eb5b385Suggested fix
Delegate to the erased inner type (same pattern as
discriminant_ty/ PR #565 forpointer_kindandptr_metadata_ty_or_tail): instantiate bound regions with erased, then treat like the inner type for candidate assembly.Related
normalizes_toonly)project.rsfix; filing this so the classic projection ICEs are not only implied by hir_typeck: pointer_kind todo!() ICE on ty::UnsafeBinder #525)