Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Clone + Copy for ContextRef #472

Closed
gavrilikhin-d opened this issue Feb 11, 2024 · 2 comments
Closed

Implement Clone + Copy for ContextRef #472

gavrilikhin-d opened this issue Feb 11, 2024 · 2 comments

Comments

@gavrilikhin-d
Copy link
Contributor

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?

@TheDan64
Copy link
Owner

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.

@TheDan64
Copy link
Owner

The 'ctx lifetime effectively makes it a reference to the original Context, so I think Copy would be safe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants