Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 5c245de

Browse files
committed
[crater-only] Ban assoc ty unbounds
1 parent f334342 commit 5c245de

File tree

1 file changed

+8
-0
lines changed
  • compiler/rustc_ast_lowering/src

1 file changed

+8
-0
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,14 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
10311031
&*self.arena.alloc(self.ty(constraint.span, hir::TyKind::Err(guar)));
10321032
hir::AssocItemConstraintKind::Equality { term: err_ty.into() }
10331033
} else {
1034+
for bound in bounds {
1035+
if let ast::GenericBound::Trait(trait_ref) = bound
1036+
&& let ast::BoundPolarity::Maybe(_) = trait_ref.modifiers.polarity
1037+
{
1038+
self.dcx().struct_span_err(trait_ref.span, "<hit>").emit();
1039+
}
1040+
}
1041+
10341042
// Desugar `AssocTy: Bounds` into an assoc type binding where the
10351043
// later desugars into a trait predicate.
10361044
let bounds = self.lower_param_bounds(bounds, itctx);

0 commit comments

Comments
 (0)