@@ -549,12 +549,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
549
549
target_op : OpTy < ' tcx , Tag > ,
550
550
linkpath_op : OpTy < ' tcx , Tag >
551
551
) -> InterpResult < ' tcx , i32 > {
552
- #[ cfg( target_family = " unix" ) ]
552
+ #[ cfg( unix) ]
553
553
fn create_link ( src : & Path , dst : & Path ) -> std:: io:: Result < ( ) > {
554
554
std:: os:: unix:: fs:: symlink ( src, dst)
555
555
}
556
556
557
- #[ cfg( target_family = " windows" ) ]
557
+ #[ cfg( windows) ]
558
558
fn create_link ( src : & Path , dst : & Path ) -> std:: io:: Result < ( ) > {
559
559
use std:: os:: windows:: fs;
560
560
if src. is_dir ( ) {
@@ -816,22 +816,24 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
816
816
817
817
this. check_no_isolation ( "mkdir" ) ?;
818
818
819
- let _mode = if this. tcx . sess . target . target . target_os == "macos" {
819
+ #[ cfg_attr( not( unix) , allow( unused_variables) ) ]
820
+ let mode = if this. tcx . sess . target . target . target_os == "macos" {
820
821
u32:: from ( this. read_scalar ( mode_op) ?. not_undef ( ) ?. to_u16 ( ) ?)
821
822
} else {
822
823
this. read_scalar ( mode_op) ?. to_u32 ( ) ?
823
824
} ;
824
825
825
826
let path = this. read_path_from_c_str ( this. read_scalar ( path_op) ?. not_undef ( ) ?) ?;
826
827
828
+ #[ cfg_attr( not( unix) , allow( unused_mut) ) ]
827
829
let mut builder = DirBuilder :: new ( ) ;
828
830
829
831
// If the host supports it, forward on the mode of the directory
830
832
// (i.e. permission bits and the sticky bit)
831
- #[ cfg( target_family = " unix" ) ]
833
+ #[ cfg( unix) ]
832
834
{
833
835
use std:: os:: unix:: fs:: DirBuilderExt ;
834
- builder. mode ( _mode . into ( ) ) ;
836
+ builder. mode ( mode . into ( ) ) ;
835
837
}
836
838
837
839
let result = builder. create ( path) . map ( |_| 0i32 ) ;
0 commit comments