diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2022-06-01 15:38:37 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2022-06-01 15:38:37 -0300 |
| commit | 15a82d6917c66e695e8932771217f164c8fe008c (patch) | |
| tree | a8a591f1311c0f3e7a1256f8ffc59b169ff8dd14 | |
| parent | 67deaf9fea648ab39ff18cb4afe06938a0034381 (diff) | |
| download | rust-15a82d6917c66e695e8932771217f164c8fe008c.tar.gz rust-15a82d6917c66e695e8932771217f164c8fe008c.zip | |
Always assert that impl_trait_def|bounds are empty at start
| -rw-r--r-- | compiler/rustc_ast_lowering/src/item.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index deb9a8677cc..85d3bf66d8e 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -1305,13 +1305,8 @@ impl<'hir> LoweringContext<'_, 'hir> { itctx: ImplTraitContext, f: impl FnOnce(&mut Self) -> T, ) -> (&'hir hir::Generics<'hir>, T) { - match itctx { - ImplTraitContext::Universal(..) => {} - _ => { - debug_assert!(self.impl_trait_defs.is_empty()); - debug_assert!(self.impl_trait_bounds.is_empty()); - } - } + debug_assert!(self.impl_trait_defs.is_empty()); + debug_assert!(self.impl_trait_bounds.is_empty()); // Error if `?Trait` bounds in where clauses don't refer directly to type parameters. // Note: we used to clone these bounds directly onto the type parameter (and avoid lowering |
