syntax: Return named errors from literal parsing functions

This commit is contained in:
Vadim Petrochenkov 2019-05-18 17:36:30 +03:00
parent 85334c5092
commit fcc2f92f45
6 changed files with 169 additions and 131 deletions

View file

@ -4,6 +4,6 @@ fn main() {
0x567.89;
//~^ ERROR hexadecimal float literal is not supported
0xDEAD.BEEFp-2f;
//~^ ERROR invalid suffix `f` for float literal
//~^ ERROR invalid suffix `f` for integer literal
//~| ERROR `{integer}` is a primitive type and therefore doesn't have fields
}

View file

@ -4,13 +4,13 @@ error: hexadecimal float literal is not supported
LL | 0x567.89;
| ^^^^^^^^
error: invalid suffix `f` for float literal
error: invalid suffix `f` for integer literal
--> $DIR/no-hex-float-literal.rs:6:18
|
LL | 0xDEAD.BEEFp-2f;
| ^^ invalid suffix `f`
|
= help: valid suffixes are `f32` and `f64`
= help: the suffix must be one of the integral types (`u32`, `isize`, etc)
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
--> $DIR/no-hex-float-literal.rs:2:11