Closed
Description
use std::char::decode_utf16;
fn main() {
let x = [0xD834, 0x006d];
let mut d = decode_utf16(x);
d.next();
let (_, u) = d.size_hint();
let c = d.count();
println!("upper bound: {:?}, actual length {}", u, c);
assert!(u.unwrap() >= c);
}
Compiling playground v0.0.1 (/playground)
Finished dev [unoptimized + debuginfo] target(s) in 1.04s
Running `target/debug/playground`
thread 'main' panicked at 'assertion failed: u.unwrap() >= c', src/main.rs:10:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Standard Output
upper bound: Some(0), actual length 1
@rustbot label T-libs, A-iterators