From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/macros/issue-99261.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/ui/macros/issue-99261.rs (limited to 'tests/ui/macros/issue-99261.rs') diff --git a/tests/ui/macros/issue-99261.rs b/tests/ui/macros/issue-99261.rs new file mode 100644 index 000000000..40d26d08c --- /dev/null +++ b/tests/ui/macros/issue-99261.rs @@ -0,0 +1,17 @@ +// check-pass + +#![deny(named_arguments_used_positionally)] + +fn main() { + let value: f64 = 314.15926; + let digits_before_decimal = 1; + let digits_after_decimal = 2; + let width = digits_before_decimal + 1 + digits_after_decimal; + + println!( + "{value:0>width$.digits_after_decimal$}", + value = value, + width = width, + digits_after_decimal = digits_after_decimal, + ); +} -- cgit v1.2.3