From 7278e29592b96207c755bedcc846b64a93aa9281 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Mon, 18 May 2020 11:18:41 -0700 Subject: [PATCH] Document invariants of `mk_trait_obligation_with_new_self_ty` --- src/librustc_trait_selection/traits/error_reporting/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/librustc_trait_selection/traits/error_reporting/mod.rs b/src/librustc_trait_selection/traits/error_reporting/mod.rs index c59abd360211..b1c6815c7414 100644 --- a/src/librustc_trait_selection/traits/error_reporting/mod.rs +++ b/src/librustc_trait_selection/traits/error_reporting/mod.rs @@ -1000,6 +1000,10 @@ trait InferCtxtPrivExt<'tcx> { trait_ref: &ty::PolyTraitRef<'tcx>, ); + /// Creates a `PredicateObligation` with `new_self_ty` replacing the existing type in the + /// `trait_ref`. + /// + /// For this to work, `new_self_ty` must have no escaping bound variables. fn mk_trait_obligation_with_new_self_ty( &self, param_env: ty::ParamEnv<'tcx>,