-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-iteratorsArea: IteratorsArea: IteratorsC-bugCategory: This is a bug.Category: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
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
Metadata
Metadata
Assignees
Labels
A-iteratorsArea: IteratorsArea: IteratorsC-bugCategory: This is a bug.Category: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.