Skip to content

Commit

Permalink
Always assert that impl_trait_def|bounds are empty at start
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Jun 1, 2022
1 parent 67deaf9 commit 15a82d6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions compiler/rustc_ast_lowering/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 15a82d6

Please sign in to comment.