Hi there! I was working on my unmem crate and faced one problem: i needed index and index_mut methods of unmem::Ptr<T> to be unsafe (they may cause segfaults and other non-rusty stuff) but their signatures don't allow to declare them as unsafe, so i was thinking - can we add something like 'maybe unsafe' to methods/associated functions in traits?
Also is this possible to add unsafe keyword to declarative macros 2.0? Not using unsafe kw inside of them causes compilations error...
Say I have a generic T: Foo. It could (but also could not) have marked its bar method as unsafe, so calling it requires unsafe anyway.
It would pretty much be the same as if the trait had an unsafe method, but the implementer was allowed to implement a safe method (which could work if fns were subtypes of unsafe fns, but that's not currently the case). For example Rust Playground
Still, making this change for the Index trait would mean making its index method unsafe, and this would be a major breaking change for anyone using a generic T: Index<I>.