Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement Deref<T> and DerefMut<T> for JS<T> #2078
Closed
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The new
std::ops::DerefandDerefMuttraits allow "smart pointer" types to override the*(dereference) operator and gain the same auto-dereferencing behavior as built-in pointer types. Implementing these forJS<T>would reduce some boilerplate in Servo code.I have a working implementation here, but it's not very useful until rust-lang/rust#12825 is fixed (since that bug causes errors in many common scenarios):
https://github.com/mbrubeck/servo/tree/deref-js