Skip to content

Commit 202098e

Browse files
committed
fix use of this.allocate_bytes
1 parent f590fa9 commit 202098e

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/tools/miri/src/shims/time.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ use std::time::{Duration, SystemTime};
55

66
use chrono::{DateTime, Datelike, Offset, Timelike, Utc};
77
use chrono_tz::Tz;
8-
use rustc_abi::Align;
9-
use rustc_ast::ast::Mutability;
108

119
use crate::*;
1210

@@ -202,12 +200,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
202200
tm_zone.push('\0');
203201

204202
// Deduplicate and allocate the string.
205-
let tm_zone_ptr = this.allocate_bytes(
206-
tm_zone.as_bytes(),
207-
Align::ONE,
208-
MiriMemoryKind::Machine.into(),
209-
Mutability::Not,
210-
)?;
203+
let tm_zone_ptr = this.allocate_bytes_dedup(tm_zone.as_bytes())?;
211204

212205
// Write the timezone pointer and offset into the result structure.
213206
this.write_pointer(tm_zone_ptr, &this.project_field_named(&result, "tm_zone")?)?;

0 commit comments

Comments
 (0)