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 fda0301 commit 832a525Copy full SHA for 832a525
compiler/rustc_ast_lowering/src/format.rs
@@ -349,6 +349,10 @@ fn expand_format_args<'hir>(
349
return hir::ExprKind::Call(from_str, args);
350
}
351
352
+ // It shouldn't be possible to have an empty literal here. Encoding an empty literal
353
+ // would result in a single 0 byte, which marks the end of the template byte sequence.
354
+ debug_assert!(!s.is_empty());
355
+
356
// Encode the literal in chunks of up to u16::MAX bytes, split at utf-8 boundaries.
357
while !s.is_empty() {
358
let len = s.floor_char_boundary(usize::from(u16::MAX));
0 commit comments