Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-diagnostics/src/handlers/unresolved_macro_call.rs')
-rw-r--r--crates/ide-diagnostics/src/handlers/unresolved_macro_call.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/ide-diagnostics/src/handlers/unresolved_macro_call.rs b/crates/ide-diagnostics/src/handlers/unresolved_macro_call.rs
index 5b596123e7..0d1c977506 100644
--- a/crates/ide-diagnostics/src/handlers/unresolved_macro_call.rs
+++ b/crates/ide-diagnostics/src/handlers/unresolved_macro_call.rs
@@ -82,4 +82,29 @@ self::m!(); self::m2!();
"#,
);
}
+
+ #[test]
+ fn no_unresolved_panic_inside_mod_inside_fn() {
+ check_diagnostics(
+ r#"
+//- /core.rs library crate:core
+#[macro_export]
+macro_rules! panic {
+ () => {};
+}
+
+//- /lib.rs crate:foo deps:core
+#[macro_use]
+extern crate core;
+
+fn foo() {
+ mod init {
+ pub fn init() {
+ panic!();
+ }
+ }
+}
+ "#,
+ );
+ }
}