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

generated code should use full path to PtrEq #1

Open
comex opened this issue Apr 18, 2021 · 1 comment
Open

generated code should use full path to PtrEq #1

comex opened this issue Apr 18, 2021 · 1 comment

Comments

@comex
Copy link

comex commented Apr 18, 2021

Currently, you cannot use #[derive(ptr_eq::PtrEq)] without also useing the trait. This is because when the proc macro generates unsafe impl #impl_gn PtrEq, PtrEq is not qualified. It should use a full module path.

Also, thanks for the crate!

@wx-csy
Copy link
Owner

wx-csy commented Apr 19, 2021

Thank you for watching this crate!

I'm going to submit an RFC/PR for changing the related trait implementations of Rc, Arc, etc., in the standard library. The std lib Rc<T> should be changed to implement Hash where &T: Hash (instead of T: Hash). Then all we need is to write a derive macro that implements Hash<&T> for T.

The related discussions can be seen at https://internals.rust-lang.org/t/proposal-compare-rc-t-and-arc-t-by-t/14437.

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

No branches or pull requests

2 participants