11use clippy_utils:: diagnostics:: span_lint_and_then;
2- use clippy_utils:: is_in_test_function ;
2+ use clippy_utils:: is_in_test ;
33
44use rustc_hir as hir;
55use rustc_hir:: intravisit:: FnKind ;
@@ -41,7 +41,7 @@ fn report(cx: &LateContext<'_>, param: &GenericParam<'_>, generics: &Generics<'_
4141pub ( super ) fn check_fn < ' tcx > ( cx : & LateContext < ' _ > , kind : & ' tcx FnKind < ' _ > , body : & ' tcx Body < ' _ > , hir_id : HirId ) {
4242 if let FnKind :: ItemFn ( _, generics, _) = kind
4343 && 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)
4545 {
4646 for param in generics. params {
4747 if param. is_impl_trait ( ) {
@@ -59,7 +59,7 @@ pub(super) fn check_impl_item(cx: &LateContext<'_>, impl_item: &ImplItem<'_>) {
5959 && of_trait. is_none ( )
6060 && let body = cx. tcx . hir ( ) . body ( body_id)
6161 && 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 ( ) )
6363 {
6464 for param in impl_item. generics . params {
6565 if param. is_impl_trait ( ) {
@@ -75,7 +75,7 @@ pub(super) fn check_trait_item(cx: &LateContext<'_>, trait_item: &TraitItem<'_>,
7575 && let hir:: Node :: Item ( item) = cx. tcx . parent_hir_node ( trait_item. hir_id ( ) )
7676 // ^^ (Will always be a trait)
7777 && !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 ( ) )
7979 {
8080 for param in trait_item. generics . params {
8181 if param. is_impl_trait ( ) {
0 commit comments