util.rs
SHA-2564b5b2c0a6413faad487b5d7b4cd70965502a13649edf195d41ba4e851c546adb
Malecule∅
Evidence
1//! This module is full of hackery and dark magic.
2//! Either spend a day fixing it and quietly submit a PR or don't mention it to anybody.
3
4use std::cell::UnsafeCell;
5use std::{mem, ptr};
6
7#[inline(always)]
⋯5 lines
14:11… {
15 // # Safety
16 //
17 // If the closure panics, we must abort otherwise we could double drop `T`
18 let _promote_panic_to_ …
⋯4 lines
24/// # Safety
25///
26/// Requires that you ensure the reference does not become invalid.
27/// The object has to outlive the reference.
48:14… (https://github.com/xacrimon/dashmap/issues/10) for details
49///
50/// This type is meant to be an implementation detail, but must be exposed due to t …
57:7… clone(&self) -> Self {
58 let inner = self.get().clone();
59 Self {
60 value: UnsafeCell::new(inner),
⋯5 lines