Skip to content

Commit b1229c0

Browse files
Allow bounds on non-lifetime binders
1 parent 09df610 commit b1229c0

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
@@ -170,10 +170,12 @@ impl<'a> PostExpansionVisitor<'a> {
170170
)
171171
.emit();
172172
}
173-
for param in params {
174-
if !param.bounds.is_empty() {
175-
let spans: Vec<_> = param.bounds.iter().map(|b| b.span()).collect();
176-
self.sess.emit_err(errors::ForbiddenLifetimeBound { spans });
173+
if !self.features.non_lifetime_binders {
174+
for param in params {
175+
if !param.bounds.is_empty() {
176+
let spans: Vec<_> = param.bounds.iter().map(|b| b.span()).collect();
177+
self.sess.emit_err(errors::ForbiddenLifetimeBound { spans });
178+
}
177179
}
178180
}
179181
}

0 commit comments

Comments
 (0)