mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Auto merge of #18210 - ChayimFriedman2:label-macro, r=Veykril
fix: Fix resolution of label inside macro When working on Something Else (TM) (I left a hint in the commits :P), I noticed to my surprise that labels inside macros are not resolved. This led to a discovery of *two* unrelated bugs, which are hereby fixed in two commits.
This commit is contained in:
commit
ac8509a74b
5 changed files with 71 additions and 27 deletions
|
@ -2660,6 +2660,24 @@ fn foo() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn label_inside_macro() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! m {
|
||||
($s:stmt) => { $s };
|
||||
}
|
||||
|
||||
fn foo() {
|
||||
'label: loop {
|
||||
// ^^^^^^
|
||||
m!(continue 'label$0);
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn goto_def_on_return_in_try() {
|
||||
check(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue