/// Gets an instance for a path.
///
/// A `None` namespace indicates we are looking for a module.
-fn try_resolve_did<'tcx>(
- tcx: TyCtxt<'tcx>,
- path: &[&str],
- namespace: Option<Namespace>,
-) -> Option<DefId> {
+fn try_resolve_did(tcx: TyCtxt<'_>, path: &[&str], namespace: Option<Namespace>) -> Option<DefId> {
/// Yield all children of the given item, that have the given name.
fn find_children<'tcx: 'a, 'a>(
tcx: TyCtxt<'tcx>,
}
#[cfg(unix)]
-pub fn os_str_to_bytes<'a, 'tcx>(os_str: &'a OsStr) -> InterpResult<'tcx, &'a [u8]> {
+pub fn os_str_to_bytes<'tcx>(os_str: &OsStr) -> InterpResult<'tcx, &[u8]> {
Ok(os_str.as_bytes())
}
#[cfg(not(unix))]
-pub fn os_str_to_bytes<'a, 'tcx>(os_str: &'a OsStr) -> InterpResult<'tcx, &'a [u8]> {
+pub fn os_str_to_bytes<'tcx>(os_str: &OsStr) -> InterpResult<'tcx, &[u8]> {
// On non-unix platforms the best we can do to transform bytes from/to OS strings is to do the
// intermediate transformation into strings. Which invalidates non-utf8 paths that are actually
// valid.
}
#[cfg(unix)]
-pub fn bytes_to_os_str<'a, 'tcx>(bytes: &'a [u8]) -> InterpResult<'tcx, &'a OsStr> {
+pub fn bytes_to_os_str<'tcx>(bytes: &[u8]) -> InterpResult<'tcx, &OsStr> {
Ok(OsStr::from_bytes(bytes))
}
#[cfg(not(unix))]
-pub fn bytes_to_os_str<'a, 'tcx>(bytes: &'a [u8]) -> InterpResult<'tcx, &'a OsStr> {
+pub fn bytes_to_os_str<'tcx>(bytes: &[u8]) -> InterpResult<'tcx, &OsStr> {
let s = std::str::from_utf8(bytes)
.map_err(|_| err_unsup_format!("{:?} is not a valid utf-8 string", bytes))?;
Ok(OsStr::new(s))
}
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 {
}
#[inline(always)]
- pub fn before_memory_write<'tcx, 'mir, 'ecx>(
+ pub fn before_memory_write<'tcx>(
&mut self,
alloc_id: AllocId,
tag: ProvenanceExtra,
range: AllocRange,
- machine: &'ecx mut MiriMachine<'mir, 'tcx>,
+ machine: &mut MiriMachine<'_, 'tcx>,
) -> InterpResult<'tcx> {
trace!(
"write access with tag {:?}: {:?}, size {}",
}
#[inline(always)]
- pub fn before_memory_deallocation<'tcx, 'mir, 'ecx>(
+ pub fn before_memory_deallocation<'tcx>(
&mut self,
alloc_id: AllocId,
tag: ProvenanceExtra,
range: AllocRange,
- machine: &'ecx mut MiriMachine<'mir, 'tcx>,
+ machine: &mut MiriMachine<'_, 'tcx>,
) -> InterpResult<'tcx> {
trace!("deallocation with tag {:?}: {:?}, size {}", tag, alloc_id, range.size.bytes());
let dcx = DiagnosticCxBuilder::dealloc(machine, tag);