File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
src/tools/rust-analyzer/crates Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1323,7 +1323,7 @@ impl DefCollector<'_> {
1323
1323
_ => return Resolved :: No ,
1324
1324
} ;
1325
1325
1326
- // Skip #[test]/#[bench] expansion, which would merely result in more memory usage
1326
+ // Skip #[test]/#[bench]/#[test_case] expansion, which would merely result in more memory usage
1327
1327
// due to duplicating functions into macro expansions, but only if `cfg(test)` is active,
1328
1328
// otherwise they are expanded to nothing and this can impact e.g. diagnostics (due to things
1329
1329
// being cfg'ed out).
@@ -1332,7 +1332,7 @@ impl DefCollector<'_> {
1332
1332
if matches ! (
1333
1333
def. kind,
1334
1334
MacroDefKind :: BuiltInAttr ( _, expander)
1335
- if expander. is_test( ) || expander. is_bench( )
1335
+ if expander. is_test( ) || expander. is_bench( ) || expander . is_test_case ( )
1336
1336
) {
1337
1337
let test_is_active =
1338
1338
self . cfg_options . check_atom ( & CfgAtom :: Flag ( sym:: test. clone ( ) ) ) ;
Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ impl BuiltinAttrExpander {
51
51
pub fn is_bench ( self ) -> bool {
52
52
matches ! ( self , BuiltinAttrExpander :: Bench )
53
53
}
54
+ pub fn is_test_case ( self ) -> bool {
55
+ matches ! ( self , BuiltinAttrExpander :: TestCase )
56
+ }
54
57
}
55
58
56
59
register_builtin ! {
You can’t perform that action at this time.
0 commit comments