-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix error span if arg to asm!()
is a macro call
#130917
Conversation
When the template string passed to asm!() is produced by a macro call like concat!() we were producing wrong error spans. Now in the case of a macro call we just use the entire arg to asm!(), macro call and all, as the error span.
r? @chenyukang rustbot has assigned @chenyukang. Use |
asm!()
is a macro call
will this fix also fix #114865 ? |
seems this fix only specific for asm!. |
@bors r+ rollup |
Yeah it's asm only. |
#114865 seems to be the exact same issue but with |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#129087 (Stabilize `option_get_or_insert_default`) - rust-lang#130435 (Move Apple linker args from `rustc_target` to `rustc_codegen_ssa`) - rust-lang#130459 (delete sub build directory "debug" to not delete the change-id file) - rust-lang#130873 (rustc_target: Add powerpc64 atomic-related features) - rust-lang#130916 (Use `&raw` in the compiler) - rust-lang#130917 (Fix error span if arg to `asm!()` is a macro call) - rust-lang#130927 (update outdated comments) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#130917 - gurry:129503-ice-wrong-span-in-macros, r=chenyukang Fix error span if arg to `asm!()` is a macro call Fixes rust-lang#129503 When the argument to `asm!()` is a macro call, e.g. `asm!(concat!("abc", "{} pqr"))`, and there's an error in the resulting template string, we do not take into account the presence of this macro call while computing the error span. This PR fixes that. Now we will use the entire thing between the parenthesis of `asm!()` as the error span in this situation e.g. for `asm!(concat!("abc", "{} pqr"))` the error span will be `concat!("abc", "{} pqr")`.
Fixes #129503
When the argument to
asm!()
is a macro call, e.g.asm!(concat!("abc", "{} pqr"))
, and there's an error in the resulting template string, we do not take into account the presence of this macro call while computing the error span. This PR fixes that. Now we will use the entire thing between the parenthesis ofasm!()
as the error span in this situation e.g. forasm!(concat!("abc", "{} pqr"))
the error span will beconcat!("abc", "{} pqr")
.