@@ -14,7 +14,7 @@ use rustc_target::abi::LayoutOf;
14
14
use crate :: * ;
15
15
16
16
/// Represent how path separator conversion should be done.
17
- pub enum Pathconversion {
17
+ pub enum PathConversion {
18
18
HostToTarget ,
19
19
TargetToHost ,
20
20
}
@@ -188,7 +188,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
188
188
let this = self . eval_context_ref ( ) ;
189
189
let os_str = this. read_os_str_from_c_str ( scalar) ?;
190
190
191
- Ok ( match this. convert_path_separator ( Cow :: Borrowed ( os_str) , Pathconversion :: TargetToHost ) {
191
+ Ok ( match this. convert_path_separator ( Cow :: Borrowed ( os_str) , PathConversion :: TargetToHost ) {
192
192
Cow :: Borrowed ( x) => Cow :: Borrowed ( Path :: new ( x) ) ,
193
193
Cow :: Owned ( y) => Cow :: Owned ( PathBuf :: from ( y) ) ,
194
194
} )
@@ -199,7 +199,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
199
199
let this = self . eval_context_ref ( ) ;
200
200
let os_str = this. read_os_str_from_wide_str ( scalar) ?;
201
201
202
- Ok ( this. convert_path_separator ( Cow :: Owned ( os_str) , Pathconversion :: TargetToHost ) . into_owned ( ) . into ( ) )
202
+ Ok ( this. convert_path_separator ( Cow :: Owned ( os_str) , PathConversion :: TargetToHost ) . into_owned ( ) . into ( ) )
203
203
}
204
204
205
205
/// Write a Path to the machine memory (as a null-terminated sequence of bytes),
@@ -211,7 +211,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
211
211
size : u64 ,
212
212
) -> InterpResult < ' tcx , ( bool , u64 ) > {
213
213
let this = self . eval_context_mut ( ) ;
214
- let os_str = this. convert_path_separator ( Cow :: Borrowed ( path. as_os_str ( ) ) , Pathconversion :: HostToTarget ) ;
214
+ let os_str = this. convert_path_separator ( Cow :: Borrowed ( path. as_os_str ( ) ) , PathConversion :: HostToTarget ) ;
215
215
this. write_os_str_to_c_str ( & os_str, scalar, size)
216
216
}
217
217
@@ -224,14 +224,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
224
224
size : u64 ,
225
225
) -> InterpResult < ' tcx , ( bool , u64 ) > {
226
226
let this = self . eval_context_mut ( ) ;
227
- let os_str = this. convert_path_separator ( Cow :: Borrowed ( path. as_os_str ( ) ) , Pathconversion :: HostToTarget ) ;
227
+ let os_str = this. convert_path_separator ( Cow :: Borrowed ( path. as_os_str ( ) ) , PathConversion :: HostToTarget ) ;
228
228
this. write_os_str_to_wide_str ( & os_str, scalar, size)
229
229
}
230
230
231
231
fn convert_path_separator < ' a > (
232
232
& self ,
233
233
os_str : Cow < ' a , OsStr > ,
234
- direction : Pathconversion ,
234
+ direction : PathConversion ,
235
235
) -> Cow < ' a , OsStr > {
236
236
let this = self . eval_context_ref ( ) ;
237
237
let target_os = & this. tcx . sess . target . target . target_os ;
@@ -242,8 +242,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
242
242
} else {
243
243
// Unix target, Windows host.
244
244
let ( from, to) = match direction {
245
- Pathconversion :: HostToTarget => ( '\\' , '/' ) ,
246
- Pathconversion :: TargetToHost => ( '/' , '\\' ) ,
245
+ PathConversion :: HostToTarget => ( '\\' , '/' ) ,
246
+ PathConversion :: TargetToHost => ( '/' , '\\' ) ,
247
247
} ;
248
248
let converted = os_str
249
249
. encode_wide ( )
@@ -255,8 +255,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
255
255
return if target_os == "windows" {
256
256
// Windows target, Unix host.
257
257
let ( from, to) = match direction {
258
- Pathconversion :: HostToTarget => ( '/' , '\\' ) ,
259
- Pathconversion :: TargetToHost => ( '\\' , '/' ) ,
258
+ PathConversion :: HostToTarget => ( '/' , '\\' ) ,
259
+ PathConversion :: TargetToHost => ( '\\' , '/' ) ,
260
260
} ;
261
261
let converted = os_str
262
262
. as_bytes ( )
0 commit comments