File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ extern crate hashbrown;
73
73
74
74
This crate has the following Cargo features:
75
75
76
- - ` nightly ` : Enables nightly-only features: ` no_std ` support and ~ 10% speedup from branch hint intrinsics.
76
+ - ` nightly ` : Enables nightly-only features: ` no_std ` support, ` #[may_dangle] ` and ~ 10% speedup from branch hint intrinsics.
77
77
78
78
## License
79
79
Original file line number Diff line number Diff line change @@ -799,6 +799,23 @@ impl<T: Clone> Clone for RawTable<T> {
799
799
}
800
800
}
801
801
802
+ #[ cfg( feature = "nightly" ) ]
803
+ unsafe impl < #[ may_dangle] T > Drop for RawTable < T > {
804
+ #[ inline]
805
+ fn drop ( & mut self ) {
806
+ if self . bucket_mask != 0 {
807
+ unsafe {
808
+ if mem:: needs_drop :: < T > ( ) {
809
+ for item in self . iter ( ) {
810
+ item. drop ( ) ;
811
+ }
812
+ }
813
+ self . free_buckets ( ) ;
814
+ }
815
+ }
816
+ }
817
+ }
818
+ #[ cfg( not( feature = "nightly" ) ) ]
802
819
impl < T > Drop for RawTable < T > {
803
820
#[ inline]
804
821
fn drop ( & mut self ) {
You can’t perform that action at this time.
0 commit comments