use log::trace;
use rustc_data_structures::fx::FxHashMap;
-use rustc_middle::ty::{self, layout::LayoutOf};
use rustc_target::abi::{Align, Size};
use crate::shims::os_str::bytes_to_os_str;
}
impl VisitTags for FileHandler {
- fn visit_tags(&self, _visit: &mut dyn FnMut(SbTag)) {
+ fn visit_tags(&self, _visit: &mut dyn FnMut(BorTag)) {
// All our FileDescriptor do not have any tags.
}
}
}
impl VisitTags for DirHandler {
- fn visit_tags(&self, visit: &mut dyn FnMut(SbTag)) {
+ fn visit_tags(&self, visit: &mut dyn FnMut(BorTag)) {
let DirHandler { streams, next_id: _ } = self;
for dir in streams.values() {
// as `isize`s instead of having the proper types. Thus, we have to recover the layout of
// `statxbuf_op` by using the `libc::statx` struct type.
let statxbuf = {
- // FIXME: This long path is required because `libc::statx` is an struct and also a
- // function and `resolve_path` is returning the latter.
- let statx_ty = this
- .resolve_path(&["libc", "unix", "linux_like", "linux", "gnu", "statx"])
- .ty(*this.tcx, ty::ParamEnv::reveal_all());
- let statx_layout = this.layout_of(statx_ty)?;
+ let statx_layout = this.libc_ty_layout("statx")?;
MPlaceTy::from_aligned_ptr(statxbuf_ptr, statx_layout)
};
}
impl FileMetadata {
- fn from_path<'tcx, 'mir>(
- ecx: &mut MiriInterpCx<'mir, 'tcx>,
+ fn from_path<'tcx>(
+ ecx: &mut MiriInterpCx<'_, 'tcx>,
path: &Path,
follow_symlink: bool,
) -> InterpResult<'tcx, Option<FileMetadata>> {
FileMetadata::from_meta(ecx, metadata)
}
- fn from_fd<'tcx, 'mir>(
- ecx: &mut MiriInterpCx<'mir, 'tcx>,
+ fn from_fd<'tcx>(
+ ecx: &mut MiriInterpCx<'_, 'tcx>,
fd: i32,
) -> InterpResult<'tcx, Option<FileMetadata>> {
let option = ecx.machine.file_handler.handles.get(&fd);
FileMetadata::from_meta(ecx, metadata)
}
- fn from_meta<'tcx, 'mir>(
- ecx: &mut MiriInterpCx<'mir, 'tcx>,
+ fn from_meta<'tcx>(
+ ecx: &mut MiriInterpCx<'_, 'tcx>,
metadata: Result<std::fs::Metadata, std::io::Error>,
) -> InterpResult<'tcx, Option<FileMetadata>> {
let metadata = match metadata {