1
1
use clippy_utils:: diagnostics:: span_lint_and_then;
2
- use clippy_utils:: is_in_test_function ;
2
+ use clippy_utils:: is_in_test ;
3
3
4
4
use rustc_hir as hir;
5
5
use rustc_hir:: intravisit:: FnKind ;
@@ -41,7 +41,7 @@ fn report(cx: &LateContext<'_>, param: &GenericParam<'_>, generics: &Generics<'_
41
41
pub ( super ) fn check_fn < ' tcx > ( cx : & LateContext < ' _ > , kind : & ' tcx FnKind < ' _ > , body : & ' tcx Body < ' _ > , hir_id : HirId ) {
42
42
if let FnKind :: ItemFn ( _, generics, _) = kind
43
43
&& cx. tcx . visibility ( cx. tcx . hir ( ) . body_owner_def_id ( body. id ( ) ) ) . is_public ( )
44
- && !is_in_test_function ( cx. tcx , hir_id)
44
+ && !is_in_test ( cx. tcx , hir_id)
45
45
{
46
46
for param in generics. params {
47
47
if param. is_impl_trait ( ) {
@@ -59,7 +59,7 @@ pub(super) fn check_impl_item(cx: &LateContext<'_>, impl_item: &ImplItem<'_>) {
59
59
&& of_trait. is_none ( )
60
60
&& let body = cx. tcx . hir ( ) . body ( body_id)
61
61
&& cx. tcx . visibility ( cx. tcx . hir ( ) . body_owner_def_id ( body. id ( ) ) ) . is_public ( )
62
- && !is_in_test_function ( cx. tcx , impl_item. hir_id ( ) )
62
+ && !is_in_test ( cx. tcx , impl_item. hir_id ( ) )
63
63
{
64
64
for param in impl_item. generics . params {
65
65
if param. is_impl_trait ( ) {
@@ -75,7 +75,7 @@ pub(super) fn check_trait_item(cx: &LateContext<'_>, trait_item: &TraitItem<'_>,
75
75
&& let hir:: Node :: Item ( item) = cx. tcx . parent_hir_node ( trait_item. hir_id ( ) )
76
76
// ^^ (Will always be a trait)
77
77
&& !item. vis_span . is_empty ( ) // Is public
78
- && !is_in_test_function ( cx. tcx , trait_item. hir_id ( ) )
78
+ && !is_in_test ( cx. tcx , trait_item. hir_id ( ) )
79
79
{
80
80
for param in trait_item. generics . params {
81
81
if param. is_impl_trait ( ) {
0 commit comments