File tree Expand file tree Collapse file tree 1 file changed +0
-19
lines changed Expand file tree Collapse file tree 1 file changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -99,25 +99,6 @@ fn destroy_unmanaged_context_data<S: Storage, Q: Querier>(ptr: *mut c_void) {
99
99
}
100
100
101
101
/// Get a mutable reference to the context's data. Ownership remains in the Context.
102
- // NOTE: This is actually not really implemented safely at the moment. I did this as a
103
- // nicer and less-terrible version of the previous solution to the following issue:
104
- //
105
- // +--->> Go pointer
106
- // |
107
- // Ctx ->> ContextData +-> iterators: Box<dyn Iterator + 'a> --+
108
- // | |
109
- // +-> storage: impl Storage <<------------+
110
- // |
111
- // +-> querier: impl Querier
112
- //
113
- // -> : Ownership
114
- // ->> : Mutable borrow
115
- //
116
- // As you can see, there's a cyclical reference here... changing this function to return the same lifetime as it
117
- // returns (and adjusting a few other functions to only have one lifetime instead of two) triggers an error
118
- // elsewhere where we try to add iterators to the context. That's not legal according to Rust's rules, and it
119
- // complains that we're trying to borrow ctx mutably twice. This needs a better solution because this function
120
- // probably triggers unsoundness.
121
102
fn get_context_data_mut < ' a , ' b , S : Storage , Q : Querier > (
122
103
ctx : & ' a mut Ctx ,
123
104
) -> & ' b mut ContextData < S , Q > {
You can’t perform that action at this time.
0 commit comments