Skip to content

Commit c18ac14

Browse files
authored
Merge pull request #1305 from ttencate/feature/phantomvar_sync_send
Implement Send and Sync for PhantomVar
2 parents 5290f47 + 98a802b commit c18ac14

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

godot-core/src/registry/property/phantom_var.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ impl<T: GodotType + Var> Hash for PhantomVar<T> {
135135
fn hash<H: Hasher>(&self, _state: &mut H) {}
136136
}
137137

138+
// SAFETY: This type contains no data.
139+
unsafe impl<T: GodotType + Var> Send for PhantomVar<T> {}
140+
141+
// SAFETY: This type contains no data.
142+
unsafe impl<T: GodotType + Var> Sync for PhantomVar<T> {}
143+
138144
/// This type exists only as a place to add `compile_fail` doctests for `PhantomVar`, which do not need to be in the public documentation.
139145
///
140146
/// Omitting the `#[var]` attribute is an error:

0 commit comments

Comments
 (0)