Alan-Chen99

Results 43 comments of Alan-Chen99

Hmm, Perhaps one can use HRTBs to get rid of rebind? we tag ContextWrapper with a 'b which changes on gc. we only allow objects to be accessed given a...

Note: above markers fixed to be invariant HRTB is used to enforce safety. The idea is that a normal function would look like this: ```rust fn function_that_gcs( obj: &BrandedObject, cx:...

Sorry if this wasn't clear, with that I wasn't trying to accomplish anything particular; rather was an experiment to try to not have `rebind`. It ends up having the advantage...

also, maybe unrelated question: why cant Context own RootSet?

> If the `RootSet` was owned by `Context` then the lifetime `'rt` would need to be tied to the reference of `Context` (`&'rt Context`). However the whole point of rooting...

I think I have a way to (cleanly) allow non-rooted objects as arguments now. We can try to pass around contexts that contains objects: ```rust struct ContextWrapper { // or...

Actually, that was unsound since it cannot prevent the user from storing an &Context inside the T of ContextWrapper. Using Token doesn't have this problem. We have instead ```rust //unique...

> You get this error: > > ``` > error[E0502]: cannot borrow `*cx` as mutable because it is also borrowed as immutable > --> src/main.rs:24:5 > | > 23 |...

But this can't be right? what prevents an object returned by rebind! from being garbage collected? The following currently segfaults: ``` let cons = list!["foo", 1, false, "end"; cx]; let...

My understanding is that rebind is supposed to change a mutable borrow to an immutable one, which prevents a gc but allows allocation