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

Allow compile-time version selection for shutdown/remove_hooks #93

Open
ebkalderon opened this issue May 6, 2020 · 1 comment
Open

Comments

@ebkalderon
Copy link
Owner

Support for in-application API version 1.4.1 was introduced in #91, which included the renaming of shutdown to remove_hooks. This rename cannot be handled the same way as previous renames, where the old method can be retroactively marked deprecated if the requested API version is 1.4.1 or higher, because both of these methods take an owned self.

This means that the existing Deref and DerefMut implementations for RenderDoc<V> aren't sufficient for either method to work properly, and it would require a DerefMove trait to be added to the standard library (see rust-lang/rfcs#997 for details).

For now, as per #92, the remove_hooks() method is not available to call, even if RenderDoc<V141> is selected at compile-time. In the future, once DerefMove is added to Rust or an alternative solution can be found, we will be able to restore the full set of changes from #91 and expose both remove_hooks and shutdown correctly.

@ebkalderon
Copy link
Owner Author

ebkalderon commented Jan 27, 2023

After reviewing this code years later after having written it, this entire library looks incredibly sketchy (abuse of the Deref and DerefMut traits for odd purposes, sound but still unnecessary uses of std::mem::transmute(), and a few other things) and isn't exactly something I'm proud of. I think this entire API warrants a rewrite with a few long-standing bugs fixed.

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

1 participant