about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-04-04 20:36:18 -0400
committerMichael Goulet <michael@errs.io>2024-04-15 16:45:48 -0400
commitac7651ccaf7447e695bf505916463927b78e433f (patch)
treecf15c9e381179b9b76f83ec7518e39fb0837923f /compiler/rustc_hir_analysis/src
parent52c6b101ea18ed6f09367bf459ac55ffe473cd9c (diff)
downloadrust-ac7651ccaf7447e695bf505916463927b78e433f.tar.gz
rust-ac7651ccaf7447e695bf505916463927b78e433f.zip
More polishing
Diffstat (limited to 'compiler/rustc_hir_analysis/src')
-rw-r--r--compiler/rustc_hir_analysis/src/check/check.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs
index 1e8cd50ca0d..8c85d13650b 100644
--- a/compiler/rustc_hir_analysis/src/check/check.rs
+++ b/compiler/rustc_hir_analysis/src/check/check.rs
@@ -475,6 +475,14 @@ fn sanity_check_found_hidden_type<'tcx>(
     }
 }
 
+/// Check that the opaque's precise captures list is valid (if present).
+/// We check this for regular `impl Trait`s and also RPITITs, even though the latter
+/// are technically GATs.
+///
+/// This function is responsible for:
+/// 1. Checking that all type/const params are mention in the captures list.
+/// 2. Checking that all lifetimes that are implicitly captured are mentioned.
+/// 3. Asserting that all parameters mentioned in the captures list are invariant.
 fn check_opaque_precise_captures<'tcx>(tcx: TyCtxt<'tcx>, opaque_def_id: LocalDefId) {
     let hir::OpaqueTy { precise_capturing_args, .. } =
         *tcx.hir_node_by_def_id(opaque_def_id).expect_item().expect_opaque_ty();