Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Continue evaluating after incorrect float literal
- Loading branch information
Showing
6 changed files
with
54 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
// error-pattern:binary float literal is not supported | ||
|
||
fn main() { | ||
0b101010f64; | ||
//~^ ERROR binary float literal is not supported | ||
0b101.010; | ||
//~^ ERROR binary float literal is not supported | ||
0b101p4f64; | ||
//~^ ERROR invalid suffix `p4f64` for numeric literal | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,22 @@ | ||
error: binary float literal is not supported | ||
--> $DIR/no-binary-float-literal.rs:5:5 | ||
--> $DIR/no-binary-float-literal.rs:4:5 | ||
| | ||
LL | 0b101.010; | ||
| ^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
error: binary float literal is not supported | ||
--> $DIR/no-binary-float-literal.rs:2:5 | ||
| | ||
LL | 0b101010f64; | ||
| ^^^^^^^^^^^ not supported | ||
|
||
error: invalid suffix `p4f64` for numeric literal | ||
--> $DIR/no-binary-float-literal.rs:6:5 | ||
| | ||
LL | 0b101p4f64; | ||
| ^^^^^^^^^^ | ||
| | ||
= help: the suffix must be one of the integral types (`u32`, `isize`, etc) | ||
|
||
error: aborting due to 3 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
// error-pattern:hexadecimal float literal is not supported | ||
|
||
fn main() { | ||
0xABC.Df; | ||
//~^ ERROR `{integer}` is a primitive type and therefore doesn't have fields | ||
0x567.89; | ||
//~^ ERROR hexadecimal float literal is not supported | ||
0xDEAD.BEEFp-2f; | ||
//~^ ERROR invalid suffix `f` for float literal | ||
//~| ERROR `{integer}` is a primitive type and therefore doesn't have fields | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,29 @@ | ||
error: hexadecimal float literal is not supported | ||
--> $DIR/no-hex-float-literal.rs:5:5 | ||
--> $DIR/no-hex-float-literal.rs:4:5 | ||
| | ||
LL | 0x567.89; | ||
| ^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
error: invalid suffix `f` for float literal | ||
--> $DIR/no-hex-float-literal.rs:6:18 | ||
| | ||
LL | 0xDEAD.BEEFp-2f; | ||
| ^^ | ||
| | ||
= help: valid suffixes are `f32` and `f64` | ||
|
||
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields | ||
--> $DIR/no-hex-float-literal.rs:2:11 | ||
| | ||
LL | 0xABC.Df; | ||
| ^^ | ||
|
||
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields | ||
--> $DIR/no-hex-float-literal.rs:6:12 | ||
| | ||
LL | 0xDEAD.BEEFp-2f; | ||
| ^^^^^ | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0610`. |