File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -752,6 +752,18 @@ pub trait BuildHasher {
752
752
#[ stable( since = "1.7.0" , feature = "build_hasher" ) ]
753
753
pub struct BuildHasherDefault < H > ( marker:: PhantomData < fn ( ) -> H > ) ;
754
754
755
+ impl < H > BuildHasherDefault < H > {
756
+ /// Creates a new BuildHasherDefault for Hasher `H`.
757
+ #[ unstable(
758
+ feature = "build_hasher_default_const_new" ,
759
+ issue = "123197" ,
760
+ reason = "recently added"
761
+ ) ]
762
+ pub const fn new ( ) -> Self {
763
+ BuildHasherDefault ( marker:: PhantomData )
764
+ }
765
+ }
766
+
755
767
#[ stable( since = "1.9.0" , feature = "core_impl_debug" ) ]
756
768
impl < H > fmt:: Debug for BuildHasherDefault < H > {
757
769
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -778,7 +790,7 @@ impl<H> Clone for BuildHasherDefault<H> {
778
790
#[ stable( since = "1.7.0" , feature = "build_hasher" ) ]
779
791
impl < H > Default for BuildHasherDefault < H > {
780
792
fn default ( ) -> BuildHasherDefault < H > {
781
- BuildHasherDefault ( marker :: PhantomData )
793
+ Self :: new ( )
782
794
}
783
795
}
784
796
You can’t perform that action at this time.
0 commit comments