Hit a mark

This commit is contained in:
Jonas Schievink 2020-12-18 20:25:41 +01:00
parent 382ee2fa03
commit aab9cc9cfb
2 changed files with 5 additions and 0 deletions

View File

@ -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)

View File

@ -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