Fix theoretical UB while transmuting Arc (#588)

master
Niklas Fiekas 3 years ago committed by GitHub
parent f0359ae19a
commit 4f695895d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/column_family.rs

@ -71,7 +71,7 @@ impl UnboundColumnFamily {
pub(crate) fn bound_column_family<'a>(self: Arc<Self>) -> Arc<BoundColumnFamily<'a>> {
// SAFETY: the new BoundColumnFamily here just adding lifetime,
// so that column family handle won't outlive db.
unsafe { std::mem::transmute(self) }
unsafe { Arc::from_raw(Arc::into_raw(self).cast()) }
}
}

Loading…
Cancel
Save