File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ static_assertions = "1"
3535serde = { version = " 1" , optional = true }
3636arbitrary = { version = " 1" , optional = true }
3737proptest = { version = " 1" , optional = true }
38- bincode = { version = " 2.0.0-rc.3 " , features =[" alloc" ], optional = true }
38+ bincode = { version = " 2.0.1 " , features =[" alloc" ], optional = true }
3939
4040[dev-dependencies ]
4141proptest = " 1"
Original file line number Diff line number Diff line change 55use version_check as rustc;
66
77fn main ( ) {
8+ println ! ( "cargo:rustc-check-cfg=cfg(needs_allocator_feature)" ) ;
9+ println ! ( "cargo:rustc-check-cfg=cfg(has_allocator)" ) ;
10+
811 let ac = autocfg:: new ( ) ;
912 let has_feature = Some ( true ) == rustc:: supports_feature ( "allocator_api" ) ;
10- let has_api = ac. probe_trait ( "alloc ::alloc::Allocator " ) ;
13+ let has_api = ac. probe_trait ( "core ::alloc::GlobalAlloc " ) ;
1114 if has_feature || has_api {
1215 autocfg:: emit ( "has_allocator" ) ;
1316 }
Original file line number Diff line number Diff line change @@ -20,9 +20,9 @@ impl<T: SmartStringMode> Encode for SmartString<T> {
2020 }
2121}
2222
23- impl < T : SmartStringMode > Decode for SmartString < T > {
24- fn decode < D : Decoder > ( decoder : & mut D ) -> Result < Self , DecodeError > {
25- let bytes = <Vec < u8 > as Decode >:: decode ( decoder) ?;
23+ impl < Context , T : SmartStringMode > Decode < Context > for SmartString < T > {
24+ fn decode < D : Decoder < Context = Context > > ( decoder : & mut D ) -> Result < Self , DecodeError > {
25+ let bytes: Vec < u8 > = <Vec < u8 > as Decode < Context > >:: decode ( decoder) ?;
2626 let string = String :: from_utf8 ( bytes) . map_err ( |e| DecodeError :: Utf8 {
2727 inner : e. utf8_error ( ) ,
2828 } ) ?;
You can’t perform that action at this time.
0 commit comments