@@ -41,16 +41,12 @@ use rustc_infer::infer::TyCtxtInferExt;
41
41
use rustc_lint:: { LateContext , Level , Lint , LintContext } ;
42
42
use rustc_middle:: hir:: map:: Map ;
43
43
use rustc_middle:: traits;
44
- use rustc_middle:: ty:: {
45
- self ,
46
- layout:: { self , IntegerExt } ,
47
- subst:: GenericArg ,
48
- Binder , Ty , TyCtxt , TypeFoldable ,
49
- } ;
44
+ use rustc_middle:: ty:: { self , layout:: IntegerExt , subst:: GenericArg , Binder , Ty , TyCtxt , TypeFoldable } ;
50
45
use rustc_span:: hygiene:: { ExpnKind , MacroKind } ;
51
46
use rustc_span:: source_map:: original_sp;
52
47
use rustc_span:: symbol:: { self , kw, Symbol } ;
53
48
use rustc_span:: { BytePos , Pos , Span , DUMMY_SP } ;
49
+ use rustc_target:: abi:: Integer ;
54
50
use rustc_trait_selection:: traits:: predicate_for_trait_def;
55
51
use rustc_trait_selection:: traits:: query:: evaluate_obligation:: InferCtxtExt ;
56
52
use rustc_trait_selection:: traits:: query:: normalize:: AtExt ;
@@ -1080,9 +1076,7 @@ pub fn get_arg_name(pat: &Pat<'_>) -> Option<ast::Name> {
1080
1076
}
1081
1077
1082
1078
pub fn int_bits ( tcx : TyCtxt < ' _ > , ity : ast:: IntTy ) -> u64 {
1083
- layout:: Integer :: from_attr ( & tcx, attr:: IntType :: SignedInt ( ity) )
1084
- . size ( )
1085
- . bits ( )
1079
+ Integer :: from_attr ( & tcx, attr:: IntType :: SignedInt ( ity) ) . size ( ) . bits ( )
1086
1080
}
1087
1081
1088
1082
#[ allow( clippy:: cast_possible_wrap) ]
@@ -1101,9 +1095,7 @@ pub fn unsext(tcx: TyCtxt<'_>, u: i128, ity: ast::IntTy) -> u128 {
1101
1095
1102
1096
/// clip unused bytes
1103
1097
pub fn clip ( tcx : TyCtxt < ' _ > , u : u128 , ity : ast:: UintTy ) -> u128 {
1104
- let bits = layout:: Integer :: from_attr ( & tcx, attr:: IntType :: UnsignedInt ( ity) )
1105
- . size ( )
1106
- . bits ( ) ;
1098
+ let bits = Integer :: from_attr ( & tcx, attr:: IntType :: UnsignedInt ( ity) ) . size ( ) . bits ( ) ;
1107
1099
let amt = 128 - bits;
1108
1100
( u << amt) >> amt
1109
1101
}
0 commit comments