Skip to content

Commit f40022d

Browse files
committed
Auto merge of #3141 - rust-lang:rustup-2023-10-25, r=RalfJung
Automatic Rustup
2 parents 4d1aae7 + 9fbff11 commit f40022d

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f1a5ce19f5aa0cf61ed7b9f75b30e610befeed72
1+
2e4e2a8f288f642cafcc41fff211955ceddc453d

src/shims/time.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
5151
"macos" => {
5252
absolute_clocks = vec![this.eval_libc_i32("CLOCK_REALTIME")];
5353
relative_clocks = vec![this.eval_libc_i32("CLOCK_MONOTONIC")];
54-
// Some clocks only seem to exist in the aarch64 version of the target.
55-
if this.tcx.sess.target.arch == "aarch64" {
56-
// `CLOCK_UPTIME_RAW` supposed to not increment while the system is asleep... but
57-
// that's not really something a program running inside Miri can tell, anyway.
58-
// We need to support it because std uses it.
59-
relative_clocks.push(this.eval_libc_i32("CLOCK_UPTIME_RAW"));
60-
}
54+
// `CLOCK_UPTIME_RAW` supposed to not increment while the system is asleep... but
55+
// that's not really something a program running inside Miri can tell, anyway.
56+
// We need to support it because std uses it.
57+
relative_clocks.push(this.eval_libc_i32("CLOCK_UPTIME_RAW"));
6158
}
6259
target => throw_unsup_format!("`clock_gettime` is not supported on target OS {target}"),
6360
}
@@ -68,7 +65,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
6865
} else if relative_clocks.contains(&clk_id) {
6966
this.machine.clock.now().duration_since(this.machine.clock.anchor())
7067
} else {
71-
// Unsupported clock.
7268
let einval = this.eval_libc("EINVAL");
7369
this.set_last_error(einval)?;
7470
return Ok(Scalar::from_i32(-1));

src/shims/windows/foreign_items.rs

+12
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,18 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
272272

273273
this.Sleep(timeout)?;
274274
}
275+
"CreateWaitableTimerExW" => {
276+
let [attributes, name, flags, access] =
277+
this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
278+
this.read_pointer(attributes)?;
279+
this.read_pointer(name)?;
280+
this.read_scalar(flags)?.to_u32()?;
281+
this.read_scalar(access)?.to_u32()?;
282+
// Unimplemented. Always return failure.
283+
let not_supported = this.eval_windows("c", "ERROR_NOT_SUPPORTED");
284+
this.set_last_error(not_supported)?;
285+
this.write_null(dest)?;
286+
}
275287

276288
// Synchronization primitives
277289
"AcquireSRWLockExclusive" => {

tests/pass-dep/shims/libc-misc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ fn test_clocks() {
186186
unsafe { libc::clock_gettime(libc::CLOCK_MONOTONIC_COARSE, tp.as_mut_ptr()) };
187187
assert_eq!(is_error, 0);
188188
}
189-
#[cfg(all(target_os = "macos", target_arch = "aarch64"))]
189+
#[cfg(target_os = "macos")]
190190
{
191191
let is_error = unsafe { libc::clock_gettime(libc::CLOCK_UPTIME_RAW, tp.as_mut_ptr()) };
192192
assert_eq!(is_error, 0);

0 commit comments

Comments
 (0)