Skip to content

CI fix: Fix CI failure: Adjust from_node_binding to accept a reference #1367

CI fix: Fix CI failure: Adjust from_node_binding to accept a reference

CI fix: Fix CI failure: Adjust from_node_binding to accept a reference #1367

Triggered via push August 3, 2024 06:16
Status Failure
Total duration
Artifacts

This workflow graph cannot be shown

A graph will be generated the next time this workflow is run.

Annotations

9 errors
Invalid workflow file: .github/workflows/pr-lint.yaml#L7
You have an error in your yaml syntax on line 7
type mismatch resolving `<Q as QueryContext>::Node<'_> == &<Q as QueryContext>::Node<'a>`: crates/grit-pattern-matcher/src/pattern/resolved_pattern.rs#L36
error[E0271]: type mismatch resolving `<Q as QueryContext>::Node<'_> == &<Q as QueryContext>::Node<'a>` --> crates/grit-pattern-matcher/src/pattern/resolved_pattern.rs:36:28 | 36 | Self::from_binding(Binding::from_node(node)) | ^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found `&<Q as QueryContext>::Node<'_>` | = note: expected associated type `<Q as context::QueryContext>::Node<'_>` found reference `&<Q as context::QueryContext>::Node<'a>`
mismatched types: crates/grit-pattern-matcher/src/pattern/list_index.rs#L80
error[E0308]: mismatched types --> crates/grit-pattern-matcher/src/pattern/list_index.rs:80:72 | 80 | ... ResolvedPattern::from_node_binding(n), | ---------------------------------- ^ expected `&_`, found associated type | | | arguments to this function are incorrect | = note: expected reference `&_` found associated type `<Q as context::QueryContext>::Node<'a>` = help: consider constraining the associated type `<Q as context::QueryContext>::Node<'a>` to `&_` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html note: associated function defined here --> crates/grit-pattern-matcher/src/pattern/resolved_pattern.rs:35:8 | 35 | fn from_node_binding(node: &Q::Node<'a>) -> Self { | ^^^^^^^^^^^^^^^^^ ------------------ help: consider using `as_ref` instead | 78 | .as_ref().map(|n| { | +++++++++
mismatched types: crates/grit-pattern-matcher/src/pattern/contains.rs#L112
error[E0308]: mismatched types --> crates/grit-pattern-matcher/src/pattern/contains.rs:112:61 | 112 | &ResolvedPattern::from_node_binding(item), | ---------------------------------- ^^^^ expected `&_`, found associated type | | | arguments to this function are incorrect | = note: expected reference `&_` found associated type `<Q as context::QueryContext>::Node<'a>` note: associated function defined here --> crates/grit-pattern-matcher/src/pattern/resolved_pattern.rs:35:8 | 35 | fn from_node_binding(node: &Q::Node<'a>) -> Self { | ^^^^^^^^^^^^^^^^^ ------------------ help: consider constraining the associated type `<Q as context::QueryContext>::Node<'a>` to `&_` | 88 | impl<Q: QueryContext<Node<'a> = &_>> Matcher<Q> for Contains<Q> { | +++++++++++++++ help: consider borrowing here | 112 | &ResolvedPattern::from_node_binding(&item), | +
mismatched types: crates/grit-pattern-matcher/src/pattern/contains.rs#L48
error[E0308]: mismatched types --> crates/grit-pattern-matcher/src/pattern/contains.rs:48:59 | 48 | let node_lhs = ResolvedPattern::from_node_binding(node); | ---------------------------------- ^^^^ expected `&_`, found associated type | | | arguments to this function are incorrect | = note: expected reference `&_` found associated type `<Q as context::QueryContext>::Node<'a>` note: associated function defined here --> crates/grit-pattern-matcher/src/pattern/resolved_pattern.rs:35:8 | 35 | fn from_node_binding(node: &Q::Node<'a>) -> Self { | ^^^^^^^^^^^^^^^^^ ------------------ help: consider constraining the associated type `<Q as context::QueryContext>::Node<'a>` to `&_` | 34 | fn execute_until<'a, Q: QueryContext<Node<'a> = &_>>( | +++++++++++++++ help: consider borrowing here | 48 | let node_lhs = ResolvedPattern::from_node_binding(&node); | +
mismatched types: crates/grit-pattern-matcher/src/pattern/before.rs#L75
error[E0308]: mismatched types --> crates/grit-pattern-matcher/src/pattern/before.rs:75:49 | 75 | &ResolvedPattern::from_node_binding(next_node), | ---------------------------------- ^^^^^^^^^ expected `&_`, found associated type | | | arguments to this function are incorrect | = note: expected reference `&_` found associated type `<Q as context::QueryContext>::Node<'_>` note: associated function defined here --> crates/grit-pattern-matcher/src/pattern/resolved_pattern.rs:35:8 | 35 | fn from_node_binding(node: &Q::Node<'a>) -> Self { | ^^^^^^^^^^^^^^^^^ ------------------ help: consider constraining the associated type `<Q as context::QueryContext>::Node<'_>` to `&_` | 55 | impl<Q: QueryContext<Node<'_> = &_>> Matcher<Q> for Before<Q> { | +++++++++++++++ help: consider borrowing here | 75 | &ResolvedPattern::from_node_binding(&next_node), | +
mismatched types: crates/grit-pattern-matcher/src/pattern/before.rs#L36
error[E0308]: mismatched types --> crates/grit-pattern-matcher/src/pattern/before.rs:36:51 | 36 | Ok(ResolvedPattern::from_node_binding(prev)) | ---------------------------------- ^^^^ expected `&_`, found associated type | | | arguments to this function are incorrect | = note: expected reference `&_` found associated type `<Q as context::QueryContext>::Node<'_>` note: associated function defined here --> crates/grit-pattern-matcher/src/pattern/resolved_pattern.rs:35:8 | 35 | fn from_node_binding(node: &Q::Node<'a>) -> Self { | ^^^^^^^^^^^^^^^^^ ------------------ help: consider constraining the associated type `<Q as context::QueryContext>::Node<'_>` to `&_` | 19 | impl<Q: QueryContext<Node<'_> = &_>> Before<Q> { | +++++++++++++++ help: consider borrowing here | 36 | Ok(ResolvedPattern::from_node_binding(&prev)) | +
mismatched types: crates/grit-pattern-matcher/src/pattern/after.rs#L76
error[E0308]: mismatched types --> crates/grit-pattern-matcher/src/pattern/after.rs:76:49 | 76 | &ResolvedPattern::from_node_binding(prev_node), | ---------------------------------- ^^^^^^^^^ expected `&_`, found associated type | | | arguments to this function are incorrect | = note: expected reference `&_` found associated type `<Q as context::QueryContext>::Node<'_>` note: associated function defined here --> crates/grit-pattern-matcher/src/pattern/resolved_pattern.rs:35:8 | 35 | fn from_node_binding(node: &Q::Node<'a>) -> Self { | ^^^^^^^^^^^^^^^^^ ------------------ help: consider constraining the associated type `<Q as context::QueryContext>::Node<'_>` to `&_` | 56 | impl<Q: QueryContext<Node<'_> = &_>> Matcher<Q> for After<Q> { | +++++++++++++++ help: consider borrowing here | 76 | &ResolvedPattern::from_node_binding(&prev_node), | +
mismatched types: crates/grit-pattern-matcher/src/pattern/after.rs#L37
error[E0308]: mismatched types --> crates/grit-pattern-matcher/src/pattern/after.rs:37:54 | 37 | Ok(Q::ResolvedPattern::from_node_binding(next)) | ------------------------------------- ^^^^ expected `&<Q as QueryContext>::Node<'_>`, found associated type | | | arguments to this function are incorrect | = note: expected reference `&<Q as context::QueryContext>::Node<'_>` found associated type `<Q as context::QueryContext>::Node<'_>` note: associated function defined here --> crates/grit-pattern-matcher/src/pattern/resolved_pattern.rs:35:8 | 35 | fn from_node_binding(node: &Q::Node<'a>) -> Self { | ^^^^^^^^^^^^^^^^^ ------------------ help: consider constraining the associated type `<Q as context::QueryContext>::Node<'_>` to `&<Q as context::QueryContext>::Node<'_>` | 20 | impl<Q: QueryContext<Node<'_> = &<Q as context::QueryContext>::Node<'_>>> After<Q> { | ++++++++++++++++++++++++++++++++++++++++++++++++++++ help: consider borrowing here | 37 | Ok(Q::ResolvedPattern::from_node_binding(&next)) | +