File tree 2 files changed +8
-4
lines changed
compiler/rustc_trait_selection/src
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> {
410
410
}
411
411
412
412
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`.
414
417
let sized_predicate = ty:: TraitRef :: from_lang_item (
415
418
tcx,
416
419
LangItem :: Sized ,
Original file line number Diff line number Diff line change @@ -2302,9 +2302,10 @@ fn confirm_builtin_candidate<'cx, 'tcx>(
2302
2302
} ;
2303
2303
let metadata_ty = self_ty. ptr_metadata_ty_or_tail ( tcx, normalize) . unwrap_or_else ( |tail| {
2304
2304
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`.
2308
2309
let sized_predicate = ty:: TraitRef :: from_lang_item (
2309
2310
tcx,
2310
2311
LangItem :: Sized ,
You can’t perform that action at this time.
0 commit comments