From 08bf4dc274b4367f422093d460058a37e09a3c53 Mon Sep 17 00:00:00 2001 From: CAD97 Date: Tue, 16 Jun 2020 21:41:27 -0400 Subject: [PATCH] Run CI on nightly --- .github/workflows/ci.yaml | 6 +++--- src/green/builder.rs | 18 +++++++++--------- src/utils.rs | 9 ++++++--- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7973e66..9d48dbb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,7 +22,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: stable + toolchain: nightly override: true components: clippy - name: Check @@ -41,7 +41,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: stable + toolchain: nightly override: true components: rustfmt - name: Check @@ -60,7 +60,7 @@ jobs: id: toolchain uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: nightly profile: minimal override: true - name: Cache diff --git a/src/green/builder.rs b/src/green/builder.rs index fab129b..91c4431 100644 --- a/src/green/builder.rs +++ b/src/green/builder.rs @@ -108,9 +108,7 @@ impl Builder { kind.hash(state); for child in children.as_ref() { match child.into() { - NodeOrToken::Node(node) => { - ptr::hash(node as *const Node as *const (), state) - } + NodeOrToken::Node(node) => ptr::hash(node as *const Node as *const (), state), NodeOrToken::Token(token) => { ptr::hash(token as *const Token as *const (), state) } @@ -121,10 +119,12 @@ impl Builder { let entry = self.nodes.raw_entry_mut().from_hash(hash, |ThinEqNode(node)| { node.kind() == kind - && node.children().zip(children.as_ref().iter().map(Into::into)).all(|pair| match pair { - (NodeOrToken::Node(lhs), NodeOrToken::Node(rhs)) => ptr::eq(&*lhs, rhs), - (NodeOrToken::Token(lhs), NodeOrToken::Token(rhs)) => ptr::eq(&*lhs, rhs), - _ => false, + && node.children().zip(children.as_ref().iter().map(Into::into)).all(|pair| { + match pair { + (NodeOrToken::Node(lhs), NodeOrToken::Node(rhs)) => ptr::eq(&*lhs, rhs), + (NodeOrToken::Token(lhs), NodeOrToken::Token(rhs)) => ptr::eq(&*lhs, rhs), + _ => false, + } }) }); let (ThinEqNode(node), ()) = match entry { @@ -158,10 +158,10 @@ impl Builder { node.kind() == kind && node.children().zip(children.as_ref().iter()).all(|(lhs, rhs)| match lhs { NodeOrToken::Node(lhs) => { - ptr::eq((&*lhs) as *const _ as *const _, rhs.as_untagged_ptr().as_ptr()) + ptr::eq((&*lhs) as *const Node as *const _, rhs.as_untagged_ptr().as_ptr()) } NodeOrToken::Token(lhs) => { - ptr::eq((&*lhs) as *const _ as *const _, rhs.as_untagged_ptr().as_ptr()) + ptr::eq((&*lhs) as *const Token as *const _, rhs.as_untagged_ptr().as_ptr()) } }) }); diff --git a/src/utils.rs b/src/utils.rs index 47518cc..6e1f075 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -135,7 +135,9 @@ impl<'a> From<&'a GreenToken> for NodeOrToken<&'a GreenNode, &'a GreenToken> { } } -impl<'a> From<&'a NodeOrToken, Arc>> for NodeOrToken<&'a GreenNode, &'a GreenToken> { +impl<'a> From<&'a NodeOrToken, Arc>> + for NodeOrToken<&'a GreenNode, &'a GreenToken> +{ fn from(this: &'a NodeOrToken, Arc>) -> Self { this.as_deref() } @@ -153,7 +155,6 @@ impl<'a> From<&'a Arc> for NodeOrToken<&'a GreenNode, &'a GreenToken } } - impl<'a> From> for NodeOrToken<&'a GreenNode, &'a GreenToken> { fn from(this: ArcBorrow<'a, GreenNode>) -> Self { NodeOrToken::Node(ArcBorrow::downgrade(this)) @@ -166,7 +167,9 @@ impl<'a> From> for NodeOrToken<&'a GreenNode, &'a Gree } } -impl<'a> From, ArcBorrow<'a, GreenToken>>> for NodeOrToken<&'a GreenNode, &'a GreenToken> { +impl<'a> From, ArcBorrow<'a, GreenToken>>> + for NodeOrToken<&'a GreenNode, &'a GreenToken> +{ fn from(this: NodeOrToken, ArcBorrow<'a, GreenToken>>) -> Self { this.map(ArcBorrow::downgrade, ArcBorrow::downgrade) }