Skip to content

Commit

Permalink
rustup rust-lang/rust#55665 (pass contexts by reference)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Nov 4, 2018
1 parent a07c271 commit 3967016
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ pub fn get_arg_name(pat: &Pat) -> Option<ast::Name> {
}

pub fn int_bits(tcx: TyCtxt<'_, '_, '_>, ity: ast::IntTy) -> u64 {
layout::Integer::from_attr(tcx, attr::IntType::SignedInt(ity)).size().bits()
layout::Integer::from_attr(&tcx, attr::IntType::SignedInt(ity)).size().bits()
}

#[allow(clippy::cast_possible_wrap)]
Expand All @@ -1035,7 +1035,7 @@ pub fn unsext(tcx: TyCtxt<'_, '_, '_>, u: i128, ity: ast::IntTy) -> u128 {

/// clip unused bytes
pub fn clip(tcx: TyCtxt<'_, '_, '_>, u: u128, ity: ast::UintTy) -> u128 {
let bits = layout::Integer::from_attr(tcx, attr::IntType::UnsignedInt(ity)).size().bits();
let bits = layout::Integer::from_attr(&tcx, attr::IntType::UnsignedInt(ity)).size().bits();
let amt = 128 - bits;
(u << amt) >> amt
}
Expand Down

0 comments on commit 3967016

Please sign in to comment.