Skip to content

Commit 15ffe83

Browse files
author
Lukas Markeffsky
committed
add fixme
1 parent 42cc1d2 commit 15ffe83

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

compiler/rustc_trait_selection/src/solve/normalizes_to/mod.rs

+4-1
Original file line numberDiff line numberDiff 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,

compiler/rustc_trait_selection/src/traits/project.rs

+4-3
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)