@@ -116,7 +116,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
116
116
let this = self . eval_context_mut ( ) ;
117
117
let target_os = & this. tcx . sess . target . os ;
118
118
assert ! (
119
- target_os == "linux" || target_os == "macos" ,
119
+ matches! ( target_os. as_str ( ) , "linux" | "macos" | "android" ) ,
120
120
"`getenv` is only available for the UNIX target family"
121
121
) ;
122
122
@@ -214,7 +214,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
214
214
let mut this = self . eval_context_mut ( ) ;
215
215
let target_os = & this. tcx . sess . target . os ;
216
216
assert ! (
217
- target_os == "linux" || target_os == "macos" ,
217
+ matches! ( target_os. as_str ( ) , "linux" | "macos" | "android" ) ,
218
218
"`setenv` is only available for the UNIX target family"
219
219
) ;
220
220
@@ -288,7 +288,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
288
288
let this = self . eval_context_mut ( ) ;
289
289
let target_os = & this. tcx . sess . target . os ;
290
290
assert ! (
291
- target_os == "linux" || target_os == "macos" ,
291
+ matches! ( target_os. as_str ( ) , "linux" | "macos" | "android" ) ,
292
292
"`unsetenv` is only available for the UNIX target family"
293
293
) ;
294
294
@@ -322,7 +322,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
322
322
let this = self . eval_context_mut ( ) ;
323
323
let target_os = & this. tcx . sess . target . os ;
324
324
assert ! (
325
- target_os == "linux" || target_os == "macos" ,
325
+ matches! ( target_os. as_str ( ) , "linux" | "macos" | "android" ) ,
326
326
"`getcwd` is only available for the UNIX target family"
327
327
) ;
328
328
@@ -381,7 +381,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
381
381
let this = self . eval_context_mut ( ) ;
382
382
let target_os = & this. tcx . sess . target . os ;
383
383
assert ! (
384
- target_os == "linux" || target_os == "macos" ,
384
+ matches! ( target_os. as_str ( ) , "linux" | "macos" | "android" ) ,
385
385
"`getcwd` is only available for the UNIX target family"
386
386
) ;
387
387
0 commit comments