From d077b8a7e080ffddda6c88c07d927dc54c8cde33 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Sat, 22 May 2021 02:30:03 +0200 Subject: Work around non-unique AttrIds --- crates/hir_def/src/nameres/tests/macros.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'crates/hir_def/src/nameres/tests/macros.rs') diff --git a/crates/hir_def/src/nameres/tests/macros.rs b/crates/hir_def/src/nameres/tests/macros.rs index 133b2d818..3065efd65 100644 --- a/crates/hir_def/src/nameres/tests/macros.rs +++ b/crates/hir_def/src/nameres/tests/macros.rs @@ -737,6 +737,7 @@ fn unresolved_attributes_fall_back_track_per_file_moditems() { #[test] fn unresolved_attrs_extern_block_hang() { + // Regression test for https://github.com/rust-analyzer/rust-analyzer/issues/8905 check( r#" #[unresolved] @@ -790,7 +791,22 @@ fn derive() {} crate S: t v "#]], - ) + ); +} + +#[test] +fn unresolved_attr_with_cfg_attr_hang() { + // Another regression test for https://github.com/rust-analyzer/rust-analyzer/issues/8905 + check( + r#" +#[cfg_attr(not(off), unresolved, unresolved)] +struct S; + "#, + expect![[r#" + crate + S: t v + "#]], + ); } #[test] -- cgit v1.2.3