We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4138702 commit acabed7Copy full SHA for acabed7
compiler/rustc_parse/src/parser/item.rs
@@ -1143,8 +1143,9 @@ impl<'a> Parser<'a> {
1143
Ok(kind) => kind,
1144
Err(kind) => match kind {
1145
ItemKind::Const(box ConstItem { ty, expr, .. }) => {
1146
- let const_span = Some(span.with_hi(ident.span.lo()))
1147
- .filter(|span| span.can_be_used_for_suggestions());
+ let const_span = span
+ .can_be_used_for_suggestions()
1148
+ .then(|| span.with_hi(ident.span.lo()));
1149
self.sess.emit_err(errors::ExternItemCannotBeConst {
1150
ident_span: ident.span,
1151
const_span,
0 commit comments