Skip to content

Commit e387597

Browse files
committed
Reword message for incorrect float literal
1 parent acbda76 commit e387597

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,10 +2002,10 @@ impl<'a> Parser<'a> {
20022002
self.bump();
20032003
let sp = lo.to(self.prev_span);
20042004
let mut err = self.diagnostic()
2005-
.struct_span_err(sp, "numeric float literals must have a significant");
2005+
.struct_span_err(sp, "float literals must have an integer part");
20062006
err.span_suggestion_with_applicability(
20072007
sp,
2008-
"numeric float literals must have a significant",
2008+
"must have an integer part",
20092009
format!("0.{}", val),
20102010
Applicability::MachineApplicable,
20112011
);

src/test/ui/issues/issue-52496.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ struct Foo { bar: f64, baz: i64, bat: i64 }
22

33
fn main() {
44
let _ = Foo { bar: .5, baz: 42 };
5-
//~^ ERROR numeric float literals must have a significant
5+
//~^ ERROR float literals must have an integer part
66
//~| ERROR missing field `bat` in initializer of `Foo`
77
//~| ERROR mismatched types
88
let bar = 1.5f32;

src/test/ui/issues/issue-52496.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: numeric float literals must have a significant
1+
error: float literals must have an integer part
22
--> $DIR/issue-52496.rs:4:24
33
|
44
LL | let _ = Foo { bar: .5, baz: 42 };
5-
| ^^ help: numeric float literals must have a significant: `0.5`
5+
| ^^ help: must have an integer part: `0.5`
66

77
error: expected one of `,` or `}`, found `.`
88
--> $DIR/issue-52496.rs:9:22

0 commit comments

Comments
 (0)