Skip to content

Commit 00a683e

Browse files
authored
Unrolled build for #148830
Rollup merge of #148830 - RalfJung:miri, r=RalfJung miri subtree update Lands the new avx512 support for zlib-rs, and the epoll fixes for Tokio. Subtree update of `miri` to rust-lang/miri@667796b. Created using https://github.com/rust-lang/josh-sync. r? ````@ghost````
2 parents 11339a0 + 13b8cf5 commit 00a683e

File tree

17 files changed

+868
-303
lines changed

17 files changed

+868
-303
lines changed

src/tools/miri/rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ceb7df7e6f17c92c7d49f7e4f02df0e68bc9b38b
1+
8401398e1f14a24670ee1a3203713dc2f0f8b3a8

src/tools/miri/src/machine.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,8 +1353,11 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
13531353
}
13541354

13551355
#[inline(always)]
1356-
fn runtime_checks(ecx: &InterpCx<'tcx, Self>, r: mir::RuntimeChecks) -> InterpResult<'tcx, bool> {
1357-
interp_ok(r.value(&ecx.tcx.sess))
1356+
fn runtime_checks(
1357+
ecx: &InterpCx<'tcx, Self>,
1358+
r: mir::RuntimeChecks,
1359+
) -> InterpResult<'tcx, bool> {
1360+
interp_ok(r.value(ecx.tcx.sess))
13581361
}
13591362

13601363
#[inline(always)]

src/tools/miri/src/shims/files.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::*;
1414

1515
/// A unique id for file descriptions. While we could use the address, considering that
1616
/// is definitely unique, the address would expose interpreter internal state when used
17-
/// for sorting things. So instead we generate a unique id per file description is the name
17+
/// for sorting things. So instead we generate a unique id per file description which is the same
1818
/// for all `dup`licates and is never reused.
1919
#[derive(Debug, Copy, Clone, Default, Eq, PartialEq, Ord, PartialOrd)]
2020
pub struct FdId(usize);
@@ -107,10 +107,10 @@ impl<T: FileDescription + 'static> FileDescriptionExt for T {
107107
) -> InterpResult<'tcx, io::Result<()>> {
108108
match Rc::into_inner(self.0) {
109109
Some(fd) => {
110-
// Remove entry from the global epoll_event_interest table.
111-
ecx.machine.epoll_interests.remove(fd.id);
110+
// There might have been epolls interested in this FD. Remove that.
111+
ecx.machine.epoll_interests.remove_epolls(fd.id);
112112

113-
fd.inner.close(communicate_allowed, ecx)
113+
fd.inner.destroy(fd.id, communicate_allowed, ecx)
114114
}
115115
None => {
116116
// Not the last reference.
@@ -183,9 +183,12 @@ pub trait FileDescription: std::fmt::Debug + FileDescriptionExt {
183183
throw_unsup_format!("cannot seek on {}", self.name());
184184
}
185185

186-
/// Close the file descriptor.
187-
fn close<'tcx>(
186+
/// Destroys the file description. Only called when the last duplicate file descriptor is closed.
187+
///
188+
/// `self_addr` is the address that this file description used to be stored at.
189+
fn destroy<'tcx>(
188190
self,
191+
_self_id: FdId,
189192
_communicate_allowed: bool,
190193
_ecx: &mut MiriInterpCx<'tcx>,
191194
) -> InterpResult<'tcx, io::Result<()>>
@@ -362,8 +365,9 @@ impl FileDescription for FileHandle {
362365
interp_ok((&mut &self.file).seek(offset))
363366
}
364367

365-
fn close<'tcx>(
368+
fn destroy<'tcx>(
366369
self,
370+
_self_id: FdId,
367371
communicate_allowed: bool,
368372
_ecx: &mut MiriInterpCx<'tcx>,
369373
) -> InterpResult<'tcx, io::Result<()>> {

0 commit comments

Comments
 (0)