self.bump();
let sp = lo.to(self.prev_span);
let mut err = self.diagnostic()
- .struct_span_err(sp, "numeric float literals must have a significant");
+ .struct_span_err(sp, "float literals must have an integer part");
err.span_suggestion_with_applicability(
sp,
- "numeric float literals must have a significant",
+ "must have an integer part",
format!("0.{}", val),
Applicability::MachineApplicable,
);
fn main() {
let _ = Foo { bar: .5, baz: 42 };
- //~^ ERROR numeric float literals must have a significant
+ //~^ ERROR float literals must have an integer part
//~| ERROR missing field `bat` in initializer of `Foo`
//~| ERROR mismatched types
let bar = 1.5f32;
-error: numeric float literals must have a significant
+error: float literals must have an integer part
--> $DIR/issue-52496.rs:4:24
|
LL | let _ = Foo { bar: .5, baz: 42 };
- | ^^ help: numeric float literals must have a significant: `0.5`
+ | ^^ help: must have an integer part: `0.5`
error: expected one of `,` or `}`, found `.`
--> $DIR/issue-52496.rs:9:22