We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f82229 commit 5c7f08dCopy full SHA for 5c7f08d
src/arc_str.rs
@@ -1678,4 +1678,20 @@ mod loomtest {
1678
t2.join().unwrap();
1679
});
1680
}
1681
+
1682
+ #[test]
1683
+ fn leak_drop() {
1684
+ loom::model(|| {
1685
+ let a1 = ArcStr::from("foo");
1686
+ let a2 = a1.clone();
1687
1688
+ let t1 = thread::spawn(move || {
1689
+ drop(a1);
1690
+ });
1691
+ let t2 = thread::spawn(move || a2.leak());
1692
+ t1.join().unwrap();
1693
+ let leaked: &'static str = t2.join().unwrap();
1694
+ assert_eq!(leaked, "foo");
1695
1696
+ }
1697
0 commit comments