Skip to content

Issue in to #3

@andresmargalef

Description

@andresmargalef

Using commit 5c5b809 and running with this command
RUST_BACKTRACE=1 RUSTFLAGS=-Zsanitizer=address cargo +nightly run -Zbuild-std --target x86_64-unknown-linux-gnu measurements-small.txt
The output is:

thread 'main' panicked at /home/andres/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:362:9:
slice::get_unchecked requires that the range is within the slice
stack backtrace:
   0: rust_begin_unwind
             at /home/andres/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_nounwind_fmt::runtime
             at /home/andres/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panicking.rs:110:18
   2: core::panicking::panic_nounwind_fmt
             at /home/andres/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panicking.rs:122:9
   3: <core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked
             at /home/andres/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:362:9
   4: <core::ops::range::RangeTo<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked
             at /home/andres/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:430:18
   5: core::slice::<impl [T]>::get_unchecked
             at /home/andres/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs:666:20
   6: one_billion_row_challenge::to_key
             at ./src/main.rs:131:35
   7: one_billion_row_challenge::build_perfect_hash::{{closure}}
             at ./src/main.rs:306:19
   8: one_billion_row_challenge::flatten_callback
             at ./src/main.rs:368:5
   9: one_billion_row_challenge::build_perfect_hash::{{closure}}
             at ./src/main.rs:328:9
  10: one_billion_row_challenge::iter_lines
             at ./src/main.rs:215:9
  11: one_billion_row_challenge::build_perfect_hash
             at ./src/main.rs:327:5
  12: one_billion_row_challenge::main
             at ./src/main.rs:400:35
  13: core::ops::function::FnOnce::call_once
             at /home/andres/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread caused non-unwinding panic. aborting.

I think this fail when the name length is < 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions