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
Using d128::from_str causes a panic when running in macOS 11.0.1 Big Sur (not on ARM).
Code:
use std::str::FromStr;use decimal::d128;fnmain(){let x = d128::from_str("2");println!("{:?}", x);}
Output:
bash-3.2$ RUST_BACKTRACE=1 cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running `target/debug/cpc`
thread 'main' panicked at 'attempted to leave type `context::Context` uninitialized, which is invalid', /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/mem/mod.rs:658:9
stack backtrace:
0: rust_begin_unwind
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
1: core::panicking::panic_fmt
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/panicking.rs:85
2: core::panicking::panic
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/panicking.rs:50
3: core::mem::uninitialized
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/mem/mod.rs:658
4: decimal::dec128::d128::default_context
at /Users/kasper/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/decimal-2.0.4/src/dec128.rs:482
5: decimal::dec128::CTX::__init
at /Users/kasper/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/decimal-2.0.4/src/dec128.rs:26
6: core::ops::function::FnOnce::call_once
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/ops/function.rs:227
7: std::thread::local::lazy::LazyKeyInner<T>::initialize
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/thread/local.rs:304
8: std::thread::local::fast::Key<T>::try_initialize
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/thread/local.rs:473
9: std::thread::local::fast::Key<T>::get
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/thread/local.rs:456
10: decimal::dec128::CTX::__getit
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/thread/local.rs:183
11: std::thread::local::LocalKey<T>::try_with
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/thread/local.rs:271
12: std::thread::local::LocalKey<T>::with
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/thread/local.rs:248
13: decimal::dec128::d128::with_context
at /Users/kasper/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/decimal-2.0.4/src/dec128.rs:490
14: <decimal::dec128::d128 as core::str::traits::FromStr>::from_str
at /Users/kasper/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/decimal-2.0.4/src/dec128.rs:194
15: cpc::main
at ./src/main.rs:5
16: core::ops::function::FnOnce::call_once
at /Users/kasper/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
The text was updated successfully, but these errors were encountered:
Using
d128::from_str
causes a panic when running in macOS 11.0.1 Big Sur (not on ARM).Code:
Output:
The text was updated successfully, but these errors were encountered: