mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 19:17:43 +00:00
Merge #3411
3411: rustup https://github.com/rust-lang/rust/pull/55665 (pass contexts by reference) r=matthiaskrgr a=matthiaskrgr Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
This commit is contained in:
commit
d8b426901a
@ -1016,7 +1016,7 @@ pub fn get_arg_name(pat: &Pat) -> Option<ast::Name> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn int_bits(tcx: TyCtxt<'_, '_, '_>, ity: ast::IntTy) -> u64 {
|
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)]
|
#[allow(clippy::cast_possible_wrap)]
|
||||||
@ -1035,7 +1035,7 @@ pub fn unsext(tcx: TyCtxt<'_, '_, '_>, u: i128, ity: ast::IntTy) -> u128 {
|
|||||||
|
|
||||||
/// clip unused bytes
|
/// clip unused bytes
|
||||||
pub fn clip(tcx: TyCtxt<'_, '_, '_>, u: u128, ity: ast::UintTy) -> u128 {
|
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;
|
let amt = 128 - bits;
|
||||||
(u << amt) >> amt
|
(u << amt) >> amt
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user