Rollup merge of #99987 - Alexendoo:parse-format-position-span, r=fee1-dead
Always include a position span in `rustc_parse_format::Argument` Moves the spans from the `Position` enum to always be included in the `Argument` struct. Doesn't make any changes to use it in rustc, but it will be useful for some upcoming Clippy lints
This commit is contained in:
commit
a0991b8ba8
6 changed files with 96 additions and 41 deletions
|
@ -300,7 +300,7 @@ impl<'tcx> OnUnimplementedFormatString {
|
|||
match token {
|
||||
Piece::String(_) => (), // Normal string, no need to check it
|
||||
Piece::NextArgument(a) => match a.position {
|
||||
Position::ArgumentNamed(s, _) => {
|
||||
Position::ArgumentNamed(s) => {
|
||||
match Symbol::intern(s) {
|
||||
// `{Self}` is allowed
|
||||
kw::SelfUpper => (),
|
||||
|
@ -386,7 +386,7 @@ impl<'tcx> OnUnimplementedFormatString {
|
|||
.map(|p| match p {
|
||||
Piece::String(s) => s,
|
||||
Piece::NextArgument(a) => match a.position {
|
||||
Position::ArgumentNamed(s, _) => {
|
||||
Position::ArgumentNamed(s) => {
|
||||
let s = Symbol::intern(s);
|
||||
match generic_map.get(&s) {
|
||||
Some(val) => val,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue