jni 0.22.2

Rust bindings to the JNI
warning: unused import: `path::PathBuf`
  --> crates/jni/src/vm/java_vm.rs:21:28
   |
21 | use std::{os::raw::c_void, path::PathBuf};
   |                            ^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

warning: unused import: `Thread`
 --> crates/jni/src/vm/tls_attach_guard.rs:9:14
  |
9 |     thread::{Thread, current},
  |              ^^^^^^

warning: unused import: `log::error`
  --> crates/jni/src/vm/tls_attach_guard.rs:12:5
   |
12 | use log::error;
   |     ^^^^^^^^^^

warning: unused variable: `e`
  --> crates/jni/src/vm/tls_attach_guard.rs:61:20
   |
61 |         if let Err(e) = unsafe { self.detach_impl() } {
   |                    ^ help: if this is intentional, prefix it with an underscore: `_e`
   |
   = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default

warning: missing documentation for a method
   --> crates/jni/src/vm/init_args.rs:358:5
    |
358 |     pub fn inner_ptr(&self) -> *mut c_void {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: the lint level is defined here
   --> crates/jni/src/lib.rs:1:9
    |
  1 | #![warn(missing_docs)]
    |         ^^^^^^^^^^^^

warning: missing documentation for a function
   --> crates/jni/src/vm/java_vm.rs:194:5
    |
194 | /     pub fn JNI_CreateJavaVM(
195 | |         pvm: *mut *mut sys::JavaVM,
196 | |         penv: *mut *mut c_void,
197 | |         args: *mut c_void,
198 | |     ) -> jni::sys::jint;
    | |________________________^

warning: missing documentation for an associated function
   --> crates/jni/src/vm/java_vm.rs:398:5
    |
398 |     pub fn with_linked_jvm(args: InitArgs) -> StartJvmResult<Self> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: `jni` (lib) generated 7 warnings (run `cargo fix --lib -p jni` to apply 4 suggestions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.07s
     Running `/home/rib/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo-miri runner /home/rib/src/jni-rs/jni-git-dev0/target/miri/x86_64-unknown-linux-gnu/debug/examples/miri_hello`

thread 'rustc' (847903) panicked at /rustc/873b4beb0cc726493b94c8ef21f68795c04fbbc1/compiler/rustc_const_eval/src/interpret/memory.rs:229:53:
called `Result::unwrap()` on an `Err` value: InterpErrorInfo(InterpErrorInfoInner { kind: Unsupported(Unsupported("passing an enum or union over FFI: std::result::Result<(), std::boxed::Box<dyn std::error::Error>>")), backtrace: InterpErrorBacktrace { backtrace: None } })
stack backtrace:
   0:     0x7f44cebd449b - <<std[e84040df3bd3b365]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[6c6f0f72ed298c38]::fmt::Display>::fmt
   1:     0x7f44cf2110e0 - core[6c6f0f72ed298c38]::fmt::write
   2:     0x7f44cebeb716 - <std[e84040df3bd3b365]::sys::stdio::unix::Stderr as std[e84040df3bd3b365]::io::Write>::write_fmt
   3:     0x7f44cebaa548 - std[e84040df3bd3b365]::panicking::default_hook::{closure#0}
   4:     0x7f44cebc7903 - std[e84040df3bd3b365]::panicking::default_hook
   5:     0x7f44cdb90f8f - std[e84040df3bd3b365]::panicking::update_hook::<alloc[d9717d1773e7bcdb]::boxed::Box<rustc_driver_impl[1d3373f79f63c38d]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7f44cebc7be2 - std[e84040df3bd3b365]::panicking::panic_with_hook
   7:     0x7f44cebaa608 - std[e84040df3bd3b365]::panicking::panic_handler::{closure#0}
   8:     0x7f44ceba1359 - std[e84040df3bd3b365]::sys::backtrace::__rust_end_short_backtrace::<std[e84040df3bd3b365]::panicking::panic_handler::{closure#0}, !>
   9:     0x7f44cebac06d - __rustc[d6e935dc4dcc4704]::rust_begin_unwind
  10:     0x7f44cb8717ec - core[6c6f0f72ed298c38]::panicking::panic_fmt
  11:     0x7f44cb33e8d2 - core[6c6f0f72ed298c38]::result::unwrap_failed
  12:     0x56263df7b49f - <rustc_const_eval[30dfd147fcfea0c]::interpret::eval_context::InterpCx<miri[ad21fcb0af6d8022]::machine::MiriMachine>>::fn_ptr
  13:     0x56263df0c680 - miri[ad21fcb0af6d8022]::eval::create_ecx::{closure#0}
  14:     0x56263e05de46 - <rustc_const_eval[30dfd147fcfea0c]::interpret::eval_context::InterpCx<miri[ad21fcb0af6d8022]::machine::MiriMachine> as miri[ad21fcb0af6d8022]::concurrency::thread::EvalContextExt>::run_threads
  15:     0x56263dfc5742 - miri[ad21fcb0af6d8022]::eval::eval_entry
  16:     0x56263e10fb99 - <miri[baa462e6748e8caa]::MiriCompilerCalls as rustc_driver_impl[1d3373f79f63c38d]::Callbacks>::after_analysis
  17:     0x7f44d053a68a - <rustc_interface[ffa26b8aee337d6b]::passes::create_and_enter_global_ctxt<core[6c6f0f72ed298c38]::option::Option<rustc_interface[ffa26b8aee337d6b]::queries::Linker>, rustc_driver_impl[1d3373f79f63c38d]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[6c6f0f72ed298c38]::ops::function::FnOnce<(&rustc_session[e077b3088d2cab4d]::session::Session, rustc_middle[11be9ef6dd95cb79]::ty::context::CurrentGcx, alloc[d9717d1773e7bcdb]::sync::Arc<rustc_data_structures[be2354717932db16]::jobserver::Proxy>, &std[e84040df3bd3b365]::sync::once_lock::OnceLock<rustc_middle[11be9ef6dd95cb79]::ty::context::GlobalCtxt>, &rustc_data_structures[be2354717932db16]::sync::worker_local::WorkerLocal<rustc_middle[11be9ef6dd95cb79]::arena::Arena>, &rustc_data_structures[be2354717932db16]::sync::worker_local::WorkerLocal<rustc_hir[e6f1d3e8b67d381c]::Arena>, rustc_driver_impl[1d3373f79f63c38d]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  18:     0x7f44d0447ad0 - rustc_interface[ffa26b8aee337d6b]::interface::run_compiler::<(), rustc_driver_impl[1d3373f79f63c38d]::run_compiler::{closure#0}>::{closure#1}
  19:     0x7f44d04307be - std[e84040df3bd3b365]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[ffa26b8aee337d6b]::util::run_in_thread_with_globals<rustc_interface[ffa26b8aee337d6b]::util::run_in_thread_pool_with_globals<rustc_interface[ffa26b8aee337d6b]::interface::run_compiler<(), rustc_driver_impl[1d3373f79f63c38d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  20:     0x7f44d0430ea0 - <std[e84040df3bd3b365]::thread::lifecycle::spawn_unchecked<rustc_interface[ffa26b8aee337d6b]::util::run_in_thread_with_globals<rustc_interface[ffa26b8aee337d6b]::util::run_in_thread_pool_with_globals<rustc_interface[ffa26b8aee337d6b]::interface::run_compiler<(), rustc_driver_impl[1d3373f79f63c38d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[6c6f0f72ed298c38]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  21:     0x7f44d0431d2c - <std[e84040df3bd3b365]::sys::thread::unix::Thread>::new::thread_start
  22:     0x7f44d1cc598b - <unknown>
  23:     0x7f44d1d49a0c - <unknown>
  24:                0x0 - <unknown>

error: the compiler unexpectedly panicked. This is a bug

note: we would appreciate a bug report: https://github.com/rust-lang/miri/issues/new

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/rib/src/jni-rs/jni-git-dev0/rustc-ice-2026-02-28T17_35_30-847818.txt` to your bug report

note: rustc 1.95.0-nightly (873b4beb0 2026-02-15) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED] -Z miri-native-lib=/usr/lib/jvm/java-21-openjdk/lib/server/libjvm.so -Z miri-backtrace=full

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack

Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:

thread 'rustc' (847903) panicked at src/tools/miri/src/diagnostics.rs:561:5:
assertion failed: !span.is_dummy()
stack backtrace:
   0:     0x7f44cebd449b - <<std[e84040df3bd3b365]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[6c6f0f72ed298c38]::fmt::Display>::fmt
   1:     0x7f44cf2110e0 - core[6c6f0f72ed298c38]::fmt::write
   2:     0x7f44cebeb716 - <std[e84040df3bd3b365]::sys::stdio::unix::Stderr as std[e84040df3bd3b365]::io::Write>::write_fmt
   3:     0x7f44cebaa548 - std[e84040df3bd3b365]::panicking::default_hook::{closure#0}
   4:     0x7f44cebc7903 - std[e84040df3bd3b365]::panicking::default_hook
   5:     0x7f44cdb90f8f - std[e84040df3bd3b365]::panicking::update_hook::<alloc[d9717d1773e7bcdb]::boxed::Box<rustc_driver_impl[1d3373f79f63c38d]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7f44cebc7be2 - std[e84040df3bd3b365]::panicking::panic_with_hook
   7:     0x7f44cebaa63a - std[e84040df3bd3b365]::panicking::panic_handler::{closure#0}
   8:     0x7f44ceba1359 - std[e84040df3bd3b365]::sys::backtrace::__rust_end_short_backtrace::<std[e84040df3bd3b365]::panicking::panic_handler::{closure#0}, !>
   9:     0x7f44cebac06d - __rustc[d6e935dc4dcc4704]::rust_begin_unwind
  10:     0x7f44cb8717ec - core[6c6f0f72ed298c38]::panicking::panic_fmt
  11:     0x7f44cb2495a2 - core[6c6f0f72ed298c38]::panicking::panic
  12:     0x56263dfbdf66 - miri[ad21fcb0af6d8022]::diagnostics::report_msg
  13:     0x56263e04cd5e - <rustc_const_eval[30dfd147fcfea0c]::interpret::eval_context::InterpCx<miri[ad21fcb0af6d8022]::machine::MiriMachine> as miri[ad21fcb0af6d8022]::diagnostics::EvalContextExt>::handle_ice
  14:     0x56263df0ce10 - miri[ad21fcb0af6d8022]::eval::eval_entry::{closure#1}
  15:     0x56263dfc7a71 - miri[ad21fcb0af6d8022]::eval::eval_entry
  16:     0x56263e10fb99 - <miri[baa462e6748e8caa]::MiriCompilerCalls as rustc_driver_impl[1d3373f79f63c38d]::Callbacks>::after_analysis
  17:     0x7f44d053a68a - <rustc_interface[ffa26b8aee337d6b]::passes::create_and_enter_global_ctxt<core[6c6f0f72ed298c38]::option::Option<rustc_interface[ffa26b8aee337d6b]::queries::Linker>, rustc_driver_impl[1d3373f79f63c38d]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[6c6f0f72ed298c38]::ops::function::FnOnce<(&rustc_session[e077b3088d2cab4d]::session::Session, rustc_middle[11be9ef6dd95cb79]::ty::context::CurrentGcx, alloc[d9717d1773e7bcdb]::sync::Arc<rustc_data_structures[be2354717932db16]::jobserver::Proxy>, &std[e84040df3bd3b365]::sync::once_lock::OnceLock<rustc_middle[11be9ef6dd95cb79]::ty::context::GlobalCtxt>, &rustc_data_structures[be2354717932db16]::sync::worker_local::WorkerLocal<rustc_middle[11be9ef6dd95cb79]::arena::Arena>, &rustc_data_structures[be2354717932db16]::sync::worker_local::WorkerLocal<rustc_hir[e6f1d3e8b67d381c]::Arena>, rustc_driver_impl[1d3373f79f63c38d]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  18:     0x7f44d0447ad0 - rustc_interface[ffa26b8aee337d6b]::interface::run_compiler::<(), rustc_driver_impl[1d3373f79f63c38d]::run_compiler::{closure#0}>::{closure#1}
  19:     0x7f44d04307be - std[e84040df3bd3b365]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[ffa26b8aee337d6b]::util::run_in_thread_with_globals<rustc_interface[ffa26b8aee337d6b]::util::run_in_thread_pool_with_globals<rustc_interface[ffa26b8aee337d6b]::interface::run_compiler<(), rustc_driver_impl[1d3373f79f63c38d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  20:     0x7f44d0430ea0 - <std[e84040df3bd3b365]::thread::lifecycle::spawn_unchecked<rustc_interface[ffa26b8aee337d6b]::util::run_in_thread_with_globals<rustc_interface[ffa26b8aee337d6b]::util::run_in_thread_pool_with_globals<rustc_interface[ffa26b8aee337d6b]::interface::run_compiler<(), rustc_driver_impl[1d3373f79f63c38d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[6c6f0f72ed298c38]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  21:     0x7f44d0431d2c - <std[e84040df3bd3b365]::sys::thread::unix::Thread>::new::thread_start
  22:     0x7f44d1cc598b - <unknown>
  23:     0x7f44d1d49a0c - <unknown>
  24:                0x0 - <unknown>

error: the compiler unexpectedly panicked. This is a bug

note: we would appreciate a bug report: https://github.com/rust-lang/miri/issues/new

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/rib/src/jni-rs/jni-git-dev0/rustc-ice-2026-02-28T17_35_30-847818.txt` to your bug report

note: rustc 1.95.0-nightly (873b4beb0 2026-02-15) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED] -Z miri-native-lib=/usr/lib/jvm/java-21-openjdk/lib/server/libjvm.so -Z miri-backtrace=full

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack