about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonas Schievink <jonasschievink@gmail.com>2020-12-18 20:25:41 +0100
committerJonas Schievink <jonasschievink@gmail.com>2020-12-18 20:25:41 +0100
commitaab9cc9cfb64aea659f2f9b588e8a4f392e2c4e1 (patch)
tree1fe215b8433ea21ea713567dfc7a3b2210a55541
parent382ee2fa037a3ec293d332dd70f04975396b5513 (diff)
downloadrust-aab9cc9cfb64aea659f2f9b588e8a4f392e2c4e1.tar.gz
rust-aab9cc9cfb64aea659f2f9b588e8a4f392e2c4e1.zip
Hit a mark
-rw-r--r--crates/hir_def/src/attr.rs3
-rw-r--r--crates/hir_def/src/nameres/tests/diagnostics.rs2
2 files changed, 5 insertions, 0 deletions
diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs
index 68d05c54dc0..1b9c64ee55a 100644
--- a/crates/hir_def/src/attr.rs
+++ b/crates/hir_def/src/attr.rs
@@ -12,6 +12,7 @@ use syntax::{
     ast::{self, AstNode, AttrsOwner},
     match_ast, AstToken, SmolStr, SyntaxNode,
 };
+use test_utils::mark;
 use tt::Subtree;
 
 use crate::{
@@ -175,6 +176,8 @@ impl RawAttrs {
                 if cfg_options.check(&cfg) == Some(false) {
                     None
                 } else {
+                    mark::hit!(cfg_attr_active);
+
                     let attr = ast::Attr::parse(&format!("#[{}]", attr)).ok()?;
                     let hygiene = Hygiene::new_unhygienic(); // FIXME
                     Attr::from_src(attr, &hygiene)
diff --git a/crates/hir_def/src/nameres/tests/diagnostics.rs b/crates/hir_def/src/nameres/tests/diagnostics.rs
index 4093f8bd0b4..58d69d3c6b2 100644
--- a/crates/hir_def/src/nameres/tests/diagnostics.rs
+++ b/crates/hir_def/src/nameres/tests/diagnostics.rs
@@ -1,4 +1,5 @@
 use base_db::fixture::WithFixture;
+use test_utils::mark;
 
 use crate::test_db::TestDB;
 
@@ -123,6 +124,7 @@ fn inactive_item() {
 /// Tests that `cfg` attributes behind `cfg_attr` is handled properly.
 #[test]
 fn inactive_via_cfg_attr() {
+    mark::check!(cfg_attr_active);
     check_diagnostics(
         r#"
         //- /lib.rs