- Build:
cargo build(workspace),cargo build -p <crate>(single crate) - Test all:
cargo test - Single test:
cargo test <test_name>orcargo test -p <crate> <test_name> - Format:
cargo fmt, Lint:cargo clippy
- Edition: Rust 2024,
#![no_std]for core crates (usealloccrate) - Line width: 150 chars (rustfmt.toml)
- Indent: 4 spaces, LF line endings
- Imports: Group
alloc/corefirst, then external crates, thencrate::local imports - Naming: snake_case for functions/files, PascalCase for types/traits
- Error handling: Use
Result<T>(alias forresult::Result<T, JavaError>), never panic in library code - Async: Use
#[async_trait::async_trait]for async trait methods,#[tokio::test]for async tests
jvm/- Core JVM implementation (#![no_std])jvm-bytecode/- JVM class and bytecode implementationrustjava-runtime/- Java standard library implementationsclassfile/- Class file parserjvm-class-proto/- Java class prototypesjvm-types/- Shared JVM metadata typestest-utils/- Shared test utilities
- Keep
rustjava-runtime/tests/classeslimited to Java standard library class and API behavior. - Test JVM and interpreter semantics, including class initialization, bytecode execution, and monitor behavior, with compiled Java fixtures under
test-data/srcand expected output undertest-data, executed bytests/test_class.rs. - Add or extend fixtures consumed by the existing
test_classrunner rather than adding Rust tests that directly invoke JVM APIs. For linkage errors that Java source cannot express directly, compile the caller against one class version and replace the target class in the fixture; keep the source variants and reproducible build instructions alongside it. - Do not place JVM core behavior tests in the
rustjava-runtimestandard library test tree.
- Implement Java compatibility from public specifications, Javadocs, and observable behavior tests. Do not consult or reproduce OpenJDK or other Java runtime implementation source code; keep the implementation independent to avoid licensing and provenance concerns.