You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
structHole<'a,T:'a>{data:&'amut[T],/// `elt` is always `Some` from new until drop.elt:Option<T>,pos:usize,}impl<'a,T>Hole<'a,T>{// ...unsafefnget(&self,index:usize) -> &T{&self.data[index]}// ...}
Why is get here marked as unsafe? It doesn't seem to be performing anything particularly unsafe, any more so than regular safe code might do. Rust compiler also doesn't require it to be unsafe.