Skip to content

Commit 185c7d9

Browse files
committed
Make sure that Send is implemented for HString & co
Fixes #59
1 parent b353353 commit 185c7d9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/hstring.rs

+11
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,8 @@ impl Drop for HString {
461461
}
462462
}
463463

464+
unsafe impl Send for HString {}
465+
464466
impl ::std::clone::Clone for HString {
465467
#[inline]
466468
fn clone(&self) -> Self {
@@ -560,6 +562,15 @@ mod tests {
560562
use super::*;
561563
use self::test::Bencher;
562564

565+
#[test]
566+
fn test_trait_impls() {
567+
// make sure that all the structs implement `Send`
568+
fn is_send<T: Send>() {}
569+
is_send::<HString>();
570+
is_send::<FastHString>();
571+
is_send::<HStringReference>();
572+
}
573+
563574
#[test]
564575
fn check_sizes() {
565576
use ::std::mem::size_of;

0 commit comments

Comments
 (0)