Repository: apollographql/apollo-rs
Pull request #654 (2023-09-25 11:23:24)

fix(deps): update rust crate ordered-float to v4
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ordered-float](https://togithub.com/reem/rust-ordered-float) | dependencies | major | `3.7.0` -> `4.0.0` |

---

### Release Notes

<details>
<summary>reem/rust-ordered-float (ordered-float)</summary>

### [`v4.1.0`](https://togithub.com/reem/rust-ordered-float/releases/tag/v4.1.0)

[Compare Source](https://togithub.com/reem/rust-ordered-float/compare/v4.0.0...v4.1.0)

#### What's Changed

-   Re-export FloatCore by [@&#8203;mbrubeck](https://togithub.com/mbrubeck) in [https://github.com/reem/rust-ordered-float/pull/141](https://togithub.com/reem/rust-ordered-float/pull/141)

**Full Changelog**: https://github.com/reem/rust-ordered-float/compare/v4.0.0...v4.1.0

### [`v4.0.0`](https://togithub.com/reem/rust-ordered-float/releases/tag/v4.0.0)

[Compare Source](https://togithub.com/reem/rust-ordered-float/compare/v3.9.1...v4.0.0)

#### What's Changed

-   **Breaking change:** Always require `num_traits::float::FloatCore` instead of `num_traits::Float` where possible, by [@&#8203;kpreid](https://togithub.com/kpreid) in [https://github.com/reem/rust-ordered-float/pull/138](https://togithub.com/reem/rust-ordered-float/pull/138)

**Full Changelog**: https://github.com/reem/rust-ordered-float/compare/v3.9.1...v4.0.0

### [`v3.9.1`](https://togithub.com/reem/rust-ordered-float/releases/tag/v3.9.1)

[Compare Source](https://togithub.com/reem/rust-ordered-float/compare/v3.9.0...v3.9.1)

-   Fix build error with the `rkyv` feature enabled (#&#8203[https://github.com/reem/rust-ordered-float/issues/137](https://togithub.com/reem/rust-ordered-float/issues/137)es/137)).

### [`v3.9.0`](https://togithub.com/reem/rust-ordered-float/releases/tag/v3.9.0)

[Compare Source](https://togithub.com/reem/rust-ordered-float/compare/v3.8.0...v3.9.0)

#### What's Changed

-   Implement `rkyv` endianess by [@&#8203;MucTepDayH16](https://togithub.com/MucTepDayH16) in [https://github.com/reem/rust-ordered-float/pull/136](https://togithub.com/reem/rust-ordered-float/pull/136)

#### New Contributors

-   [@&#8203;MucTepDayH16](https://togithub.com/MucTepDayH16) made their first contribution in [https://github.com/reem/rust-ordered-float/pull/136](https://togithub.com/reem/rust-ordered-float/pull/136)

**Full Changelog**: https://github.com/reem/rust-ordered-float/compare/v3.8.0...v3.9.0

### [`v3.8.0`](https://togithub.com/reem/rust-ordered-float/releases/tag/v3.8.0)

[Compare Source](https://togithub.com/reem/rust-ordered-float/compare/v3.7.0...v3.8.0)

#### What's Changed

-   Pow support by [@&#8203;cdchamness](https://togithub.com/cdchamness) in [https://github.com/reem/rust-ordered-float/pull/132](https://togithub.com/reem/rust-ordered-float/pull/132)
-   Don't activate `rand` dependency when only the `serde` feature is given. by [@&#8203;kpreid](https://togithub.com/kpreid) in [https://github.com/reem/rust-ordered-float/pull/133](https://togithub.com/reem/rust-ordered-float/pull/133)
-   Export `UniformOrdered` and `UniformNotNan` by [@&#8203;MathisWellmann](https://togithub.com/MathisWellmann) in [https://github.com/reem/rust-ordered-float/pull/134](https://togithub.com/reem/rust-ordered-float/pull/134)
-   Support the same conversions from integer types as `f64` and `f32`. by [@&#8203;blp](https://togithub.com/blp) in [https://github.com/reem/rust-ordered-float/pull/135](https://togithub.com/reem/rust-ordered-float/pull/135)

#### New Contributors

-   [@&#8203;cdchamness](https://togithub.com/cdchamness) made their first contribution in [https://github.com/reem/rust-ordered-float/pull/132](https://togithub.com/reem/rust-ordered-float/pull/132)
-   [@&#8203;MathisWellmann](https://togithub.com/MathisWellmann) made their first contribution in [https://github.com/reem/rust-ordered-float/pull/134](https://togithub.com/reem/rust-ordered-float/pull/134)
-   [@&#8203;blp](https://togithub.com/blp) made their first contribution in [https://github.com/reem/rust-ordered-float/pull/135](https://togithub.com/reem/rust-ordered-float/pull/135)

**Full Changelog**: https://github.com/reem/rust-ordered-float/compare/v3.7.0...v3.8.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - "after 8am and before 4pm on tuesday" in timezone Etc/UTC.

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNTkuNSIsInVwZGF0ZWRJblZlciI6IjM1LjE1OS41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->



Patch:
diff --git a/crates/apollo-compiler/Cargo.toml b/crates/apollo-compiler/Cargo.toml
index dc69a71..7c688e0 100644
--- a/crates/apollo-compiler/Cargo.toml
+++ b/crates/apollo-compiler/Cargo.toml
@@ -22,7 +22,7 @@ ariadne = { version = "0.3.0", features = ["auto-color"] }
 indexmap = "2.0.0"
 rowan = "0.15.5"
 salsa = "0.16.1"
-ordered-float = { version = "3.7.0", features = ["std"] }
+ordered-float = { version = "4.0.0", features = ["std"] }
 thiserror = "1.0.31"
 
 [target.'cfg(target_arch = "wasm32")'.dependencies]
diff --git a/crates/apollo-parser/src/parser/grammar/ty.rs b/crates/apollo-parser/src/parser/grammar/ty.rs
index 3f2acdf..50294ad 100644
--- a/crates/apollo-parser/src/parser/grammar/ty.rs
+++ b/crates/apollo-parser/src/parser/grammar/ty.rs
@@ -41,9 +41,7 @@ fn parse<'a>(p: &mut Parser<'a>) -> Result<(), Token<'a>> {
                 // type, so both opening and closing brackets `[]`.
                 p.err_at_token(&token, "expected item type");
             }
-            if let Some(T![']']) = p.peek() {
-                p.eat(S![']']);
-            }
+            p.expect(T![']'], S![']'])
         }
         Some(TokenKind::Name) => {
             let _guard = p.start_node(SyntaxKind::NAMED_TYPE);


Test patch:
diff --git a/crates/apollo-parser/test_data/parser/err/0044_list_type_with_no_type.txt b/crates/apollo-parser/test_data/parser/err/0044_list_type_with_no_type.txt
index 1b5d513..1a693e2 100644
--- a/crates/apollo-parser/test_data/parser/err/0044_list_type_with_no_type.txt
+++ b/crates/apollo-parser/test_data/parser/err/0044_list_type_with_no_type.txt
@@ -47,6 +47,10 @@
     - ERROR@67..68 "}"
     - WHITESPACE@68..69 "\n"
 - ERROR@22:23 "expected item type" ]
+- ERROR@23:24 "expected R_BRACK, got  "  
+- ERROR@60:64 "expected R_BRACK, got Type" Type
+- ERROR@60:64 "expected R_BRACK, got Type" Type
+- ERROR@60:64 "expected R_BRACK, got Type" Type
 - ERROR@64:65 "expected a type" ]
 - ERROR@64:65 "expected R_CURLY, got ]" ]
 - ERROR@64:65 "expected a StringValue, Name or OperationDefinition" ]
diff --git a/crates/apollo-parser/test_data/parser/err/0048_unbalanced_list_type_1.graphql b/crates/apollo-parser/test_data/parser/err/0048_unbalanced_list_type_1.graphql
new file mode 100644
index 0000000..34f99c8
--- /dev/null
+++ b/crates/apollo-parser/test_data/parser/err/0048_unbalanced_list_type_1.graphql
@@ -0,0 +1,3 @@
+type Query {
+    unbalanced: [[Int]]]
+}
diff --git a/crates/apollo-parser/test_data/parser/err/0048_unbalanced_list_type_1.txt b/crates/apollo-parser/test_data/parser/err/0048_unbalanced_list_type_1.txt
new file mode 100644
index 0000000..85daa67
--- /dev/null
+++ b/crates/apollo-parser/test_data/parser/err/0048_unbalanced_list_type_1.txt
@@ -0,0 +1,32 @@
+- DOCUMENT@0..40
+    - OBJECT_TYPE_DEFINITION@0..36
+        - type_KW@0..4 "type"
+        - WHITESPACE@4..5 " "
+        - NAME@5..10
+            - IDENT@5..10 "Query"
+        - WHITESPACE@10..11 " "
+        - FIELDS_DEFINITION@11..36
+            - L_CURLY@11..12 "{"
+            - WHITESPACE@12..17 "\n    "
+            - FIELD_DEFINITION@17..36
+                - NAME@17..27
+                    - IDENT@17..27 "unbalanced"
+                - COLON@27..28 ":"
+                - WHITESPACE@28..29 " "
+                - LIST_TYPE@29..36
+                    - L_BRACK@29..30 "["
+                    - LIST_TYPE@30..35
+                        - L_BRACK@30..31 "["
+                        - NAMED_TYPE@31..34
+                            - NAME@31..34
+                                - IDENT@31..34 "Int"
+                        - R_BRACK@34..35 "]"
+                    - R_BRACK@35..36 "]"
+    - ERROR@36..37 "]"
+    - WHITESPACE@37..38 "\n"
+    - ERROR@38..39 "}"
+    - WHITESPACE@39..40 "\n"
+- ERROR@36:37 "expected R_CURLY, got ]" ]
+- ERROR@36:37 "expected a StringValue, Name or OperationDefinition" ]
+- ERROR@38:39 "expected a StringValue, Name or OperationDefinition" }
+recursion limit: 4096, high: 0
\ No newline at end of file
diff --git a/crates/apollo-parser/test_data/parser/err/0049_unbalanced_list_type_2.graphql b/crates/apollo-parser/test_data/parser/err/0049_unbalanced_list_type_2.graphql
new file mode 100644
index 0000000..b677251
--- /dev/null
+++ b/crates/apollo-parser/test_data/parser/err/0049_unbalanced_list_type_2.graphql
@@ -0,0 +1,3 @@
+type Query {
+    unbalanced: [[[Int]]
+}
diff --git a/crates/apollo-parser/test_data/parser/err/0049_unbalanced_list_type_2.txt b/crates/apollo-parser/test_data/parser/err/0049_unbalanced_list_type_2.txt
new file mode 100644
index 0000000..39b36ee
--- /dev/null
+++ b/crates/apollo-parser/test_data/parser/err/0049_unbalanced_list_type_2.txt
@@ -0,0 +1,31 @@
+- DOCUMENT@0..40
+    - OBJECT_TYPE_DEFINITION@0..39
+        - type_KW@0..4 "type"
+        - WHITESPACE@4..5 " "
+        - NAME@5..10
+            - IDENT@5..10 "Query"
+        - WHITESPACE@10..11 " "
+        - FIELDS_DEFINITION@11..39
+            - L_CURLY@11..12 "{"
+            - WHITESPACE@12..17 "\n    "
+            - FIELD_DEFINITION@17..37
+                - NAME@17..27
+                    - IDENT@17..27 "unbalanced"
+                - COLON@27..28 ":"
+                - WHITESPACE@28..29 " "
+                - LIST_TYPE@29..37
+                    - L_BRACK@29..30 "["
+                    - LIST_TYPE@30..37
+                        - L_BRACK@30..31 "["
+                        - LIST_TYPE@31..36
+                            - L_BRACK@31..32 "["
+                            - NAMED_TYPE@32..35
+                                - NAME@32..35
+                                    - IDENT@32..35 "Int"
+                            - R_BRACK@35..36 "]"
+                        - R_BRACK@36..37 "]"
+            - WHITESPACE@37..38 "\n"
+            - R_CURLY@38..39 "}"
+    - WHITESPACE@39..40 "\n"
+- ERROR@38:39 "expected R_BRACK, got }" }
+recursion limit: 4096, high: 0
\ No newline at end of file