From 9aa58ed5a4166232e31da6bad9de97bf4df1be3e Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 27 Nov 2019 14:41:22 -0800 Subject: [PATCH] config.usize_ty -> config.ptr_width From http://github.com/rust-lang/rust/pull/66719 --- clippy_lints/src/trivially_copy_pass_by_ref.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_lints/src/trivially_copy_pass_by_ref.rs b/clippy_lints/src/trivially_copy_pass_by_ref.rs index 616568f36eeb..10f36d7fd5b2 100644 --- a/clippy_lints/src/trivially_copy_pass_by_ref.rs +++ b/clippy_lints/src/trivially_copy_pass_by_ref.rs @@ -62,7 +62,7 @@ pub struct TriviallyCopyPassByRef { impl<'a, 'tcx> TriviallyCopyPassByRef { pub fn new(limit: Option, target: &SessionConfig) -> Self { let limit = limit.unwrap_or_else(|| { - let bit_width = target.usize_ty.bit_width().expect("usize should have a width") as u64; + let bit_width = u64::from(target.ptr_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);