Skip to content

Commit

Permalink
Merge pull request #979 from ptersilie/fix_rustupdate_errors
Browse files Browse the repository at this point in the history
Fix errors/warnings related to latest rust.
  • Loading branch information
vext01 authored Feb 20, 2024
2 parents 96dae12 + 55f7afb commit 1201276
Show file tree
Hide file tree
Showing 13 changed files with 10 additions and 23 deletions.
2 changes: 1 addition & 1 deletion hwtracer/src/llvm_blockmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use byteorder::{NativeEndian, ReadBytesExt};
use intervaltree::IntervalTree;
use object::{self, Object, ObjectSection};
use object::{Object, ObjectSection};
use std::{
io::{prelude::*, Cursor, SeekFrom},
sync::LazyLock,
Expand Down
4 changes: 2 additions & 2 deletions hwtracer/src/perf/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
Block, ThreadTracer, Trace, Tracer,
};
use libc::{c_void, free, geteuid, malloc, size_t};
use std::{convert::TryFrom, fs::read_to_string, slice, sync::Arc};
use std::{fs::read_to_string, slice, sync::Arc};

#[cfg(pt)]
extern "C" {
Expand Down Expand Up @@ -213,7 +213,7 @@ impl Drop for PerfTrace {
#[cfg(test)]
mod tests {
use super::*;
use crate::{errors::HWTracerError, perf::collect::PerfTracer, work_loop, Tracer};
use crate::work_loop;

/// Check that a long trace causes the trace buffer to reallocate.
#[test]
Expand Down
6 changes: 1 addition & 5 deletions hwtracer/src/pt/ykpt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ use crate::{
use intervaltree::IntervalTree;
use std::{
collections::VecDeque,
convert::TryFrom,
ffi::CString,
fmt::{self, Debug},
ops::Range,
Expand All @@ -57,10 +56,7 @@ use std::{
sync::LazyLock,
};
use thiserror::Error;
use ykaddr::{
self,
obj::{PHDR_MAIN_OBJ, PHDR_OBJECT_CACHE, SELF_BIN_PATH},
};
use ykaddr::obj::{PHDR_MAIN_OBJ, PHDR_OBJECT_CACHE, SELF_BIN_PATH};

use packets::{Bitness, Packet, PacketKind};
use parser::PacketParser;
Expand Down
1 change: 0 additions & 1 deletion hwtracer/src/pt/ykpt/packets.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Intel PT packets and their constituents.
use deku::prelude::*;
use std::convert::TryFrom;

/// The `IPBytes` field common to all IP packets.
///
Expand Down
2 changes: 1 addition & 1 deletion hwtracer/src/pt/ykpt/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use deku::{
bitvec::{BitSlice, Msb0},
DekuRead,
};
use std::{cmp::min, iter::Iterator};
use std::cmp::min;

use super::packets::*;

Expand Down
5 changes: 2 additions & 3 deletions ykaddr/src/addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
use crate::obj::{PHDR_OBJECT_CACHE, SELF_BIN_PATH};
use cached::proc_macro::cached;
use libc::{self, c_void, dlsym, Dl_info, RTLD_DEFAULT};
use libc::{c_void, dlsym, Dl_info, RTLD_DEFAULT};
use std::{
convert::{From, TryFrom},
ffi::CStr,
mem::MaybeUninit,
path::{Path, PathBuf},
Expand Down Expand Up @@ -143,7 +142,7 @@ pub fn vaddr_to_sym_and_obj(vaddr: usize) -> Option<DLInfo> {
mod tests {
use super::{off_to_vaddr, vaddr_to_obj_and_off, vaddr_to_sym_and_obj, MaybeUninit};
use crate::obj::PHDR_MAIN_OBJ;
use libc::{self, dlsym, Dl_info};
use libc::{dlsym, Dl_info};
use std::{ffi::CString, ptr};

#[test]
Expand Down
2 changes: 0 additions & 2 deletions ykaddr/src/obj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ use libc::c_void;
use libc::{
Elf64_Addr as Elf_Addr, Elf64_Off as Elf_Off, Elf64_Word as Elf_Word, Elf64_Xword as Elf_Xword,
};
use memmap2;
use phdrs;
use std::{
ffi::{CStr, CString},
fs,
Expand Down
1 change: 0 additions & 1 deletion ykrt/src/compile/jitc_yk/jit_ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,6 @@ impl fmt::Display for Module {
#[cfg(test)]
mod tests {
use super::*;
use std::mem;

#[test]
fn operand() {
Expand Down
2 changes: 1 addition & 1 deletion ykrt/src/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use llvm_sys::{core::*, prelude::LLVMValueRef};
use object::{Object, ObjectSection};
use std::{convert::TryFrom, ffi::c_void, ptr, sync::LazyLock, thread};
use std::{ffi::c_void, ptr, sync::LazyLock, thread};
use ykaddr::obj::SELF_BIN_MMAP;
use yksmp::{Location as SMLocation, PrologueInfo, Record, StackMapParser};

Expand Down
1 change: 0 additions & 1 deletion ykrt/src/location.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Trace location: track the state of a program location (counting, tracing, compiled, etc).
use std::{
convert::TryFrom,
mem,
sync::{
atomic::{AtomicUsize, Ordering},
Expand Down
3 changes: 1 addition & 2 deletions ykrt/src/mt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,7 @@ impl PartialEq for TransitionControlPoint {
mod tests {
extern crate test;
use super::*;
use crate::location::HotLocationKind;
use std::{convert::TryFrom, hint::black_box, sync::atomic::AtomicU64, thread};
use std::{hint::black_box, sync::atomic::AtomicU64};
use test::bench::Bencher;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion ykrt/src/trace/hwt/mapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::trace::TracedAOTBlock;
use hwtracer::llvm_blockmap::LLVM_BLOCK_MAP;
use hwtracer::Trace;
use std::{convert::TryFrom, error::Error};
use std::error::Error;
use ykaddr::{
addr::{vaddr_to_obj_and_off, vaddr_to_sym_and_obj},
obj::SELF_BIN_PATH,
Expand Down
2 changes: 0 additions & 2 deletions yksmp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
compile_error!("The stackmap parser currently only supports x86_64.");

use std::collections::HashMap;
use std::convert::TryFrom;
use std::convert::TryInto;
use std::error;

struct Function {
Expand Down

0 comments on commit 1201276

Please sign in to comment.