Kimundi / owning-ref-rs

A library for creating references that carry their owner with them.
MIT License
359 stars 50 forks source link

Add erase_send_sync_owner to create Erased + Send + Sync references #39

Open Zoxc opened 6 years ago

Zoxc commented 6 years ago

I ended up needing this when adding thread safety to rustc. I'm not sure why the IntoErased trait is unsafe, so it would be a good idea to check that I didn't break any invariants here.

Storyyeller commented 6 years ago

Did you check whether Erased impls Any? That's the only potential unsafety I noticed.

Zoxc commented 6 years ago

@Storyyeller dyn (Erased + Sync + Send) cannot impl Any.