Skip to content

Commit

Permalink
Style improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Noratrieb committed Dec 7, 2023
1 parent 4138702 commit acabed7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/rustc_parse/src/parser/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1143,8 +1143,9 @@ impl<'a> Parser<'a> {
Ok(kind) => kind,
Err(kind) => match kind {
ItemKind::Const(box ConstItem { ty, expr, .. }) => {
let const_span = Some(span.with_hi(ident.span.lo()))
.filter(|span| span.can_be_used_for_suggestions());
let const_span = span
.can_be_used_for_suggestions()
.then(|| span.with_hi(ident.span.lo()));
self.sess.emit_err(errors::ExternItemCannotBeConst {
ident_span: ident.span,
const_span,
Expand Down

0 comments on commit acabed7

Please sign in to comment.