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 c25b82f commit 27d1cd8Copy full SHA for 27d1cd8
src/libcore/iter/range.rs
@@ -427,6 +427,8 @@ unsafe impl Step for char {
427
res = Step::forward_checked(res, 0x800)?;
428
}
429
if res <= char::MAX as u32 {
430
+ // SAFETY: res is a valid unicode scalar
431
+ // (below 0x110000 and not in 0xD800..0xE000)
432
Some(unsafe { char::from_u32_unchecked(res) })
433
} else {
434
None
@@ -440,6 +442,8 @@ unsafe impl Step for char {
440
442
if start >= 0xE000 && 0xE000 > res {
441
443
res = Step::backward_checked(res, 0x800)?;
444
445
446
447
448
449
0 commit comments