File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ use std::cmp::Ordering;
77use std:: ffi:: { CStr , c_char} ;
88use std:: mem:: MaybeUninit ;
99use std:: ops:: Range ;
10- use std:: ptr:: { null, null_mut} ;
10+ use std:: ptr:: { self , null, null_mut} ;
1111use std:: sync:: OnceLock ;
1212use std:: { fmt, mem} ;
1313
@@ -348,15 +348,15 @@ impl Text {
348348
349349 let ut = unsafe { & mut * ptr } ;
350350 ut. p_funcs = & FUNCS ;
351- ut. context = tb as * const TextBuffer as * mut _ ;
351+ ut. context = ptr :: from_ref ( tb ) . cast ( ) ;
352352 ut. a = -1 ;
353353
354354 Ok ( Self ( ut) )
355355 }
356356}
357357
358358fn text_buffer_from_utext < ' a > ( ut : & icu_ffi:: UText ) -> & ' a TextBuffer {
359- unsafe { & * ( ut. context as * const TextBuffer ) }
359+ unsafe { & * ( ut. context . cast ( ) ) }
360360}
361361
362362fn double_cache_from_utext < ' a > ( ut : & icu_ffi:: UText ) -> & ' a mut DoubleCache {
@@ -1263,10 +1263,10 @@ mod icu_ffi {
12631263 pub chunk_contents : * const u16 ,
12641264 pub p_funcs : & ' static UTextFuncs ,
12651265 pub p_extra : * mut c_void ,
1266- pub context : * mut c_void ,
1267- pub p : * mut c_void ,
1268- pub q : * mut c_void ,
1269- pub r : * mut c_void ,
1266+ pub context : * const c_void ,
1267+ pub p : * const c_void ,
1268+ pub q : * const c_void ,
1269+ pub r : * const c_void ,
12701270 pub priv_p : * mut c_void ,
12711271 pub a : i64 ,
12721272 pub b : i32 ,
You can’t perform that action at this time.
0 commit comments