Skip to content

Commit

Permalink
Remove rustc_session::config::Config
Browse files Browse the repository at this point in the history
The wrapper type led to tons of target.target
across the compiler. Its ptr_width field isn't
required any more, as target_pointer_width
is already present in parsed form.
  • Loading branch information
est31 committed Oct 15, 2020
1 parent bf947fc commit 2c1e8cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clippy_lints/src/trivially_copy_pass_by_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use rustc_hir::intravisit::FnKind;
use rustc_hir::{Body, FnDecl, HirId, ItemKind, MutTy, Mutability, Node};
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::ty;
use rustc_session::config::Config as SessionConfig;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::Span;
use rustc_target::abi::LayoutOf;
use rustc_target::spec::Target;
use rustc_target::spec::abi::Abi;

declare_clippy_lint! {
Expand Down Expand Up @@ -60,9 +60,9 @@ pub struct TriviallyCopyPassByRef {
}

impl<'tcx> TriviallyCopyPassByRef {
pub fn new(limit: Option<u64>, target: &SessionConfig) -> Self {
pub fn new(limit: Option<u64>, target: &Target) -> Self {
let limit = limit.unwrap_or_else(|| {
let bit_width = u64::from(target.ptr_width);
let bit_width = u64::from(target.pointer_width);
// Cap the calculated bit width at 32-bits to reduce
// portability problems between 32 and 64-bit targets
let bit_width = cmp::min(bit_width, 32);
Expand Down

0 comments on commit 2c1e8cf

Please sign in to comment.