Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
dc3786e
stabilize map_next_if
jdonszelmann Nov 14, 2025
1cd8752
Unix implementation for stdio set/take/replace
the8472 Jan 4, 2026
139d59f
Reword the collect() docs to stress that the return type determines t…
chojs23 Jan 7, 2026
ebd0151
Fix the connect_error test on FreeBSD 15+
asomers Jan 7, 2026
f82dd82
Use `rand` crate more idiomatically
yotamofek Jan 7, 2026
20a94d6
Bump `diesel` to the most recent commit in `cargotest`
jieyouxu Jan 8, 2026
484ea76
adding minicore to test file to avoid duplicating lang error
paradoxicalguy Dec 31, 2025
7e433eb
[miri] make closing stdio file descriptions noops
the8472 Jan 9, 2026
87d7167
Reenable GCC CI download
Kobzol Jan 9, 2026
58a9fdd
Bump `download-ci-gcc-stamp`
Kobzol Jan 9, 2026
6426635
Fix unpacking of gcc-dev component
Kobzol Jan 9, 2026
f6f901f
std: sys: fs: uefi: Implement File::{flush, *sync}
Ayush1325 Jan 9, 2026
07fa70e
llvm: Update `reliable_f16` configuration for LLVM22
tgross35 Jan 10, 2026
fc06a57
Introduce hir::ConstArgKind::Array
reddevilmidzy Jan 7, 2026
618b0b5
Lower hir::ConstArgKind::Array to a ValTree
reddevilmidzy Jan 8, 2026
522be7f
Fix clippy
reddevilmidzy Jan 8, 2026
f2f45ff
Add mGCA array expression tests
reddevilmidzy Jan 9, 2026
99a8e38
improve eii macro by using ecx methods
jdonszelmann Jan 8, 2026
00ad671
Subscribe myself to attr parsing
JonathanBrouwer Jan 10, 2026
da0dda1
Remove special case for `AllowedTargets::CrateLevel`
JonathanBrouwer Jan 10, 2026
6878e73
std: sys: fs: uefi: Implement File::seek
Ayush1325 Jan 10, 2026
917d900
Rollup merge of #148941 - stabilize-map-if, r=jhpratt
Zalathar Jan 11, 2026
2b313a5
Rollup merge of #150368 - minicore-ordering, r=workingjubilee
Zalathar Jan 11, 2026
a373085
Rollup merge of #150668 - stdio-swap, r=Mark-Simulacrum,RalfJung
Zalathar Jan 11, 2026
728cb7c
Rollup merge of #150743 - docs/iterator, r=Mark-Simulacrum
Zalathar Jan 11, 2026
6c98b01
Rollup merge of #150776 - connect_error-fbsd15, r=Mark-Simulacrum
Zalathar Jan 11, 2026
d987101
Rollup merge of #150781 - pr/cleanup-rand-usages, r=Mark-Simulacrum
Zalathar Jan 11, 2026
3bf42fc
Rollup merge of #150786 - mgca-array, r=BoxyUwU
Zalathar Jan 11, 2026
3d61923
Rollup merge of #150812 - bump-cargotest-diesel, r=Mark-Simulacrum
Zalathar Jan 11, 2026
8c72f6f
Rollup merge of #150862 - uefi-fs-flush, r=the8472
Zalathar Jan 11, 2026
4f73483
Rollup merge of #150873 - reenable-gcc-download-ci, r=marcoieni
Zalathar Jan 11, 2026
801c310
Rollup merge of #150906 - eii-ecx-mehods, r=Kivooeo
Zalathar Jan 11, 2026
aef1512
Rollup merge of #150908 - llvm-f16-cfg, r=nikic
Zalathar Jan 11, 2026
23cfb4b
Rollup merge of #150918 - uefi-fs-seek, r=jhpratt
Zalathar Jan 11, 2026
a54c4e2
Rollup merge of #150922 - subscribe-attr-parsing, r=Urgau
Zalathar Jan 11, 2026
b6f2eb4
Rollup merge of #150930 - crate_level, r=jdonszelmann
Zalathar Jan 11, 2026
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
[miri] make closing stdio file descriptions noops
std supports redirecting stdio file descriptors.
  • Loading branch information
the8472 committed Jan 9, 2026
commit 7e433ebe7e7b6d3749ec1aed039ab4408d4ad051
36 changes: 36 additions & 0 deletions src/tools/miri/src/shims/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,15 @@ impl FileDescription for io::Stdin {
finish.call(ecx, result)
}

fn destroy<'tcx>(
self,
_self_id: FdId,
_communicate_allowed: bool,
_ecx: &mut MiriInterpCx<'tcx>,
) -> InterpResult<'tcx, io::Result<()>> {
interp_ok(Ok(()))
}

fn is_tty(&self, communicate_allowed: bool) -> bool {
communicate_allowed && self.is_terminal()
}
Expand Down Expand Up @@ -279,6 +288,15 @@ impl FileDescription for io::Stdout {
finish.call(ecx, result)
}

fn destroy<'tcx>(
self,
_self_id: FdId,
_communicate_allowed: bool,
_ecx: &mut MiriInterpCx<'tcx>,
) -> InterpResult<'tcx, io::Result<()>> {
interp_ok(Ok(()))
}

fn is_tty(&self, communicate_allowed: bool) -> bool {
communicate_allowed && self.is_terminal()
}
Expand All @@ -289,6 +307,15 @@ impl FileDescription for io::Stderr {
"stderr"
}

fn destroy<'tcx>(
self,
_self_id: FdId,
_communicate_allowed: bool,
_ecx: &mut MiriInterpCx<'tcx>,
) -> InterpResult<'tcx, io::Result<()>> {
interp_ok(Ok(()))
}

fn write<'tcx>(
self: FileDescriptionRef<Self>,
_communicate_allowed: bool,
Expand Down Expand Up @@ -436,6 +463,15 @@ impl FileDescription for NullOutput {
// We just don't write anything, but report to the user that we did.
finish.call(ecx, Ok(len))
}

fn destroy<'tcx>(
self,
_self_id: FdId,
_communicate_allowed: bool,
_ecx: &mut MiriInterpCx<'tcx>,
) -> InterpResult<'tcx, io::Result<()>> {
interp_ok(Ok(()))
}
}

/// Internal type of a file-descriptor - this is what [`FdTable`] expects
Expand Down
10 changes: 0 additions & 10 deletions src/tools/miri/tests/fail-dep/libc/fs/close_stdout.rs

This file was deleted.

12 changes: 0 additions & 12 deletions src/tools/miri/tests/fail-dep/libc/fs/close_stdout.stderr

This file was deleted.

9 changes: 9 additions & 0 deletions src/tools/miri/tests/pass-dep/libc/libc-fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ fn main() {
test_nofollow_not_symlink();
#[cfg(target_os = "macos")]
test_ioctl();
test_close_stdout();
}

fn test_file_open_unix_allow_two_args() {
Expand Down Expand Up @@ -579,3 +580,11 @@ fn test_ioctl() {
assert_eq!(libc::ioctl(fd, libc::FIOCLEX), 0);
}
}

fn test_close_stdout() {
// This is std library UB, but that's not relevant since we're
// only interacting with libc here.
unsafe {
libc::close(1);
}
}
Loading