Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/nameres/tests/macros.rs')
-rw-r--r--crates/hir-def/src/nameres/tests/macros.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/crates/hir-def/src/nameres/tests/macros.rs b/crates/hir-def/src/nameres/tests/macros.rs
index 3ece1379ad..fe0ad4f386 100644
--- a/crates/hir-def/src/nameres/tests/macros.rs
+++ b/crates/hir-def/src/nameres/tests/macros.rs
@@ -823,6 +823,28 @@ fn derive() {}
}
#[test]
+fn resolves_derive_helper_rustc_builtin_macro() {
+ cov_mark::check!(resolved_derive_helper);
+ // This is NOT the correct usage of `default` helper attribute, but we don't resolve helper
+ // attributes on non mod items in hir nameres.
+ check(
+ r#"
+//- minicore: derive, default
+#[derive(Default)]
+#[default]
+enum E {
+ A,
+ B,
+}
+"#,
+ expect![[r#"
+ crate
+ E: t
+ "#]],
+ );
+}
+
+#[test]
fn unresolved_attr_with_cfg_attr_hang() {
// Another regression test for https://github.com/rust-lang/rust-analyzer/issues/8905
check(