Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miri subtree update #128699

Merged
merged 39 commits into from
Aug 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1507af4
Add `flock` shim
newpavlov Jul 26, 2024
051cc2d
Make field private. It is not used outside the module and it should n…
oli-obk Jul 29, 2024
724160a
Split out actual `FileDescriptor` creation
oli-obk Jul 29, 2024
4742a81
Rename `FileDescriptor` to `FileDescriptionRef`
oli-obk Jul 29, 2024
b48e1b1
Rename all `file_descriptor` variables to `file_description` to match…
oli-obk Jul 29, 2024
fc584d7
Preparing for merge from rustc
Jul 30, 2024
8f712b5
Merge from rustc
Jul 30, 2024
a8b8a07
Auto merge of #3773 - rust-lang:rustup-2024-07-30, r=oli-obk
bors Jul 30, 2024
37e7688
Auto merge of #3759 - newpavlov:flock, r=oli-obk
bors Jul 30, 2024
cf63c16
Auto merge of #3770 - oli-obk:duplicator, r=oli-obk
bors Jul 30, 2024
6fc1b69
Use Scalar consistently in foreign item emulation
oli-obk Jul 30, 2024
f1e8c54
Auto merge of #3776 - oli-obk:duplicator, r=oli-obk
bors Jul 30, 2024
6283c4d
FD: refactor API names a little
RalfJung Jul 30, 2024
6f48edf
FD table: rename dup to get_ref
RalfJung Jul 31, 2024
50d51fb
Auto merge of #3778 - RalfJung:fd, r=oli-obk
bors Jul 31, 2024
5af27e4
flock: a bit of cleanup
RalfJung Aug 1, 2024
769e900
Auto merge of #3781 - RalfJung:flock, r=RalfJung
bors Aug 1, 2024
9117546
when josh-proxy screws up the roundtrip, say what the involved commit…
RalfJung Aug 1, 2024
9de5630
Auto merge of #3782 - RalfJung:josh-roundtrip-error, r=RalfJung
bors Aug 1, 2024
7d7c4db
Preparing for merge from rustc
Aug 2, 2024
85ed3fe
Merge from rustc
Aug 2, 2024
fc260e1
fmt
Aug 2, 2024
989b8f7
Auto merge of #3783 - rust-lang:rustup-2024-08-02, r=RalfJung
bors Aug 2, 2024
c4b7417
Add `miri_start` support
primoly Jul 28, 2024
6bb1197
docs
RalfJung Aug 2, 2024
5852b24
Auto merge of #3769 - primoly:miri-start, r=RalfJung
bors Aug 2, 2024
6aab319
Preparing for merge from rustc
Aug 3, 2024
62e2800
Merge from rustc
Aug 3, 2024
47aea6f
Auto merge of #3785 - rust-lang:rustup-2024-08-03, r=RalfJung
bors Aug 3, 2024
d280837
Preparing for merge from rustc
RalfJung Aug 5, 2024
34aa09a
Merge from rustc
RalfJung Aug 5, 2024
61463fd
fmt
RalfJung Aug 5, 2024
5e944bb
Auto merge of #3786 - RalfJung:rustup, r=RalfJung
bors Aug 5, 2024
9213c6c
bump rustc-build-sysroot dependency
RalfJung Aug 5, 2024
b113bbe
use a Miri-specific folder for ui tests
RalfJung Aug 5, 2024
d1ad05a
Auto merge of #3790 - RalfJung:ui-test-folder, r=RalfJung
bors Aug 5, 2024
014fdb5
bump dependencies
RalfJung Aug 5, 2024
a554f4d
Auto merge of #3789 - RalfJung:deps, r=RalfJung
bors Aug 5, 2024
f6edc8a
update lockfile
RalfJung Aug 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename FileDescriptor to FileDescriptionRef
  • Loading branch information
oli-obk committed Jul 29, 2024
commit 4742a81ebd787022a579ae7d8a8dca23fa78147e
16 changes: 8 additions & 8 deletions src/tools/miri/src/shims/unix/fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ impl FileDescription for NullOutput {
}

#[derive(Clone, Debug)]
pub struct FileDescriptor(Rc<RefCell<Box<dyn FileDescription>>>);
pub struct FileDescriptionRef(Rc<RefCell<Box<dyn FileDescription>>>);

impl FileDescriptor {
impl FileDescriptionRef {
fn new(fd: impl FileDescription) -> Self {
FileDescriptor(Rc::new(RefCell::new(Box::new(fd))))
FileDescriptionRef(Rc::new(RefCell::new(Box::new(fd))))
}

pub fn borrow(&self) -> Ref<'_, dyn FileDescription> {
Expand All @@ -217,7 +217,7 @@ impl FileDescriptor {
/// The file descriptor table
#[derive(Debug)]
pub struct FdTable {
fds: BTreeMap<i32, FileDescriptor>,
fds: BTreeMap<i32, FileDescriptionRef>,
}

impl VisitProvenance for FdTable {
Expand Down Expand Up @@ -245,12 +245,12 @@ impl FdTable {

/// Insert a new file description to the FdTable.
pub fn insert_fd(&mut self, fd: impl FileDescription) -> i32 {
let file_handle = FileDescriptor::new(fd);
let file_handle = FileDescriptionRef::new(fd);
self.insert_fd_with_min_fd(file_handle, 0)
}

/// Insert a new FD that is at least `min_fd`.
fn insert_fd_with_min_fd(&mut self, file_handle: FileDescriptor, min_fd: i32) -> i32 {
fn insert_fd_with_min_fd(&mut self, file_handle: FileDescriptionRef, min_fd: i32) -> i32 {
// Find the lowest unused FD, starting from min_fd. If the first such unused FD is in
// between used FDs, the find_map combinator will return it. If the first such unused FD
// is after all other used FDs, the find_map combinator will return None, and we will use
Expand Down Expand Up @@ -286,12 +286,12 @@ impl FdTable {
Some(fd.borrow_mut())
}

pub fn dup(&self, fd: i32) -> Option<FileDescriptor> {
pub fn dup(&self, fd: i32) -> Option<FileDescriptionRef> {
let fd = self.fds.get(&fd)?;
Some(fd.clone())
}

pub fn remove(&mut self, fd: i32) -> Option<FileDescriptor> {
pub fn remove(&mut self, fd: i32) -> Option<FileDescriptionRef> {
self.fds.remove(&fd)
}

Expand Down