Skip to content

Commit ef04c64

Browse files
committed
error on empty precision
1 parent 8239a37 commit ef04c64

File tree

1 file changed

+6
-1
lines changed
  • compiler/rustc_parse_format/src

1 file changed

+6
-1
lines changed

compiler/rustc_parse_format/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,12 @@ impl<'a> Parser<'a> {
697697
spec.precision = self.count(start + 1);
698698
}
699699
let end = self.current_pos();
700-
spec.precision_span = Some(self.span(start, end));
700+
let span = self.span(start, end);
701+
if spec.precision == CountImplied {
702+
self.err("expected numerical precision", "missing precision", span);
703+
} else {
704+
spec.precision_span = Some(span);
705+
}
701706
}
702707

703708
let ty_span_start = self.current_pos();

0 commit comments

Comments
 (0)