From c2f7757bc5682935555850375af66285d4bcd22f Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 27 Jun 2018 08:55:41 -0400 Subject: [PATCH] extend comment to note complications around lifetimes --- src/librustc/infer/canonical/query_result.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/librustc/infer/canonical/query_result.rs b/src/librustc/infer/canonical/query_result.rs index ccb43c1fcdf7..a4e33b7d8685 100644 --- a/src/librustc/infer/canonical/query_result.rs +++ b/src/librustc/infer/canonical/query_result.rs @@ -46,6 +46,13 @@ impl<'cx, 'gcx, 'tcx> InferCtxtBuilder<'cx, 'gcx, 'tcx> { /// canonical result created. /// /// Returns `NoSolution` in the event of any error. + /// + /// (It might be mildly nicer to implement this on `TyCtxt`, and + /// not `InferCtxtBuilder`, but that is a bit tricky right now. + /// In part because we would need a `for<'gcx: 'tcx>` sort of + /// bound for the closure and in part because it is convenient to + /// have `'tcx` be free on this function so that we can talk about + /// `K: TypeFoldable<'tcx>`.) pub fn enter_canonical_trait_query( &'tcx mut self, canonical_key: &Canonical<'tcx, K>,