Skip to content

Commit 4a9a0a9

Browse files
committed
avoid lowercasing platforms
1 parent e575fb1 commit 4a9a0a9

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/eval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
169169
pub fn eval_main<'tcx>(tcx: TyCtxt<'tcx>, main_id: DefId, config: MiriConfig) -> Option<i64> {
170170
// FIXME: We always ignore leaks on some platforms where we do not
171171
// correctly implement TLS destructors.
172-
let target_os = tcx.sess.target.target.target_os.to_lowercase();
172+
let target_os = tcx.sess.target.target.target_os.as_str();
173173
let ignore_leaks = config.ignore_leaks || target_os == "windows" || target_os == "macos";
174174

175175
let (mut ecx, ret_place) = match create_ecx(tcx, main_id, config) {

src/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
373373
/// if this is not the case.
374374
fn assert_platform(&self, platform: &str, name: &str) {
375375
assert_eq!(
376-
self.eval_context_ref().tcx.sess.target.target.target_os.to_lowercase(),
376+
self.eval_context_ref().tcx.sess.target.target.target_os,
377377
platform,
378378
"`{}` is only available on the `{}` platform",
379379
name,

src/shims/foreign_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
455455
this.write_scalar(Scalar::from_f64(res), dest)?;
456456
}
457457

458-
_ => match this.tcx.sess.target.target.target_os.to_lowercase().as_str() {
458+
_ => match this.tcx.sess.target.target.target_os.as_str() {
459459
"linux" | "macos" => return posix::EvalContextExt::emulate_foreign_item_by_name(this, link_name, args, dest, ret),
460460
"windows" => return windows::EvalContextExt::emulate_foreign_item_by_name(this, link_name, args, dest, ret),
461461
target => throw_unsup_format!("The {} target platform is not supported", target),

src/shims/foreign_items/posix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
322322
}
323323

324324
_ => {
325-
match this.tcx.sess.target.target.target_os.to_lowercase().as_str() {
325+
match this.tcx.sess.target.target.target_os.as_str() {
326326
"linux" => return linux::EvalContextExt::emulate_foreign_item_by_name(this, link_name, args, dest, ret),
327327
"macos" => return macos::EvalContextExt::emulate_foreign_item_by_name(this, link_name, args, dest, ret),
328328
_ => unreachable!(),

0 commit comments

Comments
 (0)