Skip to content

Commit 598c3da

Browse files
committed
clippy
1 parent 6d1e99e commit 598c3da

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

src/tools/miri/src/helpers.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,7 @@ const UNIX_IO_ERROR_TABLE: &[(&str, std::io::ErrorKind)] = {
7676
/// Gets an instance for a path.
7777
///
7878
/// A `None` namespace indicates we are looking for a module.
79-
fn try_resolve_did<'tcx>(
80-
tcx: TyCtxt<'tcx>,
81-
path: &[&str],
82-
namespace: Option<Namespace>,
83-
) -> Option<DefId> {
79+
fn try_resolve_did(tcx: TyCtxt<'_>, path: &[&str], namespace: Option<Namespace>) -> Option<DefId> {
8480
/// Yield all children of the given item, that have the given name.
8581
fn find_children<'tcx: 'a, 'a>(
8682
tcx: TyCtxt<'tcx>,

src/tools/miri/src/shims/os_str.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ pub enum PathConversion {
1818
}
1919

2020
#[cfg(unix)]
21-
pub fn os_str_to_bytes<'a, 'tcx>(os_str: &'a OsStr) -> InterpResult<'tcx, &'a [u8]> {
21+
pub fn os_str_to_bytes<'tcx>(os_str: &OsStr) -> InterpResult<'tcx, &[u8]> {
2222
Ok(os_str.as_bytes())
2323
}
2424

2525
#[cfg(not(unix))]
26-
pub fn os_str_to_bytes<'a, 'tcx>(os_str: &'a OsStr) -> InterpResult<'tcx, &'a [u8]> {
26+
pub fn os_str_to_bytes<'tcx>(os_str: &OsStr) -> InterpResult<'tcx, &[u8]> {
2727
// On non-unix platforms the best we can do to transform bytes from/to OS strings is to do the
2828
// intermediate transformation into strings. Which invalidates non-utf8 paths that are actually
2929
// valid.
@@ -34,11 +34,11 @@ pub fn os_str_to_bytes<'a, 'tcx>(os_str: &'a OsStr) -> InterpResult<'tcx, &'a [u
3434
}
3535

3636
#[cfg(unix)]
37-
pub fn bytes_to_os_str<'a, 'tcx>(bytes: &'a [u8]) -> InterpResult<'tcx, &'a OsStr> {
37+
pub fn bytes_to_os_str<'tcx>(bytes: &[u8]) -> InterpResult<'tcx, &OsStr> {
3838
Ok(OsStr::from_bytes(bytes))
3939
}
4040
#[cfg(not(unix))]
41-
pub fn bytes_to_os_str<'a, 'tcx>(bytes: &'a [u8]) -> InterpResult<'tcx, &'a OsStr> {
41+
pub fn bytes_to_os_str<'tcx>(bytes: &[u8]) -> InterpResult<'tcx, &OsStr> {
4242
let s = std::str::from_utf8(bytes)
4343
.map_err(|_| err_unsup_format!("{:?} is not a valid utf-8 string", bytes))?;
4444
Ok(OsStr::new(s))

src/tools/miri/src/shims/unix/fs.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1911,8 +1911,8 @@ struct FileMetadata {
19111911
}
19121912

19131913
impl FileMetadata {
1914-
fn from_path<'tcx, 'mir>(
1915-
ecx: &mut MiriInterpCx<'mir, 'tcx>,
1914+
fn from_path<'tcx>(
1915+
ecx: &mut MiriInterpCx<'_, 'tcx>,
19161916
path: &Path,
19171917
follow_symlink: bool,
19181918
) -> InterpResult<'tcx, Option<FileMetadata>> {
@@ -1922,8 +1922,8 @@ impl FileMetadata {
19221922
FileMetadata::from_meta(ecx, metadata)
19231923
}
19241924

1925-
fn from_fd<'tcx, 'mir>(
1926-
ecx: &mut MiriInterpCx<'mir, 'tcx>,
1925+
fn from_fd<'tcx>(
1926+
ecx: &mut MiriInterpCx<'_, 'tcx>,
19271927
fd: i32,
19281928
) -> InterpResult<'tcx, Option<FileMetadata>> {
19291929
let option = ecx.machine.file_handler.handles.get(&fd);
@@ -1936,8 +1936,8 @@ impl FileMetadata {
19361936
FileMetadata::from_meta(ecx, metadata)
19371937
}
19381938

1939-
fn from_meta<'tcx, 'mir>(
1940-
ecx: &mut MiriInterpCx<'mir, 'tcx>,
1939+
fn from_meta<'tcx>(
1940+
ecx: &mut MiriInterpCx<'_, 'tcx>,
19411941
metadata: Result<std::fs::Metadata, std::io::Error>,
19421942
) -> InterpResult<'tcx, Option<FileMetadata>> {
19431943
let metadata = match metadata {

src/tools/miri/src/stacked_borrows/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -663,12 +663,12 @@ impl Stacks {
663663
}
664664

665665
#[inline(always)]
666-
pub fn before_memory_write<'tcx, 'mir, 'ecx>(
666+
pub fn before_memory_write<'tcx>(
667667
&mut self,
668668
alloc_id: AllocId,
669669
tag: ProvenanceExtra,
670670
range: AllocRange,
671-
machine: &'ecx mut MiriMachine<'mir, 'tcx>,
671+
machine: &mut MiriMachine<'_, 'tcx>,
672672
) -> InterpResult<'tcx> {
673673
trace!(
674674
"write access with tag {:?}: {:?}, size {}",
@@ -684,12 +684,12 @@ impl Stacks {
684684
}
685685

686686
#[inline(always)]
687-
pub fn before_memory_deallocation<'tcx, 'mir, 'ecx>(
687+
pub fn before_memory_deallocation<'tcx>(
688688
&mut self,
689689
alloc_id: AllocId,
690690
tag: ProvenanceExtra,
691691
range: AllocRange,
692-
machine: &'ecx mut MiriMachine<'mir, 'tcx>,
692+
machine: &mut MiriMachine<'_, 'tcx>,
693693
) -> InterpResult<'tcx> {
694694
trace!("deallocation with tag {:?}: {:?}, size {}", tag, alloc_id, range.size.bytes());
695695
let dcx = DiagnosticCxBuilder::dealloc(machine, tag);

0 commit comments

Comments
 (0)