about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-07-13 18:27:40 +0000
committerMichael Goulet <michael@errs.io>2023-07-14 15:03:21 +0000
commit1ef85d82e0904367a603f97c100bcbb23f8ce2ff (patch)
treecc97763176379b18f4a4c08463fafceeba024dac
parent4bcca3294a2074fa07631c662067d5ccf31b8cfa (diff)
downloadrust-1ef85d82e0904367a603f97c100bcbb23f8ce2ff.tar.gz
rust-1ef85d82e0904367a603f97c100bcbb23f8ce2ff.zip
assertion, comment
-rw-r--r--compiler/rustc_trait_selection/src/solve/normalize.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/normalize.rs b/compiler/rustc_trait_selection/src/solve/normalize.rs
index 524bac19547..67e6f5246c8 100644
--- a/compiler/rustc_trait_selection/src/solve/normalize.rs
+++ b/compiler/rustc_trait_selection/src/solve/normalize.rs
@@ -20,11 +20,15 @@ pub(crate) fn deeply_normalize<'tcx, T: TypeFoldable<TyCtxt<'tcx>>>(
     at: At<'_, 'tcx>,
     value: T,
 ) -> Result<T, Vec<FulfillmentError<'tcx>>> {
+    assert!(!value.has_escaping_bound_vars());
     deeply_normalize_with_skipped_universes(at, value, vec![])
 }
 
 /// Deeply normalize all aliases in `value`. This does not handle inference and expects
 /// its input to be already fully resolved.
+///
+/// Additionally takes a list of universes which represents the binders which have been
+/// entered before passing `value` to the function.
 pub(crate) fn deeply_normalize_with_skipped_universes<'tcx, T: TypeFoldable<TyCtxt<'tcx>>>(
     at: At<'_, 'tcx>,
     value: T,