about summary refs log tree commit diff
path: root/tests/ui/parser
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-02-28 16:30:20 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-02-28 20:59:32 +1100
commit840c8d3243761ac7d3976239aeba6f866f9df1eb (patch)
tree3d3fde2de7464721a26d5b2c9c7fbfefdbee64a5 /tests/ui/parser
parent79766098a469c72a24464e8157f58b3c6272f3d2 (diff)
downloadrust-840c8d3243761ac7d3976239aeba6f866f9df1eb.tar.gz
rust-840c8d3243761ac7d3976239aeba6f866f9df1eb.zip
Use `LitKind::Err` for floats with unsupported bases.
This slightly changes error messages in `float-field.rs`, but nothing of
real importance.
Diffstat (limited to 'tests/ui/parser')
-rw-r--r--tests/ui/parser/float-field.rs16
-rw-r--r--tests/ui/parser/float-field.stderr124
2 files changed, 74 insertions, 66 deletions
diff --git a/tests/ui/parser/float-field.rs b/tests/ui/parser/float-field.rs
index e074b0567a3..59fefee26aa 100644
--- a/tests/ui/parser/float-field.rs
+++ b/tests/ui/parser/float-field.rs
@@ -33,15 +33,17 @@ fn main() {
 
     { s.0x1e1; } //~ ERROR no field `0x1e1` on type `S`
 
-    { s.0x1.; } //~ ERROR no field `0x1` on type `S`
-                //~| ERROR hexadecimal float literal is not supported
-                //~| ERROR unexpected token: `;`
+    { s.0x1.; } //~ ERROR hexadecimal float literal is not supported
+                //~| ERROR unexpected token: `0x1.`
+                //~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.`
 
-    { s.0x1.1; } //~ ERROR no field `0x1` on type `S`
-                 //~| ERROR hexadecimal float literal is not supported
+    { s.0x1.1; } //~ ERROR hexadecimal float literal is not supported
+                 //~| ERROR unexpected token: `0x1.1`
+                 //~| expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.1`
 
-    { s.0x1.1e1; } //~ ERROR no field `0x1` on type `S`
-                   //~| ERROR hexadecimal float literal is not supported
+    { s.0x1.1e1; } //~ ERROR hexadecimal float literal is not supported
+                   //~| ERROR unexpected token: `0x1.1e1`
+                   //~| expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.1e1`
 
     { s.0x1e+; } //~ ERROR expected expression, found `;`
 
diff --git a/tests/ui/parser/float-field.stderr b/tests/ui/parser/float-field.stderr
index 0606e321ef4..0cc1b0767dc 100644
--- a/tests/ui/parser/float-field.stderr
+++ b/tests/ui/parser/float-field.stderr
@@ -23,31 +23,31 @@ LL |     { s.0x1.1; }
    |         ^^^^^
 
 error: hexadecimal float literal is not supported
-  --> $DIR/float-field.rs:43:9
+  --> $DIR/float-field.rs:44:9
    |
 LL |     { s.0x1.1e1; }
    |         ^^^^^^^
 
 error: hexadecimal float literal is not supported
-  --> $DIR/float-field.rs:54:9
+  --> $DIR/float-field.rs:56:9
    |
 LL |     { s.0x1.1e+1; }
    |         ^^^^^^^^
 
 error: hexadecimal float literal is not supported
-  --> $DIR/float-field.rs:58:9
+  --> $DIR/float-field.rs:60:9
    |
 LL |     { s.0x1.1e-1; }
    |         ^^^^^^^^
 
 error: expected at least one digit in exponent
-  --> $DIR/float-field.rs:72:9
+  --> $DIR/float-field.rs:74:9
    |
 LL |     { s.1e+f32; }
    |         ^^^^^^
 
 error: expected at least one digit in exponent
-  --> $DIR/float-field.rs:76:9
+  --> $DIR/float-field.rs:78:9
    |
 LL |     { s.1e-f32; }
    |         ^^^^^^
@@ -130,134 +130,164 @@ error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1e-1`
 LL |     { s.1.1e-1; }
    |         ^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
 
-error: unexpected token: `;`
-  --> $DIR/float-field.rs:36:13
+error: unexpected token: `0x1.`
+  --> $DIR/float-field.rs:36:9
+   |
+LL |     { s.0x1.; }
+   |         ^^^^
+
+error: expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.`
+  --> $DIR/float-field.rs:36:9
    |
 LL |     { s.0x1.; }
-   |             ^
+   |         ^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
+
+error: unexpected token: `0x1.1`
+  --> $DIR/float-field.rs:40:9
+   |
+LL |     { s.0x1.1; }
+   |         ^^^^^
+
+error: expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.1`
+  --> $DIR/float-field.rs:40:9
+   |
+LL |     { s.0x1.1; }
+   |         ^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
+
+error: unexpected token: `0x1.1e1`
+  --> $DIR/float-field.rs:44:9
+   |
+LL |     { s.0x1.1e1; }
+   |         ^^^^^^^
+
+error: expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.1e1`
+  --> $DIR/float-field.rs:44:9
+   |
+LL |     { s.0x1.1e1; }
+   |         ^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
 
 error: expected expression, found `;`
-  --> $DIR/float-field.rs:46:14
+  --> $DIR/float-field.rs:48:14
    |
 LL |     { s.0x1e+; }
    |              ^ expected expression
 
 error: expected expression, found `;`
-  --> $DIR/float-field.rs:48:14
+  --> $DIR/float-field.rs:50:14
    |
 LL |     { s.0x1e-; }
    |              ^ expected expression
 
 error: unexpected token: `0x1.1e+1`
-  --> $DIR/float-field.rs:54:9
+  --> $DIR/float-field.rs:56:9
    |
 LL |     { s.0x1.1e+1; }
    |         ^^^^^^^^
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.1e+1`
-  --> $DIR/float-field.rs:54:9
+  --> $DIR/float-field.rs:56:9
    |
 LL |     { s.0x1.1e+1; }
    |         ^^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
 
 error: unexpected token: `0x1.1e-1`
-  --> $DIR/float-field.rs:58:9
+  --> $DIR/float-field.rs:60:9
    |
 LL |     { s.0x1.1e-1; }
    |         ^^^^^^^^
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.1e-1`
-  --> $DIR/float-field.rs:58:9
+  --> $DIR/float-field.rs:60:9
    |
 LL |     { s.0x1.1e-1; }
    |         ^^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
 
 error: suffixes on a tuple index are invalid
-  --> $DIR/float-field.rs:62:9
+  --> $DIR/float-field.rs:64:9
    |
 LL |     { s.1e1f32; }
    |         ^^^^^^ invalid suffix `f32`
 
 error: suffixes on a tuple index are invalid
-  --> $DIR/float-field.rs:67:9
+  --> $DIR/float-field.rs:69:9
    |
 LL |     { s.1.1f32; }
    |         ^^^^^^ invalid suffix `f32`
 
 error: suffixes on a tuple index are invalid
-  --> $DIR/float-field.rs:69:9
+  --> $DIR/float-field.rs:71:9
    |
 LL |     { s.1.1e1f32; }
    |         ^^^^^^^^ invalid suffix `f32`
 
 error: unexpected token: `1e+f32`
-  --> $DIR/float-field.rs:72:9
+  --> $DIR/float-field.rs:74:9
    |
 LL |     { s.1e+f32; }
    |         ^^^^^^
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1e+f32`
-  --> $DIR/float-field.rs:72:9
+  --> $DIR/float-field.rs:74:9
    |
 LL |     { s.1e+f32; }
    |         ^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
 
 error: unexpected token: `1e-f32`
-  --> $DIR/float-field.rs:76:9
+  --> $DIR/float-field.rs:78:9
    |
 LL |     { s.1e-f32; }
    |         ^^^^^^
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1e-f32`
-  --> $DIR/float-field.rs:76:9
+  --> $DIR/float-field.rs:78:9
    |
 LL |     { s.1e-f32; }
    |         ^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
 
 error: unexpected token: `1e+1f32`
-  --> $DIR/float-field.rs:80:9
+  --> $DIR/float-field.rs:82:9
    |
 LL |     { s.1e+1f32; }
    |         ^^^^^^^
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1e+1f32`
-  --> $DIR/float-field.rs:80:9
+  --> $DIR/float-field.rs:82:9
    |
 LL |     { s.1e+1f32; }
    |         ^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
 
 error: unexpected token: `1e-1f32`
-  --> $DIR/float-field.rs:83:9
+  --> $DIR/float-field.rs:85:9
    |
 LL |     { s.1e-1f32; }
    |         ^^^^^^^
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1e-1f32`
-  --> $DIR/float-field.rs:83:9
+  --> $DIR/float-field.rs:85:9
    |
 LL |     { s.1e-1f32; }
    |         ^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
 
 error: unexpected token: `1.1e+1f32`
-  --> $DIR/float-field.rs:86:9
+  --> $DIR/float-field.rs:88:9
    |
 LL |     { s.1.1e+1f32; }
    |         ^^^^^^^^^
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1e+1f32`
-  --> $DIR/float-field.rs:86:9
+  --> $DIR/float-field.rs:88:9
    |
 LL |     { s.1.1e+1f32; }
    |         ^^^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
 
 error: unexpected token: `1.1e-1f32`
-  --> $DIR/float-field.rs:89:9
+  --> $DIR/float-field.rs:91:9
    |
 LL |     { s.1.1e-1f32; }
    |         ^^^^^^^^^
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1e-1f32`
-  --> $DIR/float-field.rs:89:9
+  --> $DIR/float-field.rs:91:9
    |
 LL |     { s.1.1e-1f32; }
    |         ^^^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
@@ -284,32 +314,8 @@ LL |     { s.0x1e1; }
    |
    = note: available fields are: `0`, `1`
 
-error[E0609]: no field `0x1` on type `S`
-  --> $DIR/float-field.rs:36:9
-   |
-LL |     { s.0x1.; }
-   |         ^^^ unknown field
-   |
-   = note: available fields are: `0`, `1`
-
-error[E0609]: no field `0x1` on type `S`
-  --> $DIR/float-field.rs:40:9
-   |
-LL |     { s.0x1.1; }
-   |         ^^^ unknown field
-   |
-   = note: available fields are: `0`, `1`
-
-error[E0609]: no field `0x1` on type `S`
-  --> $DIR/float-field.rs:43:9
-   |
-LL |     { s.0x1.1e1; }
-   |         ^^^ unknown field
-   |
-   = note: available fields are: `0`, `1`
-
 error[E0609]: no field `0x1e` on type `S`
-  --> $DIR/float-field.rs:50:9
+  --> $DIR/float-field.rs:52:9
    |
 LL |     { s.0x1e+1; }
    |         ^^^^ unknown field
@@ -317,7 +323,7 @@ LL |     { s.0x1e+1; }
    = note: available fields are: `0`, `1`
 
 error[E0609]: no field `0x1e` on type `S`
-  --> $DIR/float-field.rs:52:9
+  --> $DIR/float-field.rs:54:9
    |
 LL |     { s.0x1e-1; }
    |         ^^^^ unknown field
@@ -325,7 +331,7 @@ LL |     { s.0x1e-1; }
    = note: available fields are: `0`, `1`
 
 error[E0609]: no field `1e1` on type `S`
-  --> $DIR/float-field.rs:62:9
+  --> $DIR/float-field.rs:64:9
    |
 LL |     { s.1e1f32; }
    |         ^^^^^^ unknown field
@@ -333,17 +339,17 @@ LL |     { s.1e1f32; }
    = note: available fields are: `0`, `1`
 
 error[E0609]: no field `f32` on type `(u8, u8)`
-  --> $DIR/float-field.rs:65:11
+  --> $DIR/float-field.rs:67:11
    |
 LL |     { s.1.f32; }
    |           ^^^ unknown field
 
 error[E0609]: no field `1e1` on type `(u8, u8)`
-  --> $DIR/float-field.rs:69:9
+  --> $DIR/float-field.rs:71:9
    |
 LL |     { s.1.1e1f32; }
    |         ^^^^^^^^ unknown field
 
-error: aborting due to 55 previous errors
+error: aborting due to 57 previous errors
 
 For more information about this error, try `rustc --explain E0609`.