You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use icu_unicodeset::UnicodeSet;use icu_unicodeset::UnicodeSetBuilder;use std::char;fnmain(){let ranges = vec!['A'..='Z','a'..='z'];letmut builder = UnicodeSetBuilder::new();for range in&ranges {
builder.add_range(range);}let set = builder.build();assert_eq!(set.contains_range(&('c'..='e')),true);}
crashes with:
thread 'main' panicked at 'index out of bounds: the len is 4 but the index is 4', /Users/zbraniecki/projects/icu4x/components/uniset/src/uniset.rs:189:36
full stack:
thread 'main' panicked at 'index out of bounds: the len is 4 but the index is 4', /Users/zbraniecki/projects/icu4x/components/uniset/src/uniset.rs:189:36
stack backtrace:
0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
1: core::fmt::write
2: std::io::Write::write_fmt
3: std::panicking::default_hook::{{closure}}
4: std::panicking::default_hook
5: std::panicking::rust_panic_with_hook
6: rust_begin_unwind
7: core::panicking::panic_fmt
8: core::panicking::panic_bounds_check
9: <usize as core::slice::SliceIndex<[T]>>::index
10: core::slice::<impl core::ops::index::Index<I> for [T]>::index
11: <alloc::vec::Vec<T> as core::ops::index::Index<I>>::index
12: icu_unicodeset::uniset::UnicodeSet::contains_range
13: uniset_test::main
14: std::rt::lang_start::{{closure}}
15: std::rt::lang_start_internal
16: std::rt::lang_start
17: main
The text was updated successfully, but these errors were encountered:
Further outlined in fix #269 , there was an off by one error that I failed to account for in my testing. Thanks for pointing it out! Should be merged tomorrow.
crashes with:
full stack:
The text was updated successfully, but these errors were encountered: