X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Ftools%2Fmiri%2Fsrc%2Fshims%2Funix%2Ffs.rs;h=e048d53a17e0d498630b698711e830ec60b12ac5;hb=069f219d4052bb8716aa3994f8c2a0f2c90c2c03;hp=b152082b4deb80f21f22538cfcc4ff07bb74ef9e;hpb=612bb7890cbac06e9f6b65ac15aeeb174d4ccb23;p=rust.git diff --git a/src/tools/miri/src/shims/unix/fs.rs b/src/tools/miri/src/shims/unix/fs.rs index b152082b4de..e048d53a17e 100644 --- a/src/tools/miri/src/shims/unix/fs.rs +++ b/src/tools/miri/src/shims/unix/fs.rs @@ -11,7 +11,6 @@ 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; @@ -1006,12 +1005,7 @@ fn linux_statx( // 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) }; @@ -1917,8 +1911,8 @@ struct FileMetadata { } 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> { @@ -1928,8 +1922,8 @@ fn from_path<'tcx, 'mir>( 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> { let option = ecx.machine.file_handler.handles.get(&fd); @@ -1942,8 +1936,8 @@ fn from_fd<'tcx, 'mir>( 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, ) -> InterpResult<'tcx, Option> { let metadata = match metadata {