Analog of `get_raw` except that a raw pointer is returned rather than a mutable reference. The default accessors of items in [`PrimaryMap`] will invalidate all previous borrows obtained from the map according to miri. This function can be used to acquire a pointer and then subsequently acquire a second pointer later on without invalidating the first one. In other words this is only here to help b
(&mut self, k: K)
| 232 | /// pointer later on without invalidating the first one. In other words |
| 233 | /// this is only here to help borrow two elements simultaneously with miri. |
| 234 | pub fn get_raw_mut(&mut self, k: K) -> Option<*mut V> { |
| 235 | if k.index() < self.elems.len() { |
| 236 | // SAFETY: the `add` function requires that the index is in-bounds |
| 237 | // with respect to the allocation which is satisfied here due to |
| 238 | // the bounds-check above. |
| 239 | unsafe { Some(self.elems.as_mut_ptr().add(k.index())) } |
| 240 | } else { |
| 241 | None |
| 242 | } |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | impl<K, V> Default for PrimaryMap<K, V> |
nothing calls this directly
no test coverage detected