Implement `Clone + Copy` for `ContextRef`
gavrilikhin-d opened this issue · comments
Is your feature request related to a problem? Please describe.
create_debug_location
accepts the following argument: context: impl AsContextRef<'ctx>
.
I store context: ContextRef<'ctx>
from module, when creating debug info builder, but it's not clonnable
Describe the solution you'd like
Copyable ContextRef
Describe possible drawbacks to your solution
Safety issues possibly?
Will have to think about any possible safety concerns some more... That said, I think it'd be ok to make it clone or maybe even copy.
The 'ctx lifetime effectively makes it a reference to the original Context
, so I think Copy would be safe