From 05642448379618633ccab9bc4fb1d3bc5734e357 Mon Sep 17 00:00:00 2001 From: DQ Date: Mon, 26 Apr 2021 09:11:59 +0200 Subject: [PATCH 1/3] Update CI MIRI flags, schedule CI only once a week --- .github/workflows/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9d67e81..98bff53 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,7 +6,7 @@ on: pull_request: # Daily schedule: - - cron: "0 4 * * *" + - cron: "0 4 1/7 * *" # Allows to run this workflow manually from the Actions tab workflow_dispatch: @@ -101,7 +101,9 @@ jobs: with: rust-version: nightly components: miri - - run: cargo miri test --verbose --all-features -- -Zmiri-disable-isolation + env: + MIRIFLAGS: -Zmiri-disable-isolation + - run: cargo miri test --verbose --all-features sanitizers: name: ${{ matrix.sanitizer }} sanitizer From f807c1e4acf323717802aafed7d85b3b8a13ebc8 Mon Sep 17 00:00:00 2001 From: Domenic Quirl Date: Sat, 8 May 2021 11:34:38 +0200 Subject: [PATCH 2/3] fix `forbid` incompat with serde; missing_debug https://github.com/rust-lang/rust/issues/81670 --- src/lib.rs | 8 ++------ src/syntax/node.rs | 5 +++-- src/syntax/token.rs | 1 + 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 6e71cda..e1b17a0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,12 +43,8 @@ //! an AST representation, or freely switch between them. To do so, use `cstree` to build syntax and underlying green //! tree and provide AST wrappers for your different kinds of nodes. An example of how this is done can be seen [here](https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/syntax/src/ast/generated.rs) and [here](https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/syntax/src/ast/generated/nodes.rs) (note that the latter file is automatically generated by a task). -#![forbid( - // missing_debug_implementations, - unconditional_recursion, - future_incompatible, -)] -#![deny(unsafe_code, missing_docs)] +#![forbid(missing_debug_implementations, unconditional_recursion)] +#![deny(unsafe_code, missing_docs, future_incompatible)] #[allow(unsafe_code)] mod green; diff --git a/src/syntax/node.rs b/src/syntax/node.rs index 5c48cd3..c1346ca 100644 --- a/src/syntax/node.rs +++ b/src/syntax/node.rs @@ -23,6 +23,7 @@ use triomphe::Arc; /// Syntax nodes can be shared between threads. /// Every syntax tree is reference counted as a whole and nodes are pointer-sized, so copying /// individual nodes is relatively cheap. +#[derive(Debug)] #[repr(transparent)] pub struct SyntaxNode { data: *mut NodeData, @@ -983,7 +984,7 @@ impl<'n> Iter<'n> { } /// An iterator over the child nodes of a [`SyntaxNode`]. -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct SyntaxNodeChildren<'n, L: Language, D: 'static = ()> { inner: Iter<'n>, parent: &'n SyntaxNode, @@ -1014,7 +1015,7 @@ impl<'n, L: Language, D> Iterator for SyntaxNodeChildren<'n, L, D> { } /// An iterator over the children of a [`SyntaxNode`]. -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct SyntaxElementChildren<'n, L: Language, D: 'static = ()> { inner: Iter<'n>, parent: &'n SyntaxNode, diff --git a/src/syntax/token.rs b/src/syntax/token.rs index b7008bd..c0f3075 100644 --- a/src/syntax/token.rs +++ b/src/syntax/token.rs @@ -11,6 +11,7 @@ use super::*; use crate::{Direction, GreenNode, GreenToken, Language, SyntaxKind}; /// Syntax tree token. +#[derive(Debug)] pub struct SyntaxToken { parent: SyntaxNode, index: u32, From 5fa76c100b91894c9f5fab6b13949c00487a302e Mon Sep 17 00:00:00 2001 From: Domenic Quirl Date: Sat, 8 May 2021 11:40:54 +0200 Subject: [PATCH 3/3] new minor release --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 6b82fef..f36747a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] edition = "2018" name = "cstree" -version = "0.4.0" +version = "0.5.0" authors = ["Domenic Quirl ", "Aleksey Kladov "] description = "Library for generic lossless syntax trees" license = "MIT OR Apache-2.0"