Auto merge of #79329 - camelid:int-lit-suffix-error, r=davidtwco
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:
commit
28b86e0860
7 changed files with 17 additions and 17 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue