Skip to content

Commit 2c1e8cf

Browse files
committed
Remove rustc_session::config::Config
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.
1 parent bf947fc commit 2c1e8cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/trivially_copy_pass_by_ref.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ use rustc_hir::intravisit::FnKind;
99
use rustc_hir::{Body, FnDecl, HirId, ItemKind, MutTy, Mutability, Node};
1010
use rustc_lint::{LateContext, LateLintPass};
1111
use rustc_middle::ty;
12-
use rustc_session::config::Config as SessionConfig;
1312
use rustc_session::{declare_tool_lint, impl_lint_pass};
1413
use rustc_span::Span;
1514
use rustc_target::abi::LayoutOf;
15+
use rustc_target::spec::Target;
1616
use rustc_target::spec::abi::Abi;
1717

1818
declare_clippy_lint! {
@@ -60,9 +60,9 @@ pub struct TriviallyCopyPassByRef {
6060
}
6161

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

0 commit comments

Comments
 (0)