diff options
| author | miam-miam100 <49870539+miam-miam100@users.noreply.github.com> | 2022-07-19 22:25:26 +0100 |
|---|---|---|
| committer | miam-miam100 <49870539+miam-miam100@users.noreply.github.com> | 2022-07-20 13:39:56 +0100 |
| commit | 62187b12c202c1ada2569211da090d16950c3640 (patch) | |
| tree | 324e1cea27ed92d2aa2268e6024adcf3640922a2 /compiler/rustc_parse_format/src/tests.rs | |
| parent | 29c5a028b0c92aa5da6a8eb6d6585a389fcf1035 (diff) | |
| download | rust-62187b12c202c1ada2569211da090d16950c3640.tar.gz rust-62187b12c202c1ada2569211da090d16950c3640.zip | |
Add diagnostic width span when '0$' is used as width.
Diffstat (limited to 'compiler/rustc_parse_format/src/tests.rs')
| -rw-r--r-- | compiler/rustc_parse_format/src/tests.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/compiler/rustc_parse_format/src/tests.rs b/compiler/rustc_parse_format/src/tests.rs index c9667922ee7..9c305b4996a 100644 --- a/compiler/rustc_parse_format/src/tests.rs +++ b/compiler/rustc_parse_format/src/tests.rs @@ -179,6 +179,23 @@ fn format_counts() { })], ); same( + "{1:0$.10x}", + &[NextArgument(Argument { + position: ArgumentIs(1), + format: FormatSpec { + fill: None, + align: AlignUnknown, + flags: 0, + precision: CountIs(10), + width: CountIsParam(0), + precision_span: None, + width_span: Some(InnerSpan::new(4, 6)), + ty: "x", + ty_span: None, + }, + })], + ); + same( "{:.*x}", &[NextArgument(Argument { position: ArgumentImplicitlyIs(1), |
