Rollup merge of #134877 - DavisRayM:129966-format-string-help-message, r=estebank
add suggestion for wrongly ordered format parameters Add suggestion for wrongly ordered format parameters like `?#`. Supersedes #131004 Fix #129966
This commit is contained in:
@@ -321,6 +321,13 @@ fn make_format_args(
|
||||
e.sugg_ = Some(errors::InvalidFormatStringSuggestion::RemoveRawIdent { span })
|
||||
}
|
||||
}
|
||||
parse::Suggestion::ReorderFormatParameter(span, replacement) => {
|
||||
let span = fmt_span.from_inner(InnerSpan::new(span.start, span.end));
|
||||
e.sugg_ = Some(errors::InvalidFormatStringSuggestion::ReorderFormatParameter {
|
||||
span,
|
||||
replacement,
|
||||
});
|
||||
}
|
||||
}
|
||||
let guar = ecx.dcx().emit_err(e);
|
||||
return ExpandResult::Ready(Err(guar));
|
||||
|
||||
Reference in New Issue
Block a user