Skip to content

Commit be5d17f

Browse files
committedJun 14, 2019
Auto merge of #4209 - lzutao:TyCtxt-lifetime, r=Manishearth
Fix wrong lifetime of TyCtxt Rustup rust-lang/rust#61817 changelog: none
2 parents e5a7722 + 9bfdbd1 commit be5d17f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed
 

‎clippy_lints/src/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl Hash for Constant {
121121
}
122122

123123
impl Constant {
124-
pub fn partial_cmp(tcx: TyCtxt<'_, '_>, cmp_type: Ty<'_>, left: &Self, right: &Self) -> Option<Ordering> {
124+
pub fn partial_cmp(tcx: TyCtxt<'_>, cmp_type: Ty<'_>, left: &Self, right: &Self) -> Option<Ordering> {
125125
match (left, right) {
126126
(&Constant::Str(ref ls), &Constant::Str(ref rs)) => Some(ls.cmp(rs)),
127127
(&Constant::Char(ref l), &Constant::Char(ref r)) => Some(l.cmp(r)),

‎clippy_lints/src/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ declare_clippy_lint! {
860860

861861
/// Returns the size in bits of an integral type.
862862
/// Will return 0 if the type is not an int or uint variant
863-
fn int_ty_to_nbits(typ: Ty<'_>, tcx: TyCtxt<'_, '_>) -> u64 {
863+
fn int_ty_to_nbits(typ: Ty<'_>, tcx: TyCtxt<'_>) -> u64 {
864864
match typ.sty {
865865
ty::Int(i) => match i {
866866
IntTy::Isize => tcx.data_layout.pointer_size.bits(),

‎clippy_lints/src/utils/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -911,28 +911,28 @@ pub fn get_arg_name(pat: &Pat) -> Option<ast::Name> {
911911
}
912912
}
913913

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

920920
#[allow(clippy::cast_possible_wrap)]
921921
/// Turn a constant int byte representation into an i128
922-
pub fn sext(tcx: TyCtxt<'_, '_>, u: u128, ity: ast::IntTy) -> i128 {
922+
pub fn sext(tcx: TyCtxt<'_>, u: u128, ity: ast::IntTy) -> i128 {
923923
let amt = 128 - int_bits(tcx, ity);
924924
((u as i128) << amt) >> amt
925925
}
926926

927927
#[allow(clippy::cast_sign_loss)]
928928
/// clip unused bytes
929-
pub fn unsext(tcx: TyCtxt<'_, '_>, u: i128, ity: ast::IntTy) -> u128 {
929+
pub fn unsext(tcx: TyCtxt<'_>, u: i128, ity: ast::IntTy) -> u128 {
930930
let amt = 128 - int_bits(tcx, ity);
931931
((u as u128) << amt) >> amt
932932
}
933933

934934
/// clip unused bytes
935-
pub fn clip(tcx: TyCtxt<'_, '_>, u: u128, ity: ast::UintTy) -> u128 {
935+
pub fn clip(tcx: TyCtxt<'_>, u: u128, ity: ast::UintTy) -> u128 {
936936
let bits = layout::Integer::from_attr(&tcx, attr::IntType::UnsignedInt(ity))
937937
.size()
938938
.bits();
@@ -973,7 +973,7 @@ pub fn without_block_comments(lines: Vec<&str>) -> Vec<&str> {
973973
without
974974
}
975975

976-
pub fn any_parent_is_automatically_derived(tcx: TyCtxt<'_, '_>, node: HirId) -> bool {
976+
pub fn any_parent_is_automatically_derived(tcx: TyCtxt<'_>, node: HirId) -> bool {
977977
let map = &tcx.hir();
978978
let mut prev_enclosing_node = None;
979979
let mut enclosing_node = node;

0 commit comments

Comments
 (0)
Please sign in to comment.