From f2253dad24ad541618c939f363688d4e90fca72a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=C3=B3n=20Orell=20Valerian=20Liehr?= Date: Sun, 19 Feb 2023 22:54:47 +0100 Subject: [PATCH] Add some FIXMEs for follow-up PRs --- compiler/rustc_hir_analysis/src/astconv/errors.rs | 8 ++++++-- compiler/rustc_hir_analysis/src/astconv/mod.rs | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_hir_analysis/src/astconv/errors.rs b/compiler/rustc_hir_analysis/src/astconv/errors.rs index b039e654fd006..a9c2886b41448 100644 --- a/compiler/rustc_hir_analysis/src/astconv/errors.rs +++ b/compiler/rustc_hir_analysis/src/astconv/errors.rs @@ -291,6 +291,12 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { fulfillment_errors: Vec>, span: Span, ) -> ErrorGuaranteed { + // FIXME(fmease): This was copied in parts from an old version of `rustc_hir_typeck::method::suggest`. + // Either + // * update this code by applying changes similar to #106702 or by taking a + // Vec<(DefId, (DefId, DefId), Option>>)> or + // * deduplicate this code across the two crates. + let tcx = self.tcx(); let adt_did = self_ty.ty_adt_def().map(|def| def.did()); @@ -338,7 +344,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { let mut bound_spans = Vec::new(); - // FIXME(fmease): Copied from `rustc_hir_typeck::method::probe`. Deduplicate. let mut bound_span_label = |self_ty: Ty<'_>, obligation: &str, quiet: &str| { let msg = format!( "doesn't satisfy `{}`", @@ -367,7 +372,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { } }; - // FIXME(fmease): Copied from `rustc_hir_typeck::method::probe`. Deduplicate. let format_pred = |pred: ty::Predicate<'tcx>| { let bound_predicate = pred.kind(); match bound_predicate.skip_binder() { diff --git a/compiler/rustc_hir_analysis/src/astconv/mod.rs b/compiler/rustc_hir_analysis/src/astconv/mod.rs index 03b1af76f33b9..716b4fc6ae36f 100644 --- a/compiler/rustc_hir_analysis/src/astconv/mod.rs +++ b/compiler/rustc_hir_analysis/src/astconv/mod.rs @@ -2284,8 +2284,9 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { if let Some((assoc_item, def_scope, impl_substs)) = applicable_candidates.pop() { self.check_assoc_ty(assoc_item, name, def_scope, block, span); - // FIXME(inherent_associated_types): To fully *confirm* the *probed* candidate, - // we still need to register region obligations for regionck to prove/disprove. + // FIXME(inherent_associated_types): To fully *confirm* the *probed* candidate, we still + // need to relate the Self-type with fresh item substs & register region obligations for + // regionck to prove/disprove. let item_substs = self.create_substs_for_associated_item(span, assoc_item, segment, impl_substs);