Renames CollectionContext -> Collection and MutationContext -> Mutation.
Gets rid of the explicit extra 'a lifetime on Mutation in favor of an easier to deal with &Mutation<'gc>, and the same change to Collection, the Collection parameter becomes &Collection.
Mutation and Collection are now #[repr(transparent)] newtypes of the Context, and they are produced through transmute.
The methods on Arena require a callback that accepts &'gc MutationContext<'gc>. This does not give any extra powers per se and is not dangerous, but it does enable wrapper types around &'gc MutationContext<'gc> to have one less lifetime in play.
As a related fix, also changes Arena::mutate like methods to again forbid returning internal root object references, as it can be used to place Gc pointers from Box::leak'ed arenas into other arenas. This is currently sound by sheer luck, but it is incredibly sketchy and should be disallowed.
Renames CollectionContext -> Collection and MutationContext -> Mutation.
Gets rid of the explicit extra 'a lifetime on Mutation in favor of an easier to deal with
&Mutation<'gc>
, and the same change to Collection, the Collection parameter becomes&Collection
.Mutation and Collection are now
#[repr(transparent)]
newtypes of the Context, and they are produced through transmute.The methods on Arena require a callback that accepts
&'gc MutationContext<'gc>
. This does not give any extra powers per se and is not dangerous, but it does enable wrapper types around&'gc MutationContext<'gc>
to have one less lifetime in play.As a related fix, also changes
Arena::mutate
like methods to again forbid returning internal root object references, as it can be used to place Gc pointers fromBox::leak
'ed arenas into other arenas. This is currently sound by sheer luck, but it is incredibly sketchy and should be disallowed.