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:
bors 2024-09-30 13:09:54 +00:00
commit ac8509a74b
5 changed files with 71 additions and 27 deletions

View file

@ -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(