Uh oh!
There was an error while loading. Please reload this page.
Improve position named arguments lint underline and formatting names - #99958
Conversation
rust-highfive
commented
Jul 30, 2022
(rust-highfive has picked a reviewer for you, use r? to override) |
PrestonFrom
commented
Jul 30, 2022
@lqd This addresses your comment here: #99660 (comment) Not sure if you want to be the reviewer here or not though? |
compiler-errors
commented
Aug 2, 2022
r? @compiler-errors since i reviewed the other two PRs touching this code |
There was a problem hiding this comment.
Did you mean to drop "only" here?
There was a problem hiding this comment.
With the previous PR, the lint will trigger for every case a named argument is used positionally even if it's used by name elsewhere, so I think "only" is now incorrect. (I missed this in the last change.)
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
For named arguments used as implicit position arguments, underline both
the opening curly brace and either:
* if there is formatting, the next character (which will either be the
closing curl brace or the `:` denoting the start of formatting args)
* if there is no formatting, the entire arg span (important if there is
whitespace like `{ }`)
This should make it more obvious where the named argument should be.
Additionally, in the lint message, emit the formatting argument names
without a dollar sign to avoid potentially confusion.
Fixesrust-lang#99907PrestonFrom
commented
Aug 2, 2022
@compiler-errors Thank you for the review! It looks like #99987 is still in the queue but at the moment I don't think it should have any merge conflicts. |
compiler-errors
commented
Aug 2, 2022
Alright, seems like it didn't conflict. @bors r+ |
bors
commented
Aug 2, 2022
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#99933 (parallelize HTML checking tool) - rust-lang#99958 (Improve position named arguments lint underline and formatting names) - rust-lang#100008 (Update all pre-cloned submodules on startup) - rust-lang#100049 (:arrow_up: rust-analyzer) - rust-lang#100070 (Clarify Cargo.toml comments) - rust-lang#100074 (rustc-docs: Be less specific about the representation of `+bundle`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
For named arguments used as implicit position arguments, underline both
the opening curly brace and either:
closing curl brace or the
:denoting the start of formatting args)whitespace like
{ })This should make it more obvious where the named argument should be.
Additionally, in the lint message, emit the formatting argument names
without a dollar sign to avoid potentially confusion.
Fixes#99907