Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/goto_definition.rs')
-rw-r--r--crates/ide/src/goto_definition.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs
index 1d42a66995..363f852e0e 100644
--- a/crates/ide/src/goto_definition.rs
+++ b/crates/ide/src/goto_definition.rs
@@ -3002,4 +3002,24 @@ use foo::m;
"#,
);
}
+
+ #[test]
+ fn macro_label_hygiene() {
+ check(
+ r#"
+macro_rules! m {
+ ($x:stmt) => {
+ 'bar: loop { $x }
+ };
+}
+
+fn foo() {
+ 'bar: loop {
+ // ^^^^
+ m!(continue 'bar$0);
+ }
+}
+"#,
+ );
+ }
}