Skip to content

Commit 705e63d

Browse files
authored
Fix SyntaxTree being accidentally !Send and !Sync (#704)
Fixes #702
1 parent 11fe454 commit 705e63d

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

crates/apollo-parser/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1717
1818
## Documentation -->
1919

20+
# [x.x.x] (unreleased) - 2022-mm-dd
21+
22+
## Fixes
23+
24+
- **Fix `SyntaxTree` being accidentally `!Send` and `!Sync` - [SimonSapin], [pull/704] fixing [issue/702]**
25+
26+
[SimonSapin]: https://github.com/SimonSapin
27+
[pull/704]: https://github.com/apollographql/apollo-rs/pull/704
28+
[issue/702]: https://github.com/apollographql/apollo-rs/issues/702
29+
2030
# [0.7.1](https://crates.io/crates/apollo-parser/0.7.1) - 2023-10-10
2131

2232
## Features

crates/apollo-parser/src/parser/syntax_tree.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,16 @@ pub struct SyntaxTree<T: CstNode = cst::Document> {
5757
pub(crate) errors: Vec<crate::Error>,
5858
pub(crate) recursion_limit: LimitTracker,
5959
pub(crate) token_limit: LimitTracker,
60-
_phantom: PhantomData<T>,
60+
_phantom: PhantomData<fn() -> T>,
6161
}
6262

63+
const _: () = {
64+
fn assert_send<T: Send>() {}
65+
fn assert_sync<T: Sync>() {}
66+
let _ = assert_send::<SyntaxTree>;
67+
let _ = assert_sync::<SyntaxTree>;
68+
};
69+
6370
impl<T: CstNode> SyntaxTree<T> {
6471
/// Get a reference to the syntax tree's errors.
6572
pub fn errors(&self) -> Iter<'_, crate::Error> {

0 commit comments

Comments
 (0)