Skip to content

Commit 98a802b

Browse files
committed
Implement Send and Sync for PhantomVar
The type contains no data, so this is guaranteed to be safe.
1 parent 7118691 commit 98a802b

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)