@@ -14,7 +14,7 @@ use std::borrow::Cow;
14
14
use syntax:: ast:: { FloatTy , IntTy , UintTy } ;
15
15
use syntax:: codemap:: Span ;
16
16
use syntax:: errors:: DiagnosticBuilder ;
17
- use crate :: utils:: { comparisons, differing_macro_contexts, higher, in_constant, in_external_macro , in_macro, last_path_segment, match_def_path, match_path,
17
+ use crate :: utils:: { comparisons, differing_macro_contexts, higher, in_constant, in_macro, last_path_segment, match_def_path, match_path,
18
18
match_type, multispan_sugg, opt_def_id, same_tys, snippet, snippet_opt, span_help_and_lint, span_lint,
19
19
span_lint_and_sugg, span_lint_and_then, clip, unsext, sext, int_bits} ;
20
20
use crate :: utils:: paths;
@@ -381,7 +381,7 @@ declare_clippy_lint! {
381
381
fn check_let_unit ( cx : & LateContext < ' _ , ' _ > , decl : & Decl ) {
382
382
if let DeclKind :: Local ( ref local) = decl. node {
383
383
if is_unit ( cx. tables . pat_ty ( & local. pat ) ) {
384
- if in_external_macro ( cx, decl. span ) || in_macro ( local. pat . span ) {
384
+ if in_external_macro ( cx. sess ( ) , decl. span ) || in_macro ( local. pat . span ) {
385
385
return ;
386
386
}
387
387
if higher:: is_from_for_desugar ( decl) {
@@ -959,7 +959,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CastPass {
959
959
use syntax:: ast:: { LitIntType , LitKind } ;
960
960
match lit. node {
961
961
LitKind :: Int ( _, LitIntType :: Unsuffixed ) | LitKind :: FloatUnsuffixed ( _) => { } ,
962
- _ => if cast_from. sty == cast_to. sty && !in_external_macro ( cx, expr. span ) {
962
+ _ => if cast_from. sty == cast_to. sty && !in_external_macro ( cx. sess ( ) , expr. span ) {
963
963
span_lint (
964
964
cx,
965
965
UNNECESSARY_CAST ,
@@ -969,7 +969,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CastPass {
969
969
} ,
970
970
}
971
971
}
972
- if cast_from. is_numeric ( ) && cast_to. is_numeric ( ) && !in_external_macro ( cx, expr. span ) {
972
+ if cast_from. is_numeric ( ) && cast_to. is_numeric ( ) && !in_external_macro ( cx. sess ( ) , expr. span ) {
973
973
match ( cast_from. is_integral ( ) , cast_to. is_integral ( ) ) {
974
974
( true , false ) => {
975
975
let from_nbits = int_ty_to_nbits ( cast_from, cx. tcx ) ;
0 commit comments