Skip to content

Commit 24c6468

Browse files
Allow bounds on non-lifetime binders
1 parent 3562c53 commit 24c6468

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,12 @@ impl<'a> PostExpansionVisitor<'a> {
164164
non_lt_param_spans,
165165
crate::fluent_generated::ast_passes_forbidden_non_lifetime_param
166166
);
167-
for param in params {
168-
if !param.bounds.is_empty() {
169-
let spans: Vec<_> = param.bounds.iter().map(|b| b.span()).collect();
170-
self.sess.emit_err(errors::ForbiddenLifetimeBound { spans });
167+
if !self.features.non_lifetime_binders {
168+
for param in params {
169+
if !param.bounds.is_empty() {
170+
let spans: Vec<_> = param.bounds.iter().map(|b| b.span()).collect();
171+
self.sess.emit_err(errors::ForbiddenLifetimeBound { spans });
172+
}
171173
}
172174
}
173175
}

0 commit comments

Comments
 (0)