@@ -236,9 +236,7 @@ fn find_related_tests(
236
236
. filter_map ( |token| token. ancestors ( ) . find_map ( ast:: Fn :: cast) )
237
237
. map ( |f| hir:: InFile :: new ( sema. hir_file_for ( f. syntax ( ) ) , f) ) ;
238
238
239
- for fn_def in functions {
240
- // #[test/bench] expands to just the item causing us to lose the attribute, so recover them by going out of the attribute
241
- let InFile { value : fn_def, .. } = & fn_def. node_with_attributes ( sema. db ) ;
239
+ for InFile { value : ref fn_def, .. } in functions {
242
240
if let Some ( runnable) = as_test_runnable ( sema, fn_def) {
243
241
// direct test
244
242
tests. insert ( runnable) ;
@@ -294,8 +292,7 @@ fn parent_test_module(sema: &Semantics<RootDatabase>, fn_def: &ast::Fn) -> Optio
294
292
}
295
293
296
294
pub ( crate ) fn runnable_fn ( sema : & Semantics < RootDatabase > , def : hir:: Function ) -> Option < Runnable > {
297
- // #[test/bench] expands to just the item causing us to lose the attribute, so recover them by going out of the attribute
298
- let func = def. source ( sema. db ) ?. node_with_attributes ( sema. db ) ;
295
+ let func = def. source ( sema. db ) ?;
299
296
let name_string = def. name ( sema. db ) . to_string ( ) ;
300
297
301
298
let root = def. module ( sema. db ) . krate ( ) . root_module ( sema. db ) ;
@@ -504,8 +501,6 @@ fn has_test_function_or_multiple_test_submodules(
504
501
match item {
505
502
hir:: ModuleDef :: Function ( f) => {
506
503
if let Some ( it) = f. source ( sema. db ) {
507
- // #[test/bench] expands to just the item causing us to lose the attribute, so recover them by going out of the attribute
508
- let it = it. node_with_attributes ( sema. db ) ;
509
504
if test_related_attribute ( & it. value ) . is_some ( ) {
510
505
return true ;
511
506
}
0 commit comments