The following code panics in debug mode with the message Bad byte_range: 1..1:
let mut job = egui::text::LayoutJob::default();
job.append("\n", 0.0, egui::TextFormat::default());
job.append("", 0.0, egui::TextFormat::default());
ui.label(job);
The problem is in layout_each_paragraph_individually() with the "Section range overlaps with paragraph range" assert.
This can be fixed by changing the assert from section_range.start < section_range.end to section_range.start <= section_range.end, or by changing the else to else if section_range.start < section_range.end (to avoid doing zero-length slices anyway).