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<'_> {
13231323 _ => return Resolved :: No ,
13241324 } ;
13251325
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
13271327 // due to duplicating functions into macro expansions, but only if `cfg(test)` is active,
13281328 // otherwise they are expanded to nothing and this can impact e.g. diagnostics (due to things
13291329 // being cfg'ed out).
@@ -1332,7 +1332,7 @@ impl DefCollector<'_> {
13321332 if matches ! (
13331333 def. kind,
13341334 MacroDefKind :: BuiltInAttr ( _, expander)
1335- if expander. is_test( ) || expander. is_bench( )
1335+ if expander. is_test( ) || expander. is_bench( ) || expander . is_test_case ( )
13361336 ) {
13371337 let test_is_active =
13381338 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 {
5151 pub fn is_bench ( self ) -> bool {
5252 matches ! ( self , BuiltinAttrExpander :: Bench )
5353 }
54+ pub fn is_test_case ( self ) -> bool {
55+ matches ! ( self , BuiltinAttrExpander :: TestCase )
56+ }
5457}
5558
5659register_builtin ! {
You can’t perform that action at this time.
0 commit comments