We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40e16c2 commit dc7f0ebCopy full SHA for dc7f0eb
compiler/rustc_ast_lowering/src/format.rs
@@ -428,7 +428,9 @@ fn expand_format_args<'hir>(
428
bytecode.push(0);
429
430
// Ensure all argument indexes actually fit in 16 bits, as we truncated them to 16 bits before.
431
- assert!(argmap.len() <= u16::MAX as usize);
+ if argmap.len() > u16::MAX as usize {
432
+ ctx.dcx().span_err(macsp, "too many format arguments");
433
+ }
434
435
let arguments = fmt.arguments.all_args();
436
0 commit comments