This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
compiler/rustc_trait_selection/src Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -410,7 +410,10 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
410410 }
411411
412412 ty:: Alias ( _, _) | ty:: Param ( _) | ty:: Placeholder ( ..) => {
413- // FIXME(ptr_metadata): It would also be possible to return a `Ok(Ambig)` with no constraints.
413+ // This is the "fallback impl" for type parameters, unnormalizable projections
414+ // and opaque types: If the `self_ty` is `Sized`, then the metadata is `()`.
415+ // FIXME(ptr_metadata): This impl overlaps with the other impls and shouldn't
416+ // exist. Instead, `Pointee<Metadata = ()>` should be a supertrait of `Sized`.
414417 let sized_predicate = ty:: TraitRef :: from_lang_item (
415418 tcx,
416419 LangItem :: Sized ,
Original file line number Diff line number Diff line change @@ -2302,9 +2302,10 @@ fn confirm_builtin_candidate<'cx, 'tcx>(
23022302 } ;
23032303 let metadata_ty = self_ty. ptr_metadata_ty_or_tail ( tcx, normalize) . unwrap_or_else ( |tail| {
23042304 if tail == self_ty {
2305- // This is the fallback case for type parameters, unnormalizable projections
2306- // and opaque types.
2307- // If the `self_ty` is `Sized`, then the metadata is `()`.
2305+ // This is the "fallback impl" for type parameters, unnormalizable projections
2306+ // and opaque types: If the `self_ty` is `Sized`, then the metadata is `()`.
2307+ // FIXME(ptr_metadata): This impl overlaps with the other impls and shouldn't
2308+ // exist. Instead, `Pointee<Metadata = ()>` should be a supertrait of `Sized`.
23082309 let sized_predicate = ty:: TraitRef :: from_lang_item (
23092310 tcx,
23102311 LangItem :: Sized ,
You can’t perform that action at this time.
0 commit comments