You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My instinct is that add_mapping should just take an Arc. The broader issue is that the methods of DataSource only have shared access to self, and there's no way to safely upcast &self to Arc<self>. So as I see it, either:
The DataSource methods to have a stronger reference to self.
MapType needs to store &dyn DataSource (maybe fine! The DataSource API is immutable anyway).
There's some clever invariant that will make it ok to unsafely mutate &dyn DataSource into Arc<dyn DataSource>. This seems pretty unlikely to me.
The text was updated successfully, but these errors were encountered:
The methods of
AddressSpace
take&dyn DataSource
, e.g.:cs393_vm_api/src/address_space.rs
Lines 43 to 50 in 2d1299b
But the struct itself stores
Arc<dyn DataSource>
:cs393_vm_api/src/address_space.rs
Line 9 in 2d1299b
My instinct is that
add_mapping
should just take anArc
. The broader issue is that the methods ofDataSource
only have shared access toself
, and there's no way to safely upcast&self
toArc<self>
. So as I see it, either:DataSource
methods to have a stronger reference to self.MapType
needs to store&dyn DataSource
(maybe fine! TheDataSource
API is immutable anyway).&dyn DataSource
intoArc<dyn DataSource>
. This seems pretty unlikely to me.The text was updated successfully, but these errors were encountered: