Skip to content

Commit

Permalink
Run CI on nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
CAD97 committed Jun 17, 2020
1 parent c667b8c commit 08bf4dc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: nightly
override: true
components: clippy
- name: Check
Expand All @@ -41,7 +41,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: nightly
override: true
components: rustfmt
- name: Check
Expand All @@ -60,7 +60,7 @@ jobs:
id: toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly
profile: minimal
override: true
- name: Cache
Expand Down
18 changes: 9 additions & 9 deletions src/green/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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 {
Expand Down Expand Up @@ -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())
}
})
});
Expand Down
9 changes: 6 additions & 3 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ impl<'a> From<&'a GreenToken> for NodeOrToken<&'a GreenNode, &'a GreenToken> {
}
}

impl<'a> From<&'a NodeOrToken<Arc<GreenNode>, Arc<GreenToken>>> for NodeOrToken<&'a GreenNode, &'a GreenToken> {
impl<'a> From<&'a NodeOrToken<Arc<GreenNode>, Arc<GreenToken>>>
for NodeOrToken<&'a GreenNode, &'a GreenToken>
{
fn from(this: &'a NodeOrToken<Arc<GreenNode>, Arc<GreenToken>>) -> Self {
this.as_deref()
}
Expand All @@ -153,7 +155,6 @@ impl<'a> From<&'a Arc<GreenToken>> for NodeOrToken<&'a GreenNode, &'a GreenToken
}
}


impl<'a> From<ArcBorrow<'a, GreenNode>> for NodeOrToken<&'a GreenNode, &'a GreenToken> {
fn from(this: ArcBorrow<'a, GreenNode>) -> Self {
NodeOrToken::Node(ArcBorrow::downgrade(this))
Expand All @@ -166,7 +167,9 @@ impl<'a> From<ArcBorrow<'a, GreenToken>> for NodeOrToken<&'a GreenNode, &'a Gree
}
}

impl<'a> From<NodeOrToken<ArcBorrow<'a, GreenNode>, ArcBorrow<'a, GreenToken>>> for NodeOrToken<&'a GreenNode, &'a GreenToken> {
impl<'a> From<NodeOrToken<ArcBorrow<'a, GreenNode>, ArcBorrow<'a, GreenToken>>>
for NodeOrToken<&'a GreenNode, &'a GreenToken>
{
fn from(this: NodeOrToken<ArcBorrow<'a, GreenNode>, ArcBorrow<'a, GreenToken>>) -> Self {
this.map(ArcBorrow::downgrade, ArcBorrow::downgrade)
}
Expand Down

0 comments on commit 08bf4dc

Please sign in to comment.