File tree 2 files changed +9
-1
lines changed 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ Unreleased
25
25
which returns a ` Result<&'static [ResourceType], StoreObjectConversionError> `
26
26
- Add missing ` StoreObject::Reactor ` to the ` seasonal-season-5 ` feature.
27
27
28
+ ### Other
29
+ - Change ` PhantomData ` in ` screeps::local::ObjectId ` to better model ` ObjectId ` 's relationship with the wrapped type.
30
+ - This allows ` ObjectId ` to be ` Send + Sync ` regardless of the wrapped type
31
+
28
32
0.20.1 (2024-01-09)
29
33
===================
30
34
Original file line number Diff line number Diff line change @@ -60,8 +60,12 @@ pub use raw::*;
60
60
#[ serde( transparent, bound = "" ) ]
61
61
pub struct ObjectId < T > {
62
62
raw : RawObjectId ,
63
+
64
+ // Needed to consider the `T` as "used" even though we mostly use it as a marker. Because of
65
+ // auto traits, `PhantomData<fn() -> T>` is used instead: this struct doesn't *hold* a `T`, it
66
+ // *produces* one.
63
67
#[ serde( skip) ]
64
- phantom : PhantomData < T > ,
68
+ phantom : PhantomData < fn ( ) -> T > ,
65
69
}
66
70
67
71
// traits implemented manually so they don't depend on `T` implementing them.
You can’t perform that action at this time.
0 commit comments