From b3bc438f56693bd04b05eba44cd7a2e679f5ab0e Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Wed, 1 Jun 2022 14:43:16 -0300 Subject: [PATCH] Add debug_assert comment Co-authored-by: Camille Gillot --- compiler/rustc_ast_lowering/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 1bd2988576a0..b3aa605283fb 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -479,6 +479,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { let item = f(self); debug_assert_eq!(def_id, item.def_id()); + // `f` should have consumed all the elements in these vectors when constructing `item`. debug_assert!(self.impl_trait_defs.is_empty()); debug_assert!(self.impl_trait_bounds.is_empty()); let info = self.make_owner_info(item);