Update error to reflect that integer literals can have float suffixes

For example, `1` is parsed as an integer literal, but it can be turned
into a float with the suffix `f32`. Now the error calls them "numeric
literals" and notes that you can add a float suffix since they can be
either integers or floats.
This commit is contained in:
Camelid 2020-11-22 14:29:46 -08:00
parent 52e3cf13aa
commit a3cde636fc
7 changed files with 17 additions and 17 deletions

View file

@ -1450,10 +1450,10 @@ impl<'a> Parser<'a> {
.help("valid widths are 8, 16, 32, 64 and 128")
.emit();
} else {
let msg = format!("invalid suffix `{}` for integer literal", suf);
let msg = format!("invalid suffix `{}` for number literal", suf);
self.struct_span_err(span, &msg)
.span_label(span, format!("invalid suffix `{}`", suf))
.help("the suffix must be one of the integral types (`u32`, `isize`, etc)")
.help("the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.)")
.emit();
}
}