File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1- #![ allow( unsafe_op_in_unsafe_fn) ]
21use crate :: os:: windows:: prelude:: * ;
32
43use crate :: ffi:: OsStr ;
@@ -325,6 +324,7 @@ impl AnonPipe {
325324 /// [`ReadFileEx`]: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfileex
326325 /// [`WriteFileEx`]: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-writefileex
327326 /// [Asynchronous Procedure Call]: https://docs.microsoft.com/en-us/windows/win32/sync/asynchronous-procedure-calls
327+ #[ allow( unsafe_op_in_unsafe_fn) ]
328328 unsafe fn alertable_io_internal (
329329 & self ,
330330 io : AlertableIoFn ,
@@ -561,12 +561,14 @@ impl<'a> Drop for AsyncPipe<'a> {
561561 }
562562}
563563
564+ #[ allow( unsafe_op_in_unsafe_fn) ]
564565unsafe fn slice_to_end ( v : & mut Vec < u8 > ) -> & mut [ u8 ] {
565566 if v. capacity ( ) == 0 {
566567 v. reserve ( 16 ) ;
567568 }
568569 if v. capacity ( ) == v. len ( ) {
569570 v. reserve ( 1 ) ;
570571 }
572+ // FIXME: Isn't this just spare_capacity_mut but worse?
571573 slice:: from_raw_parts_mut ( v. as_mut_ptr ( ) . add ( v. len ( ) ) , v. capacity ( ) - v. len ( ) )
572574}
Original file line number Diff line number Diff line change 1- #![ allow( unsafe_op_in_unsafe_fn) ]
21use crate :: ffi:: CStr ;
32use crate :: io;
43use crate :: num:: NonZero ;
@@ -23,6 +22,8 @@ pub struct Thread {
2322
2423impl Thread {
2524 // unsafe: see thread::Builder::spawn_unchecked for safety requirements
25+ #[ allow( unsafe_op_in_unsafe_fn) ]
26+ // FIXME: check the internal safety
2627 pub unsafe fn new ( stack : usize , p : Box < dyn FnOnce ( ) > ) -> io:: Result < Thread > {
2728 let p = Box :: into_raw ( Box :: new ( p) ) ;
2829
@@ -70,7 +71,7 @@ impl Thread {
7071 ///
7172 /// `name` must end with a zero value
7273 pub unsafe fn set_name_wide ( name : & [ u16 ] ) {
73- c:: SetThreadDescription ( c:: GetCurrentThread ( ) , name. as_ptr ( ) ) ;
74+ unsafe { c:: SetThreadDescription ( c:: GetCurrentThread ( ) , name. as_ptr ( ) ) } ;
7475 }
7576
7677 pub fn join ( self ) {
You can’t perform that action at this time.
0 commit comments