Skip to content

Commit

Permalink
Remove redundant imports of size_of
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtriplett committed Mar 28, 2024
1 parent bfa36cd commit 3364a0d
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/query/erase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::traits;
use crate::ty::adjustment::CoerceUnsizedInfo;
use crate::ty::{self, Ty};
use std::intrinsics::transmute_unchecked;
use std::mem::{size_of, MaybeUninit};
use std::mem::MaybeUninit;

#[derive(Copy, Clone)]
pub struct Erased<T: Copy> {
Expand Down
1 change: 0 additions & 1 deletion library/alloc/tests/thin_box.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use core::fmt::Debug;
use core::mem::size_of;
use std::boxed::ThinBox;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/tests/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::fmt::Debug;
use std::hint;
use std::iter::InPlaceIterable;
use std::mem;
use std::mem::{size_of, swap};
use std::mem::swap;
use std::ops::Bound::*;
use std::panic::{catch_unwind, AssertUnwindSafe};
use std::rc::Rc;
Expand Down
1 change: 0 additions & 1 deletion library/core/tests/alloc.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use core::alloc::Layout;
use core::mem::size_of;
use core::ptr::{self, NonNull};

#[test]
Expand Down
1 change: 0 additions & 1 deletion library/core/tests/nonzero.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use core::num::{IntErrorKind, NonZero};
use core::option::Option::None;
use std::mem::size_of;

#[test]
fn test_create_nonzero_instance() {
Expand Down
1 change: 0 additions & 1 deletion library/proc_macro/src/bridge/fxhash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use std::collections::HashMap;
use std::hash::BuildHasherDefault;
use std::hash::Hasher;
use std::mem::size_of;
use std::ops::BitXor;

/// Type alias for a hashmap using the `fx` hash algorithm.
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/io/error/repr_bitpacked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

use super::{Custom, ErrorData, ErrorKind, RawOsError, SimpleMessage};
use core::marker::PhantomData;
use core::mem::{align_of, size_of};
use core::mem::align_of;
use core::ptr::{self, NonNull};

// The 2 least-significant bits are used as tag.
Expand Down
1 change: 0 additions & 1 deletion library/std/src/io/error/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use super::{const_io_error, Custom, Error, ErrorData, ErrorKind, Repr, SimpleMes
use crate::assert_matches::assert_matches;
use crate::error;
use crate::fmt;
use crate::mem::size_of;
use crate::sys::decode_error_kind;
use crate::sys::os::error_string;

Expand Down
2 changes: 1 addition & 1 deletion library/std/src/os/unix/net/ancillary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use super::{sockaddr_un, SocketAddr};
use crate::io::{self, IoSlice, IoSliceMut};
use crate::marker::PhantomData;
use crate::mem::{size_of, zeroed};
use crate::mem::zeroed;
use crate::os::unix::io::RawFd;
use crate::path::Path;
use crate::ptr::{eq, read_unaligned};
Expand Down
5 changes: 1 addition & 4 deletions src/tools/rust-analyzer/crates/hir-ty/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
//! HIR back into source code, and just displaying them for debugging/testing
//! purposes.

use std::{
fmt::{self, Debug},
mem::size_of,
};
use std::fmt::{self, Debug};

use base_db::CrateId;
use chalk_ir::{BoundVar, Safety, TyKind};
Expand Down

0 comments on commit 3364a0d

Please sign in to comment.