Skip to content

Commit 1f50a2e

Browse files
committed
Fix a FIXME.
Contrary to what the comment says, `gate_feature_post` can be used with multiple spans, as is seen in the `gate_all!` macro. (The treatment is simplistic, but it works.)
1 parent c7fb0f9 commit 1f50a2e

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

+5-9
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,11 @@ impl<'a> PostExpansionVisitor<'a> {
144144
_ => Some(param.ident.span),
145145
})
146146
.collect();
147-
// FIXME: gate_feature_post doesn't really handle multispans...
148-
if !non_lt_param_spans.is_empty() && !self.features.non_lifetime_binders {
149-
feature_err(
150-
&self.sess.parse_sess,
151-
sym::non_lifetime_binders,
152-
non_lt_param_spans,
153-
crate::fluent_generated::ast_passes_forbidden_non_lifetime_param,
154-
)
155-
.emit();
147+
if !non_lt_param_spans.is_empty() {
148+
for span in non_lt_param_spans {
149+
let msg = crate::fluent_generated::ast_passes_forbidden_non_lifetime_param;
150+
gate_feature_post!(self, non_lifetime_binders, span, msg);
151+
}
156152
}
157153
for param in params {
158154
if !param.bounds.is_empty() {

0 commit comments

Comments
 (0)