-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Diagnostic width span is not added when '0$' is used as width in format strings #99480
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @oli-obk (or someone else) soon. Please see the contribution instructions for more information. |
Is it possible to trigger any rustc error/lint that will show this change? |
I added a test which wouldn't have previously passed if that's what you mean? |
Yea I saw that ^^ I was wondering about a user-visible change. It's not really important, just wondering |
Yes there is! fn main() {
let test = 5;
println!("Hello {test:1$}!");
} Gives
But fn main() {
let test = 5;
println!("Hello {test:0$}!");
} Only gives this
|
cool! Please add such a test to the |
@bors r+ |
@bors rollup |
…askrgr Rollup of 9 pull requests Successful merges: - rust-lang#99212 (introduce `implied_by` in `#[unstable]` attribute) - rust-lang#99352 (Use `typeck_results` to avoid duplicate `ast_ty_to_ty` call) - rust-lang#99355 (better error for bad depth parameter on macro metavar expr) - rust-lang#99480 (Diagnostic width span is not added when '0$' is used as width in format strings) - rust-lang#99488 (compiletest: Allow using revisions with debuginfo tests.) - rust-lang#99489 (rustdoc UI fixes) - rust-lang#99508 (Avoid `Symbol` to `String` conversions) - rust-lang#99510 (adapt assembly/static-relocation-model test for LLVM change) - rust-lang#99516 (Use new tracking issue for proc_macro::tracked_*.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
When the following code is run rustc does not add diagnostic spans for the width argument. Such spans are necessary for a clippy lint that I am currently writing.