repo: zvm
commit: d49ac7a799bacb1a1870d8f75c19c35453fda37b, run: 298
status: error in 30.325s
description: callback error: stack traceback:
[C]: in ?
[C]: in field 'size'
[string "goodfile"]:24: in main chunk
deployed: false
artifacts
Tue, 18 Jul 2023 05:34:59 +0000
step:
git clone log (stdout)
Tue, 18 Jul 2023 05:34:59 +0000
step:
git clone log (stderr)
Cloning into 'tmpdir'...
warning: redirecting to https://github.com/iximeow/zvm.git/
Tue, 18 Jul 2023 05:35:00 +0000
step:
git checkout log (stdout)
Tue, 18 Jul 2023 05:35:00 +0000
step:
git checkout log (stderr)
Note: switching to 'd49ac7a799bacb1a1870d8f75c19c35453fda37b'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at d49ac7a out of date build host?
Tue, 18 Jul 2023 05:35:00 +0000
step:
cargo build -p zvm log (stdout)
Tue, 18 Jul 2023 05:35:00 +0000
step:
cargo build -p zvm log (stderr)
Updating crates.io index
Downloading crates ...
Downloaded cranelift-isle v0.86.1
Downloaded slice-group-by v0.3.0
Downloaded fxhash v0.2.1
Downloaded smallvec v1.9.0
Downloaded quote v1.0.20
Downloaded cranelift-bforest v0.86.1
Downloaded serde v1.0.140
Downloaded cranelift-entity v0.86.1
Downloaded target-lexicon v0.12.4
Downloaded syn v1.0.98
Downloaded cranelift-codegen-meta v0.86.1
Downloaded cranelift-codegen v0.86.1
Downloaded libc v0.2.126
Downloaded gimli v0.26.2
Downloaded unicode-ident v1.0.2
Downloaded byteorder v1.3.2
Downloaded lock_api v0.4.7
Downloaded proc-macro2 v1.0.42
Downloaded indexmap v1.9.1
Downloaded serde_derive v1.0.140
Downloaded cranelift-frontend v0.86.1
Downloaded cranelift-codegen-shared v0.86.1
Downloaded regalloc2 v0.3.1
Downloaded yaxpeax-x86 v1.1.4
Compiling autocfg v1.1.0
Compiling cfg-if v1.0.0
Compiling log v0.4.17
Compiling libc v0.2.126
Compiling smallvec v1.9.0
Compiling proc-macro2 v1.0.42
Compiling cranelift-isle v0.86.1
Compiling byteorder v1.3.2
Compiling quote v1.0.20
Compiling parking_lot_core v0.8.5
Compiling unicode-ident v1.0.2
Compiling cranelift-codegen-shared v0.86.1
Compiling scopeguard v1.1.0
Compiling syn v1.0.98
Compiling serde v1.0.140
Compiling target-lexicon v0.12.4
Compiling hashbrown v0.12.3
Compiling serde_derive v1.0.140
Compiling bitflags v1.3.2
Compiling slice-group-by v0.3.0
Compiling lazy_static v1.4.0
Compiling cranelift-entity v0.86.1
Compiling yaxpeax-x86 v1.1.4
Compiling instant v0.1.12
Compiling cranelift-codegen-meta v0.86.1
Compiling cranelift-bforest v0.86.1
Compiling lock_api v0.4.7
Compiling indexmap v1.9.1
Compiling num-traits v0.2.15
Compiling fxhash v0.2.1
Compiling regalloc2 v0.3.1
Compiling mio v0.7.14
Compiling signal-hook-registry v1.4.0
Compiling gimli v0.26.2
Compiling parking_lot v0.11.2
Compiling signal-hook v0.1.17
Compiling crossterm v0.19.0
Compiling cranelift-codegen v0.86.1
Compiling yaxpeax-arch v0.2.7
Compiling cranelift-frontend v0.86.1
Compiling zvm v0.1.0 (/home/iximeow/nvme0/ci.butactuallyin.space/tmpdir)
warning: unused import: `std::cell::RefCell`
--> src/virtual_machine/jvm/synthetic.rs:1:5
|
1 | use std::cell::RefCell;
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `attribute::Attribute`
--> src/virtual_machine/jvm/synthetic.rs:7:38
|
7 | use crate::class_file::unvalidated::{attribute::Attribute, AttributeInfo, MethodAccessFlags, MethodInfo};
| ^^^^^^^^^^^^^^^^^^^^
warning: unused import: `ValueRef`
--> src/virtual_machine/jvm/synthetic.rs:9:77
|
9 | use crate::virtual_machine::{ClassFile, ClassFileRef, UnvalidatedClassFile, ValueRef};
| ^^^^^^^^
warning: unused import: `NativeObject`
--> src/virtual_machine/jvm/synthetic.rs:10:73
|
10 | use crate::virtual_machine::{MethodBody, JvmArray, JvmObject, JvmValue, NativeObject};
| ^^^^^^^^^^^^
warning: unused import: `std::collections::hash_map::Entry`
--> src/virtual_machine.rs:3575:17
|
3575 | use std::collections::hash_map::Entry;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `std::rc::Rc`
--> src/compiler/mod.rs:2:5
|
2 | use std::rc::Rc;
| ^^^^^^^^^^^
warning: unused import: `SimpleJvmValue`
--> src/compiler/mod.rs:9:13
|
9 | use crate::{SimpleJvmValue, VirtualMachine, VMState};
| ^^^^^^^^^^^^^^
warning: unused import: `std::cell::RefCell`
--> src/compiler/mod.rs:1113:5
|
1113 | use std::cell::RefCell;
| ^^^^^^^^^^^^^^^^^^
warning: unused import: `std::borrow::Borrow`
--> src/compiler/mod.rs:1151:5
|
1151 | use std::borrow::Borrow;
| ^^^^^^^^^^^^^^^^^^^
warning: unreachable expression
--> src/virtual_machine/jvm/synthetic.rs:1154:9
|
1153 | let data: &[u8] = panic!("get string somehow");
| ---------------------------- any code following this expression is unreachable
1154 | / match &data[..] {
1155 | | b"file.encoding" => {
1156 | | ValueImpl::string(vm, "UTF-8")
1157 | | }
... |
1162 | | }
1163 | | }
| |_________^ unreachable expression
|
= note: `#[warn(unreachable_code)]` on by default
warning: unreachable statement
--> src/virtual_machine/jvm/synthetic.rs:1168:5
|
1165 | panic!("invalid argument for getProperty {:?}", argument);
| --------------------------------------------------------- any code following this expression is unreachable
...
1168 | state.current_frame_mut().operand_stack.push(property);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
warning: unreachable statement
--> src/virtual_machine/jvm/synthetic.rs:1202:9
|
1199 | panic!("todo: turn class name array into a real string");
| -------------------------------------------------------- any code following this expression is unreachable
...
1202 | / state.current_frame_mut()
1203 | | .operand_stack
1204 | | .push(ValueImpl::array_with_data(
1205 | | vm.resolve_class(class_name_string).expect("TODO: need to fish out the right string from `cls`."),
1206 | | elems.into_boxed_slice(),
1207 | | ));
| |_______________^ unreachable statement
warning: unreachable call
--> src/virtual_machine.rs:2765:61
|
2765 | let layout_id = ZVM.as_ref().unwrap().layouts().get_layout_id(panic!("&class_file.this_name")).expect("TODO: class exists");
| ^^^^^^^^^^^^^ ------------------------------- any code following this expression is unreachable
| |
| unreachable call
warning: unreachable expression
--> src/virtual_machine.rs:2950:9
|
2950 | / Self {
2951 | | cls: class_file,
2952 | | data: panic!("todo: do something with argument")
| | ------------------------------------------ any code following this expression is unreachable
2953 | | }
| |_________^ unreachable expression
warning: unused variable: `bytecode`
--> src/class_file/unvalidated/class.rs:180:9
|
180 | bytecode: Option>,
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_bytecode`
|
= note: `#[warn(unused_variables)]` on by default
warning: variable does not need to be mutable
--> src/class_file/unvalidated/class.rs:183:13
|
183 | let mut attributes = Vec::new();
| ----^^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: variable does not need to be mutable
--> src/class_file/unvalidated/class.rs:209:9
|
209 | mut self,
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:167:20
|
167 | pub fn extends(mut self, name: &str) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:175:24
|
175 | pub fn with_method(mut self, name: &str, sig: &str, native: Option>) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:178:13
|
178 | let mut bytecode_methods = self.bytecode_methods;
| ----^^^^^^^^^^^^^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:224:23
|
224 | pub fn with_field(mut self, name: &str, sig: &str) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:243:13
|
243 | let mut cls = ClassFile::validate(&self.cls).unwrap();
| ----^^^
| |
| help: remove this `mut`
warning: unused variable: `obj`
--> src/virtual_machine/jvm/synthetic.rs:427:24
|
427 | } else if let Some(obj) = argument.as_object() {
| ^^^ help: if this is intentional, prefix it with an underscore: `_obj`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:595:71
|
595 | fn object_equals(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `property`
--> src/virtual_machine/jvm/synthetic.rs:1152:9
|
1152 | let property = if argument.as_type("java/lang/String").is_some() {
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_property`
warning: unused variable: `data`
--> src/virtual_machine/jvm/synthetic.rs:1153:13
|
1153 | let data: &[u8] = panic!("get string somehow");
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:1145:77
|
1145 | fn system_get_property(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `class_name_string`
--> src/virtual_machine/jvm/synthetic.rs:1194:13
|
1194 | let class_name_string = {
| ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_class_name_string`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:1172:72
|
1172 | fn array_newarray(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `frame`
--> src/virtual_machine.rs:365:13
|
365 | let frame = self.current_frame();
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_frame`
warning: unused variable: `layout_id`
--> src/virtual_machine.rs:2765:17
|
2765 | let layout_id = ZVM.as_ref().unwrap().layouts().get_layout_id(panic!("&class_file.this_name")).expect("TODO: class exists");
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_layout_id`
warning: unused variable: `classfile_ptr`
--> src/virtual_machine.rs:2770:17
|
2770 | let classfile_ptr = Arc::into_raw(class_file);
| ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_classfile_ptr`
warning: unused variable: `class_file`
--> src/virtual_machine.rs:2897:18
|
2897 | fn new_array(class_file: Arc, data: Box<[NativeJvmValue]>) -> Self {
| ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_class_file`
warning: unused variable: `data`
--> src/virtual_machine.rs:2897:46
|
2897 | fn new_array(class_file: Arc, data: Box<[NativeJvmValue]>) -> Self {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `idx`
--> src/virtual_machine.rs:2931:24
|
2931 | fn get_elem(&self, idx: usize) -> Option<&SimpleJvmValue> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_idx`
warning: unused variable: `idx`
--> src/virtual_machine.rs:2934:28
|
2934 | fn get_elem_mut(&self, idx: usize) -> Option<&mut SimpleJvmValue> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_idx`
warning: unused variable: `data`
--> src/virtual_machine.rs:2949:46
|
2949 | fn new_array(class_file: Arc, data: Box<[SimpleJvmValue]>) -> Self {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `v`
--> src/virtual_machine.rs:3104:14
|
3104 | fn float(v: f32) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_v`
warning: unused variable: `v`
--> src/virtual_machine.rs:3108:15
|
3108 | fn double(v: f64) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_v`
warning: unused variable: `s`
--> src/virtual_machine.rs:3112:13
|
3112 | fn null(s: String) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_s`
warning: variable does not need to be mutable
--> src/virtual_machine.rs:3272:13
|
3272 | let mut obj = Self::ObjectTy::new_inst(class_file);
| ----^^^
| |
| help: remove this `mut`
warning: unused variable: `managed_alloc_name`
--> src/compiler/mod.rs:467:17
|
467 | let managed_alloc_name = ExternalName::User { namespace: 0, index: 0 };
| ^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_managed_alloc_name`
warning: unused variable: `other`
--> src/compiler/mod.rs:567:29
|
567 | ... other => { return Err(ir::CompileError::InvalidSignature("managed alloc returned multiple values?")); }
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`
warning: unused variable: `value`
--> src/compiler/mod.rs:571:48
|
571 | ir::Instruction::Dealloc { value } => {
| ^^^^^ help: try ignoring the field: `value: _`
warning: unused variable: `name`
--> src/compiler/mod.rs:574:59
|
574 | ir::Instruction::CallImport { result, name, sig, args } => {
| ^^^^ help: try ignoring the field: `name: _`
warning: unused variable: `ret`
--> src/compiler/mod.rs:576:51
|
576 | let returns = if let Some(ret) = sig.1 {
| ^^^ help: if this is intentional, prefix it with an underscore: `_ret`
warning: unused variable: `other`
--> src/compiler/mod.rs:616:29
|
616 | ... other => { return Err(ir::CompileError::InvalidSignature("call returned multiple values?")); }
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`
warning: unused variable: `i`
--> src/compiler/mod.rs:1421:10
|
1421 | for (i, cls) in extra_classes.iter().enumerate() {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
warning: field `attributes` is never read
--> src/class_file/unvalidated/field.rs:46:16
|
42 | pub struct FieldInfo {
| --------- field in this struct
...
46 | pub(crate) attributes: Vec,
| ^^^^^^^^^^
|
= note: `FieldInfo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
warning: field `max_stack` is never read
--> src/class_file/validated/method.rs:25:16
|
24 | pub struct MethodBody {
| ---------- field in this struct
25 | pub(crate) max_stack: u16,
| ^^^^^^^^^
|
= note: `MethodBody` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: field `layout_id` is never read
--> src/virtual_machine.rs:2729:5
|
2728 | struct ZvmObjectVTable {
| --------------- field in this struct
2729 | layout_id: crate::compiler::ir::LayoutId,
| ^^^^^^^^^
warning: field `data` is never read
--> src/virtual_machine.rs:2849:5
|
2845 | pub struct NativeJvmArrayData {
| ------------------ field in this struct
...
2849 | data: [NativeJvmValue; 1]
| ^^^^
warning: associated function `of` is never used
--> src/virtual_machine.rs:3341:12
|
3340 | impl ValueRef {
| --------------------------------------------- associated function in this implementation
3341 | pub fn of(reference: &ValueImpl) -> Self {
| ^^
warning: methods `has_instance_field`, `get_instance_field`, and `put_instance_field` are never used
--> src/virtual_machine.rs:3455:8
|
3442 | impl VirtualMachine {
| --------------------------------------------------- methods in this implementation
...
3455 | fn has_instance_field(
| ^^^^^^^^^^^^^^^^^^
...
3487 | fn get_instance_field(
| ^^^^^^^^^^^^^^^^^^
...
3503 | fn put_instance_field(
| ^^^^^^^^^^^^^^^^^^
warning: fields `bytes` and `len` are never read
--> src/compiler/mod.rs:313:5
|
312 | pub struct FunctionEmitter {
| --------------- fields in this struct
313 | bytes: *mut u8,
| ^^^^^
314 | len: usize,
| ^^^
warning: methods `data_mut`, `data`, `link`, and `finalize` are never used
--> src/compiler/mod.rs:318:8
|
317 | impl FunctionEmitter {
| -------------------- methods in this implementation
318 | fn data_mut(&mut self) -> &mut [u8] {
| ^^^^^^^^
...
323 | fn data(&self) -> &[u8] {
| ^^^^
...
328 | fn link(&mut self, relocs: &[cranelift_codegen::MachReloc], rt_info: &dyn RuntimeInfo) -> Result<(), crate::compiler::ir::CompileErro...
| ^^^^
...
346 | fn finalize(self) -> (*mut u8, usize) {
| ^^^^^^^^
warning: struct `CompiledMethod` is never constructed
--> src/compiler/mod.rs:360:12
|
360 | pub struct CompiledMethod {
| ^^^^^^^^^^^^^^
warning: methods `data_mut` and `data` are never used
--> src/compiler/mod.rs:369:8
|
368 | impl CompiledMethod {
| ------------------- methods in this implementation
369 | fn data_mut(&mut self) -> &mut [u8] {
| ^^^^^^^^
...
374 | fn data(&self) -> &[u8] {
| ^^^^
warning: fields `arguments`, `locals`, `blocks`, and `returns` are never read
--> src/compiler/mod.rs:383:5
|
382 | pub struct ZvmMethod {
| --------- fields in this struct
383 | arguments: Vec,
| ^^^^^^^^^
384 | locals: Vec,
| ^^^^^^
385 | blocks: Vec,
| ^^^^^^
386 | returns: Option,
| ^^^^^^^
|
= note: `ZvmMethod` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: method `compile` is never used
--> src/compiler/mod.rs:416:12
|
415 | impl ZvmMethod {
| -------------- method in this implementation
416 | pub fn compile(&self, rt_info: &dyn RuntimeInfo) -> Result {
| ^^^^^^^
warning: fields `blocks` and `layouts` are never read
--> src/compiler/mod.rs:722:5
|
720 | struct TranslatorState<'layouts> {
| --------------- fields in this struct
721 | current_block: ir::Block,
722 | blocks: Vec,
| ^^^^^^
...
728 | layouts: &'layouts ir::LayoutsInfo,
| ^^^^^^^
|
= note: `TranslatorState` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: function `desc_to_ir_valuety` is never used
--> src/compiler/mod.rs:863:4
|
863 | fn desc_to_ir_valuety(desc: &str) -> ir::ValueType {
| ^^^^^^^^^^^^^^^^^^
warning: function `bytecode2ir` is never used
--> src/compiler/mod.rs:871:8
|
871 | pub fn bytecode2ir(rt_info: &mut dyn RuntimeInfo, method: &MethodBody, sig: (Vec, Option)) -> Result src/compiler/mod.rs:1122:5
|
1119 | pub struct StructLayout {
| ------------ field in this struct
...
1122 | layout_id: u64,
| ^^^^^^^^^
warning: associated function `init` is never used
--> src/compiler/mod.rs:1154:12
|
1153 | impl ZvmRuntime {
| --------------- associated function in this implementation
1154 | pub fn init() -> Self {
| ^^^^
warning: function `jit` is never used
--> src/compiler/mod.rs:1398:4
|
1398 | fn jit(args: &[i64], instructions: Vec, signature: &'static str, extra_classes: Vec>, rt_info: &mu...
| ^^^
warning: function `jitcall` is never used
--> src/compiler/mod.rs:1471:4
|
1471 | fn jitcall(args: &[i64], code: fn(i64, i64, i64, i64, i64, i64) -> i64) -> i64 {
| ^^^^^^^
warning: variants `Argument`, `Local`, and `Const` are never constructed
--> src/compiler/mod.rs:17:9
|
16 | pub enum Value {
| ----- variants in this enum
17 | Argument(Argument),
| ^^^^^^^^
18 | Local(Local),
| ^^^^^
19 | Const(Const),
| ^^^^^
|
= note: `Value` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: multiple variants are never constructed
--> src/compiler/mod.rs:34:9
|
33 | pub enum Const {
| ----- variants in this enum
34 | Byte(i8),
| ^^^^
35 | Short(i16),
| ^^^^^
36 | Int(i32),
| ^^^
37 | Long(i64),
| ^^^^
38 | Float(f32),
| ^^^^^
39 | Double(f64),
| ^^^^^^
40 | Null,
| ^^^^
|
= note: `Const` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: variants `Byte` and `Short` are never constructed
--> src/compiler/mod.rs:45:9
|
44 | pub enum ValueType {
| --------- variants in this enum
45 | Byte,
| ^^^^
46 | Short,
| ^^^^^
|
= note: `ValueType` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
warning: variant `Const` is never constructed
--> src/compiler/mod.rs:88:9
|
85 | pub enum ValuePool {
| --------- variant in this enum
...
88 | Const,
| ^^^^^
|
= note: `ValuePool` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
warning: associated function `constant` is never used
--> src/compiler/mod.rs:112:16
|
97 | impl ValueRef {
| ------------- associated function in this implementation
...
112 | pub fn constant(id: usize) -> Self {
| ^^^^^^^^
warning: struct `FunctionRef` is never constructed
--> src/compiler/mod.rs:120:12
|
120 | struct FunctionRef {
| ^^^^^^^^^^^
warning: multiple variants are never constructed
--> src/compiler/mod.rs:127:9
|
125 | pub enum Instruction {
| ----------- variants in this enum
126 | LoadArg { result: ValueRef, source: ValueRef, id: usize },
127 | ConstInt { result: ValueRef, value: i32 },
| ^^^^^^^^
128 | ConstLong { result: ValueRef, value: i64 },
| ^^^^^^^^^
129 | IntAdd { result: ValueRef, left: ValueRef, right: ValueRef },
| ^^^^^^
130 | IntXor { result: ValueRef, left: ValueRef, right: ValueRef },
| ^^^^^^
131 | AReturn { retval: ValueRef },
| ^^^^^^^
132 | IReturn { retval: ValueRef },
| ^^^^^^^
133 | TypeAdjust { value: ValueRef, current_ty: ValueType, result: ValueRef, new_ty: ValueType },
| ^^^^^^^^^^
134 | GetField { result: ValueRef, object: ValueRef, field_desc: LayoutFieldRef },
| ^^^^^^^^
135 | SetField { target: ValueRef, value: ValueRef, field_desc: LayoutFieldRef },
| ^^^^^^^^
136 | Alloc { result: ValueRef, layout_id: LayoutId },
| ^^^^^
137 | Dealloc { value: ValueRef },
| ^^^^^^^
138 | CallImport { result: Option, name: String, sig: (Vec, Option), args: Vec },
| ^^^^^^^^^^
139 | Return,
| ^^^^^^
|
= note: `Instruction` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: method `instructions` is never used
--> src/compiler/mod.rs:158:16
|
147 | impl Block {
| ---------- method in this implementation
...
158 | pub fn instructions(&self) -> &[Instruction] {
| ^^^^^^^^^^^^
warning: method `as_usize` is never used
--> src/compiler/mod.rs:167:16
|
166 | impl LayoutId {
| ------------- method in this implementation
167 | pub fn as_usize(&self) -> usize {
| ^^^^^^^^
warning: associated items `new` and `add_field` are never used
--> src/compiler/mod.rs:181:16
|
180 | impl Layout {
| ----------- associated items in this implementation
181 | pub fn new() -> Self {
| ^^^
...
187 | pub fn add_field(&mut self, field_layout: LayoutFieldRef) {
| ^^^^^^^^^
warning: constant `OBJ_HEADER_ZVM_LAYOUT_ID` is never used
--> src/compiler/mod.rs:222:22
|
222 | pub(crate) const OBJ_HEADER_ZVM_LAYOUT_ID: LayoutFieldRef = LayoutFieldRef {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: constant `OBJ_HEADER_CLASSFILE_REF` is never used
--> src/compiler/mod.rs:228:22
|
228 | pub(crate) const OBJ_HEADER_CLASSFILE_REF: LayoutFieldRef = LayoutFieldRef {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: associated function `new` is never used
--> src/compiler/mod.rs:241:16
|
240 | impl LayoutsInfo {
| ---------------- associated function in this implementation
241 | pub fn new() -> Self {
| ^^^
warning: variants `InvalidLoad`, `InvalidSignature`, and `InvalidTypeAdjust` are never constructed
--> src/compiler/mod.rs:285:9
|
284 | pub enum CompileError {
| ------------ variants in this enum
285 | InvalidLoad(&'static str),
| ^^^^^^^^^^^
286 | InvalidSignature(&'static str),
| ^^^^^^^^^^^^^^^^
287 | InvalidTypeAdjust(ValueRef, ValueType, ValueRef, ValueType),
| ^^^^^^^^^^^^^^^^^
|
= note: `CompileError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: variant `UnsupportedInstruction` is never constructed
--> src/compiler/mod.rs:294:9
|
293 | pub enum TranslationError {
| ---------------- variant in this enum
294 | UnsupportedInstruction(crate::class_file::validated::Instruction),
| ^^^^^^^^^^^^^^^^^^^^^^
warning: `extern` fn uses type `LayoutId`, which is not FFI-safe
--> src/virtual_machine.rs:2705:43
|
2705 | extern "C" fn zvm_layout_id(&self) -> crate::compiler::ir::LayoutId {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
note: the type is defined here
--> src/compiler/mod.rs:164:5
|
164 | pub struct LayoutId(pub usize);
| ^^^^^^^^^^^^^^^^^^^
= note: `#[warn(improper_ctypes_definitions)]` on by default
warning: `extern` fn uses type `Arc`, which is not FFI-safe
--> src/virtual_machine.rs:2714:40
|
2714 | extern "C" fn zvm_vtable(&self) -> Arc {
| ^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
warning: unused `std::result::Result` that must be used
--> src/compiler/mod.rs:1407:5
|
1407 | / rt_info.declare_layout({
1408 | | let mut layout = ir::Layout::new();
1409 | | layout.add_field(ir::LayoutFieldRef {
1410 | | offset: 0,
... |
1419 | | layout
1420 | | }, "java/lang/Integer".to_string());
| |_______________________________________^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
1407 | let _ = rt_info.declare_layout({
| +++++++
warning: unused `std::result::Result` that must be used
--> src/compiler/mod.rs:1422:9
|
1422 | / rt_info.declare_layout({
1423 | | let mut layout = ir::Layout::new();
1424 | | let mut offset = 0;
1425 | | for f in cls.fields.iter() {
... |
1433 | | layout
1434 | | }, cls.this_class.to_string());
| |______________________________________^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
1422 | let _ = rt_info.declare_layout({
| +++++++
warning: `zvm` (lib) generated 86 warnings (run `cargo fix --lib -p zvm` to apply 43 suggestions)
Finished dev [unoptimized + debuginfo] target(s) in 10.22s
Tue, 18 Jul 2023 05:35:11 +0000
step:
cargo build -p zvm-stdlib log (stdout)
Tue, 18 Jul 2023 05:35:11 +0000
step:
cargo build -p zvm-stdlib log (stderr)
warning: unused import: `std::cell::RefCell`
--> src/virtual_machine/jvm/synthetic.rs:1:5
|
1 | use std::cell::RefCell;
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `attribute::Attribute`
--> src/virtual_machine/jvm/synthetic.rs:7:38
|
7 | use crate::class_file::unvalidated::{attribute::Attribute, AttributeInfo, MethodAccessFlags, MethodInfo};
| ^^^^^^^^^^^^^^^^^^^^
warning: unused import: `ValueRef`
--> src/virtual_machine/jvm/synthetic.rs:9:77
|
9 | use crate::virtual_machine::{ClassFile, ClassFileRef, UnvalidatedClassFile, ValueRef};
| ^^^^^^^^
warning: unused import: `NativeObject`
--> src/virtual_machine/jvm/synthetic.rs:10:73
|
10 | use crate::virtual_machine::{MethodBody, JvmArray, JvmObject, JvmValue, NativeObject};
| ^^^^^^^^^^^^
warning: unused import: `std::collections::hash_map::Entry`
--> src/virtual_machine.rs:3575:17
|
3575 | use std::collections::hash_map::Entry;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `std::rc::Rc`
--> src/compiler/mod.rs:2:5
|
2 | use std::rc::Rc;
| ^^^^^^^^^^^
warning: unused import: `SimpleJvmValue`
--> src/compiler/mod.rs:9:13
|
9 | use crate::{SimpleJvmValue, VirtualMachine, VMState};
| ^^^^^^^^^^^^^^
warning: unused import: `std::cell::RefCell`
--> src/compiler/mod.rs:1113:5
|
1113 | use std::cell::RefCell;
| ^^^^^^^^^^^^^^^^^^
warning: unused import: `std::borrow::Borrow`
--> src/compiler/mod.rs:1151:5
|
1151 | use std::borrow::Borrow;
| ^^^^^^^^^^^^^^^^^^^
warning: unreachable expression
--> src/virtual_machine/jvm/synthetic.rs:1154:9
|
1153 | let data: &[u8] = panic!("get string somehow");
| ---------------------------- any code following this expression is unreachable
1154 | / match &data[..] {
1155 | | b"file.encoding" => {
1156 | | ValueImpl::string(vm, "UTF-8")
1157 | | }
... |
1162 | | }
1163 | | }
| |_________^ unreachable expression
|
= note: `#[warn(unreachable_code)]` on by default
warning: unreachable statement
--> src/virtual_machine/jvm/synthetic.rs:1168:5
|
1165 | panic!("invalid argument for getProperty {:?}", argument);
| --------------------------------------------------------- any code following this expression is unreachable
...
1168 | state.current_frame_mut().operand_stack.push(property);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
warning: unreachable statement
--> src/virtual_machine/jvm/synthetic.rs:1202:9
|
1199 | panic!("todo: turn class name array into a real string");
| -------------------------------------------------------- any code following this expression is unreachable
...
1202 | / state.current_frame_mut()
1203 | | .operand_stack
1204 | | .push(ValueImpl::array_with_data(
1205 | | vm.resolve_class(class_name_string).expect("TODO: need to fish out the right string from `cls`."),
1206 | | elems.into_boxed_slice(),
1207 | | ));
| |_______________^ unreachable statement
warning: unreachable call
--> src/virtual_machine.rs:2765:61
|
2765 | let layout_id = ZVM.as_ref().unwrap().layouts().get_layout_id(panic!("&class_file.this_name")).expect("TODO: class exists");
| ^^^^^^^^^^^^^ ------------------------------- any code following this expression is unreachable
| |
| unreachable call
warning: unreachable expression
--> src/virtual_machine.rs:2950:9
|
2950 | / Self {
2951 | | cls: class_file,
2952 | | data: panic!("todo: do something with argument")
| | ------------------------------------------ any code following this expression is unreachable
2953 | | }
| |_________^ unreachable expression
warning: unused variable: `bytecode`
--> src/class_file/unvalidated/class.rs:180:9
|
180 | bytecode: Option>,
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_bytecode`
|
= note: `#[warn(unused_variables)]` on by default
warning: variable does not need to be mutable
--> src/class_file/unvalidated/class.rs:183:13
|
183 | let mut attributes = Vec::new();
| ----^^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: variable does not need to be mutable
--> src/class_file/unvalidated/class.rs:209:9
|
209 | mut self,
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:167:20
|
167 | pub fn extends(mut self, name: &str) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:175:24
|
175 | pub fn with_method(mut self, name: &str, sig: &str, native: Option>) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:178:13
|
178 | let mut bytecode_methods = self.bytecode_methods;
| ----^^^^^^^^^^^^^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:224:23
|
224 | pub fn with_field(mut self, name: &str, sig: &str) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:243:13
|
243 | let mut cls = ClassFile::validate(&self.cls).unwrap();
| ----^^^
| |
| help: remove this `mut`
warning: unused variable: `obj`
--> src/virtual_machine/jvm/synthetic.rs:427:24
|
427 | } else if let Some(obj) = argument.as_object() {
| ^^^ help: if this is intentional, prefix it with an underscore: `_obj`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:595:71
|
595 | fn object_equals(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `property`
--> src/virtual_machine/jvm/synthetic.rs:1152:9
|
1152 | let property = if argument.as_type("java/lang/String").is_some() {
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_property`
warning: unused variable: `data`
--> src/virtual_machine/jvm/synthetic.rs:1153:13
|
1153 | let data: &[u8] = panic!("get string somehow");
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:1145:77
|
1145 | fn system_get_property(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `class_name_string`
--> src/virtual_machine/jvm/synthetic.rs:1194:13
|
1194 | let class_name_string = {
| ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_class_name_string`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:1172:72
|
1172 | fn array_newarray(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `frame`
--> src/virtual_machine.rs:365:13
|
365 | let frame = self.current_frame();
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_frame`
warning: unused variable: `layout_id`
--> src/virtual_machine.rs:2765:17
|
2765 | let layout_id = ZVM.as_ref().unwrap().layouts().get_layout_id(panic!("&class_file.this_name")).expect("TODO: class exists");
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_layout_id`
warning: unused variable: `classfile_ptr`
--> src/virtual_machine.rs:2770:17
|
2770 | let classfile_ptr = Arc::into_raw(class_file);
| ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_classfile_ptr`
warning: unused variable: `class_file`
--> src/virtual_machine.rs:2897:18
|
2897 | fn new_array(class_file: Arc, data: Box<[NativeJvmValue]>) -> Self {
| ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_class_file`
warning: unused variable: `data`
--> src/virtual_machine.rs:2897:46
|
2897 | fn new_array(class_file: Arc, data: Box<[NativeJvmValue]>) -> Self {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `idx`
--> src/virtual_machine.rs:2931:24
|
2931 | fn get_elem(&self, idx: usize) -> Option<&SimpleJvmValue> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_idx`
warning: unused variable: `idx`
--> src/virtual_machine.rs:2934:28
|
2934 | fn get_elem_mut(&self, idx: usize) -> Option<&mut SimpleJvmValue> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_idx`
warning: unused variable: `data`
--> src/virtual_machine.rs:2949:46
|
2949 | fn new_array(class_file: Arc, data: Box<[SimpleJvmValue]>) -> Self {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `v`
--> src/virtual_machine.rs:3104:14
|
3104 | fn float(v: f32) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_v`
warning: unused variable: `v`
--> src/virtual_machine.rs:3108:15
|
3108 | fn double(v: f64) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_v`
warning: unused variable: `s`
--> src/virtual_machine.rs:3112:13
|
3112 | fn null(s: String) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_s`
warning: variable does not need to be mutable
--> src/virtual_machine.rs:3272:13
|
3272 | let mut obj = Self::ObjectTy::new_inst(class_file);
| ----^^^
| |
| help: remove this `mut`
warning: unused variable: `managed_alloc_name`
--> src/compiler/mod.rs:467:17
|
467 | let managed_alloc_name = ExternalName::User { namespace: 0, index: 0 };
| ^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_managed_alloc_name`
warning: unused variable: `other`
--> src/compiler/mod.rs:567:29
|
567 | ... other => { return Err(ir::CompileError::InvalidSignature("managed alloc returned multiple values?")); }
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`
warning: unused variable: `value`
--> src/compiler/mod.rs:571:48
|
571 | ir::Instruction::Dealloc { value } => {
| ^^^^^ help: try ignoring the field: `value: _`
warning: unused variable: `name`
--> src/compiler/mod.rs:574:59
|
574 | ir::Instruction::CallImport { result, name, sig, args } => {
| ^^^^ help: try ignoring the field: `name: _`
warning: unused variable: `ret`
--> src/compiler/mod.rs:576:51
|
576 | let returns = if let Some(ret) = sig.1 {
| ^^^ help: if this is intentional, prefix it with an underscore: `_ret`
warning: unused variable: `other`
--> src/compiler/mod.rs:616:29
|
616 | ... other => { return Err(ir::CompileError::InvalidSignature("call returned multiple values?")); }
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`
warning: unused variable: `i`
--> src/compiler/mod.rs:1421:10
|
1421 | for (i, cls) in extra_classes.iter().enumerate() {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
warning: field `attributes` is never read
--> src/class_file/unvalidated/field.rs:46:16
|
42 | pub struct FieldInfo {
| --------- field in this struct
...
46 | pub(crate) attributes: Vec,
| ^^^^^^^^^^
|
= note: `FieldInfo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
warning: field `max_stack` is never read
--> src/class_file/validated/method.rs:25:16
|
24 | pub struct MethodBody {
| ---------- field in this struct
25 | pub(crate) max_stack: u16,
| ^^^^^^^^^
|
= note: `MethodBody` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: field `layout_id` is never read
--> src/virtual_machine.rs:2729:5
|
2728 | struct ZvmObjectVTable {
| --------------- field in this struct
2729 | layout_id: crate::compiler::ir::LayoutId,
| ^^^^^^^^^
warning: field `data` is never read
--> src/virtual_machine.rs:2849:5
|
2845 | pub struct NativeJvmArrayData {
| ------------------ field in this struct
...
2849 | data: [NativeJvmValue; 1]
| ^^^^
warning: associated function `of` is never used
--> src/virtual_machine.rs:3341:12
|
3340 | impl ValueRef {
| --------------------------------------------- associated function in this implementation
3341 | pub fn of(reference: &ValueImpl) -> Self {
| ^^
warning: methods `has_instance_field`, `get_instance_field`, and `put_instance_field` are never used
--> src/virtual_machine.rs:3455:8
|
3442 | impl VirtualMachine {
| --------------------------------------------------- methods in this implementation
...
3455 | fn has_instance_field(
| ^^^^^^^^^^^^^^^^^^
...
3487 | fn get_instance_field(
| ^^^^^^^^^^^^^^^^^^
...
3503 | fn put_instance_field(
| ^^^^^^^^^^^^^^^^^^
warning: fields `bytes` and `len` are never read
--> src/compiler/mod.rs:313:5
|
312 | pub struct FunctionEmitter {
| --------------- fields in this struct
313 | bytes: *mut u8,
| ^^^^^
314 | len: usize,
| ^^^
warning: methods `data_mut`, `data`, `link`, and `finalize` are never used
--> src/compiler/mod.rs:318:8
|
317 | impl FunctionEmitter {
| -------------------- methods in this implementation
318 | fn data_mut(&mut self) -> &mut [u8] {
| ^^^^^^^^
...
323 | fn data(&self) -> &[u8] {
| ^^^^
...
328 | fn link(&mut self, relocs: &[cranelift_codegen::MachReloc], rt_info: &dyn RuntimeInfo) -> Result<(), crate::compiler::ir::CompileErro...
| ^^^^
...
346 | fn finalize(self) -> (*mut u8, usize) {
| ^^^^^^^^
warning: struct `CompiledMethod` is never constructed
--> src/compiler/mod.rs:360:12
|
360 | pub struct CompiledMethod {
| ^^^^^^^^^^^^^^
warning: methods `data_mut` and `data` are never used
--> src/compiler/mod.rs:369:8
|
368 | impl CompiledMethod {
| ------------------- methods in this implementation
369 | fn data_mut(&mut self) -> &mut [u8] {
| ^^^^^^^^
...
374 | fn data(&self) -> &[u8] {
| ^^^^
warning: fields `arguments`, `locals`, `blocks`, and `returns` are never read
--> src/compiler/mod.rs:383:5
|
382 | pub struct ZvmMethod {
| --------- fields in this struct
383 | arguments: Vec,
| ^^^^^^^^^
384 | locals: Vec,
| ^^^^^^
385 | blocks: Vec,
| ^^^^^^
386 | returns: Option,
| ^^^^^^^
|
= note: `ZvmMethod` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: method `compile` is never used
--> src/compiler/mod.rs:416:12
|
415 | impl ZvmMethod {
| -------------- method in this implementation
416 | pub fn compile(&self, rt_info: &dyn RuntimeInfo) -> Result {
| ^^^^^^^
warning: fields `blocks` and `layouts` are never read
--> src/compiler/mod.rs:722:5
|
720 | struct TranslatorState<'layouts> {
| --------------- fields in this struct
721 | current_block: ir::Block,
722 | blocks: Vec,
| ^^^^^^
...
728 | layouts: &'layouts ir::LayoutsInfo,
| ^^^^^^^
|
= note: `TranslatorState` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: function `desc_to_ir_valuety` is never used
--> src/compiler/mod.rs:863:4
|
863 | fn desc_to_ir_valuety(desc: &str) -> ir::ValueType {
| ^^^^^^^^^^^^^^^^^^
warning: function `bytecode2ir` is never used
--> src/compiler/mod.rs:871:8
|
871 | pub fn bytecode2ir(rt_info: &mut dyn RuntimeInfo, method: &MethodBody, sig: (Vec, Option)) -> Result src/compiler/mod.rs:1122:5
|
1119 | pub struct StructLayout {
| ------------ field in this struct
...
1122 | layout_id: u64,
| ^^^^^^^^^
warning: associated function `init` is never used
--> src/compiler/mod.rs:1154:12
|
1153 | impl ZvmRuntime {
| --------------- associated function in this implementation
1154 | pub fn init() -> Self {
| ^^^^
warning: function `jit` is never used
--> src/compiler/mod.rs:1398:4
|
1398 | fn jit(args: &[i64], instructions: Vec, signature: &'static str, extra_classes: Vec>, rt_info: &mu...
| ^^^
warning: function `jitcall` is never used
--> src/compiler/mod.rs:1471:4
|
1471 | fn jitcall(args: &[i64], code: fn(i64, i64, i64, i64, i64, i64) -> i64) -> i64 {
| ^^^^^^^
warning: variants `Argument`, `Local`, and `Const` are never constructed
--> src/compiler/mod.rs:17:9
|
16 | pub enum Value {
| ----- variants in this enum
17 | Argument(Argument),
| ^^^^^^^^
18 | Local(Local),
| ^^^^^
19 | Const(Const),
| ^^^^^
|
= note: `Value` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: multiple variants are never constructed
--> src/compiler/mod.rs:34:9
|
33 | pub enum Const {
| ----- variants in this enum
34 | Byte(i8),
| ^^^^
35 | Short(i16),
| ^^^^^
36 | Int(i32),
| ^^^
37 | Long(i64),
| ^^^^
38 | Float(f32),
| ^^^^^
39 | Double(f64),
| ^^^^^^
40 | Null,
| ^^^^
|
= note: `Const` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: variants `Byte` and `Short` are never constructed
--> src/compiler/mod.rs:45:9
|
44 | pub enum ValueType {
| --------- variants in this enum
45 | Byte,
| ^^^^
46 | Short,
| ^^^^^
|
= note: `ValueType` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
warning: variant `Const` is never constructed
--> src/compiler/mod.rs:88:9
|
85 | pub enum ValuePool {
| --------- variant in this enum
...
88 | Const,
| ^^^^^
|
= note: `ValuePool` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
warning: associated function `constant` is never used
--> src/compiler/mod.rs:112:16
|
97 | impl ValueRef {
| ------------- associated function in this implementation
...
112 | pub fn constant(id: usize) -> Self {
| ^^^^^^^^
warning: struct `FunctionRef` is never constructed
--> src/compiler/mod.rs:120:12
|
120 | struct FunctionRef {
| ^^^^^^^^^^^
warning: multiple variants are never constructed
--> src/compiler/mod.rs:127:9
|
125 | pub enum Instruction {
| ----------- variants in this enum
126 | LoadArg { result: ValueRef, source: ValueRef, id: usize },
127 | ConstInt { result: ValueRef, value: i32 },
| ^^^^^^^^
128 | ConstLong { result: ValueRef, value: i64 },
| ^^^^^^^^^
129 | IntAdd { result: ValueRef, left: ValueRef, right: ValueRef },
| ^^^^^^
130 | IntXor { result: ValueRef, left: ValueRef, right: ValueRef },
| ^^^^^^
131 | AReturn { retval: ValueRef },
| ^^^^^^^
132 | IReturn { retval: ValueRef },
| ^^^^^^^
133 | TypeAdjust { value: ValueRef, current_ty: ValueType, result: ValueRef, new_ty: ValueType },
| ^^^^^^^^^^
134 | GetField { result: ValueRef, object: ValueRef, field_desc: LayoutFieldRef },
| ^^^^^^^^
135 | SetField { target: ValueRef, value: ValueRef, field_desc: LayoutFieldRef },
| ^^^^^^^^
136 | Alloc { result: ValueRef, layout_id: LayoutId },
| ^^^^^
137 | Dealloc { value: ValueRef },
| ^^^^^^^
138 | CallImport { result: Option, name: String, sig: (Vec, Option), args: Vec },
| ^^^^^^^^^^
139 | Return,
| ^^^^^^
|
= note: `Instruction` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: method `instructions` is never used
--> src/compiler/mod.rs:158:16
|
147 | impl Block {
| ---------- method in this implementation
...
158 | pub fn instructions(&self) -> &[Instruction] {
| ^^^^^^^^^^^^
warning: method `as_usize` is never used
--> src/compiler/mod.rs:167:16
|
166 | impl LayoutId {
| ------------- method in this implementation
167 | pub fn as_usize(&self) -> usize {
| ^^^^^^^^
warning: associated items `new` and `add_field` are never used
--> src/compiler/mod.rs:181:16
|
180 | impl Layout {
| ----------- associated items in this implementation
181 | pub fn new() -> Self {
| ^^^
...
187 | pub fn add_field(&mut self, field_layout: LayoutFieldRef) {
| ^^^^^^^^^
warning: constant `OBJ_HEADER_ZVM_LAYOUT_ID` is never used
--> src/compiler/mod.rs:222:22
|
222 | pub(crate) const OBJ_HEADER_ZVM_LAYOUT_ID: LayoutFieldRef = LayoutFieldRef {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: constant `OBJ_HEADER_CLASSFILE_REF` is never used
--> src/compiler/mod.rs:228:22
|
228 | pub(crate) const OBJ_HEADER_CLASSFILE_REF: LayoutFieldRef = LayoutFieldRef {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: associated function `new` is never used
--> src/compiler/mod.rs:241:16
|
240 | impl LayoutsInfo {
| ---------------- associated function in this implementation
241 | pub fn new() -> Self {
| ^^^
warning: variants `InvalidLoad`, `InvalidSignature`, and `InvalidTypeAdjust` are never constructed
--> src/compiler/mod.rs:285:9
|
284 | pub enum CompileError {
| ------------ variants in this enum
285 | InvalidLoad(&'static str),
| ^^^^^^^^^^^
286 | InvalidSignature(&'static str),
| ^^^^^^^^^^^^^^^^
287 | InvalidTypeAdjust(ValueRef, ValueType, ValueRef, ValueType),
| ^^^^^^^^^^^^^^^^^
|
= note: `CompileError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: variant `UnsupportedInstruction` is never constructed
--> src/compiler/mod.rs:294:9
|
293 | pub enum TranslationError {
| ---------------- variant in this enum
294 | UnsupportedInstruction(crate::class_file::validated::Instruction),
| ^^^^^^^^^^^^^^^^^^^^^^
warning: `extern` fn uses type `LayoutId`, which is not FFI-safe
--> src/virtual_machine.rs:2705:43
|
2705 | extern "C" fn zvm_layout_id(&self) -> crate::compiler::ir::LayoutId {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
note: the type is defined here
--> src/compiler/mod.rs:164:5
|
164 | pub struct LayoutId(pub usize);
| ^^^^^^^^^^^^^^^^^^^
= note: `#[warn(improper_ctypes_definitions)]` on by default
warning: `extern` fn uses type `Arc`, which is not FFI-safe
--> src/virtual_machine.rs:2714:40
|
2714 | extern "C" fn zvm_vtable(&self) -> Arc {
| ^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
warning: unused `std::result::Result` that must be used
--> src/compiler/mod.rs:1407:5
|
1407 | / rt_info.declare_layout({
1408 | | let mut layout = ir::Layout::new();
1409 | | layout.add_field(ir::LayoutFieldRef {
1410 | | offset: 0,
... |
1419 | | layout
1420 | | }, "java/lang/Integer".to_string());
| |_______________________________________^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
1407 | let _ = rt_info.declare_layout({
| +++++++
warning: unused `std::result::Result` that must be used
--> src/compiler/mod.rs:1422:9
|
1422 | / rt_info.declare_layout({
1423 | | let mut layout = ir::Layout::new();
1424 | | let mut offset = 0;
1425 | | for f in cls.fields.iter() {
... |
1433 | | layout
1434 | | }, cls.this_class.to_string());
| |______________________________________^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
1422 | let _ = rt_info.declare_layout({
| +++++++
warning: `zvm` (lib) generated 86 warnings (run `cargo fix --lib -p zvm` to apply 43 suggestions)
Compiling zvm-stdlib v0.1.0 (/home/iximeow/nvme0/ci.butactuallyin.space/tmpdir/zvm-stdlib)
Finished dev [unoptimized + debuginfo] target(s) in 0.11s
Tue, 18 Jul 2023 05:35:11 +0000
step:
cargo build -p zvm-tools log (stdout)
Tue, 18 Jul 2023 05:35:11 +0000
step:
cargo build -p zvm-tools log (stderr)
warning: unused import: `std::cell::RefCell`
--> src/virtual_machine/jvm/synthetic.rs:1:5
|
1 | use std::cell::RefCell;
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `attribute::Attribute`
--> src/virtual_machine/jvm/synthetic.rs:7:38
|
7 | use crate::class_file::unvalidated::{attribute::Attribute, AttributeInfo, MethodAccessFlags, MethodInfo};
| ^^^^^^^^^^^^^^^^^^^^
warning: unused import: `ValueRef`
--> src/virtual_machine/jvm/synthetic.rs:9:77
|
9 | use crate::virtual_machine::{ClassFile, ClassFileRef, UnvalidatedClassFile, ValueRef};
| ^^^^^^^^
warning: unused import: `NativeObject`
--> src/virtual_machine/jvm/synthetic.rs:10:73
|
10 | use crate::virtual_machine::{MethodBody, JvmArray, JvmObject, JvmValue, NativeObject};
| ^^^^^^^^^^^^
warning: unused import: `std::collections::hash_map::Entry`
--> src/virtual_machine.rs:3575:17
|
3575 | use std::collections::hash_map::Entry;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `std::rc::Rc`
--> src/compiler/mod.rs:2:5
|
2 | use std::rc::Rc;
| ^^^^^^^^^^^
warning: unused import: `SimpleJvmValue`
--> src/compiler/mod.rs:9:13
|
9 | use crate::{SimpleJvmValue, VirtualMachine, VMState};
| ^^^^^^^^^^^^^^
warning: unused import: `std::cell::RefCell`
--> src/compiler/mod.rs:1113:5
|
1113 | use std::cell::RefCell;
| ^^^^^^^^^^^^^^^^^^
warning: unused import: `std::borrow::Borrow`
--> src/compiler/mod.rs:1151:5
|
1151 | use std::borrow::Borrow;
| ^^^^^^^^^^^^^^^^^^^
warning: unreachable expression
--> src/virtual_machine/jvm/synthetic.rs:1154:9
|
1153 | let data: &[u8] = panic!("get string somehow");
| ---------------------------- any code following this expression is unreachable
1154 | / match &data[..] {
1155 | | b"file.encoding" => {
1156 | | ValueImpl::string(vm, "UTF-8")
1157 | | }
... |
1162 | | }
1163 | | }
| |_________^ unreachable expression
|
= note: `#[warn(unreachable_code)]` on by default
warning: unreachable statement
--> src/virtual_machine/jvm/synthetic.rs:1168:5
|
1165 | panic!("invalid argument for getProperty {:?}", argument);
| --------------------------------------------------------- any code following this expression is unreachable
...
1168 | state.current_frame_mut().operand_stack.push(property);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
warning: unreachable statement
--> src/virtual_machine/jvm/synthetic.rs:1202:9
|
1199 | panic!("todo: turn class name array into a real string");
| -------------------------------------------------------- any code following this expression is unreachable
...
1202 | / state.current_frame_mut()
1203 | | .operand_stack
1204 | | .push(ValueImpl::array_with_data(
1205 | | vm.resolve_class(class_name_string).expect("TODO: need to fish out the right string from `cls`."),
1206 | | elems.into_boxed_slice(),
1207 | | ));
| |_______________^ unreachable statement
warning: unreachable call
--> src/virtual_machine.rs:2765:61
|
2765 | let layout_id = ZVM.as_ref().unwrap().layouts().get_layout_id(panic!("&class_file.this_name")).expect("TODO: class exists");
| ^^^^^^^^^^^^^ ------------------------------- any code following this expression is unreachable
| |
| unreachable call
warning: unreachable expression
--> src/virtual_machine.rs:2950:9
|
2950 | / Self {
2951 | | cls: class_file,
2952 | | data: panic!("todo: do something with argument")
| | ------------------------------------------ any code following this expression is unreachable
2953 | | }
| |_________^ unreachable expression
warning: unused variable: `bytecode`
--> src/class_file/unvalidated/class.rs:180:9
|
180 | bytecode: Option>,
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_bytecode`
|
= note: `#[warn(unused_variables)]` on by default
warning: variable does not need to be mutable
--> src/class_file/unvalidated/class.rs:183:13
|
183 | let mut attributes = Vec::new();
| ----^^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: variable does not need to be mutable
--> src/class_file/unvalidated/class.rs:209:9
|
209 | mut self,
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:167:20
|
167 | pub fn extends(mut self, name: &str) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:175:24
|
175 | pub fn with_method(mut self, name: &str, sig: &str, native: Option>) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:178:13
|
178 | let mut bytecode_methods = self.bytecode_methods;
| ----^^^^^^^^^^^^^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:224:23
|
224 | pub fn with_field(mut self, name: &str, sig: &str) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:243:13
|
243 | let mut cls = ClassFile::validate(&self.cls).unwrap();
| ----^^^
| |
| help: remove this `mut`
warning: unused variable: `obj`
--> src/virtual_machine/jvm/synthetic.rs:427:24
|
427 | } else if let Some(obj) = argument.as_object() {
| ^^^ help: if this is intentional, prefix it with an underscore: `_obj`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:595:71
|
595 | fn object_equals(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `property`
--> src/virtual_machine/jvm/synthetic.rs:1152:9
|
1152 | let property = if argument.as_type("java/lang/String").is_some() {
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_property`
warning: unused variable: `data`
--> src/virtual_machine/jvm/synthetic.rs:1153:13
|
1153 | let data: &[u8] = panic!("get string somehow");
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:1145:77
|
1145 | fn system_get_property(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `class_name_string`
--> src/virtual_machine/jvm/synthetic.rs:1194:13
|
1194 | let class_name_string = {
| ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_class_name_string`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:1172:72
|
1172 | fn array_newarray(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `frame`
--> src/virtual_machine.rs:365:13
|
365 | let frame = self.current_frame();
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_frame`
warning: unused variable: `layout_id`
--> src/virtual_machine.rs:2765:17
|
2765 | let layout_id = ZVM.as_ref().unwrap().layouts().get_layout_id(panic!("&class_file.this_name")).expect("TODO: class exists");
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_layout_id`
warning: unused variable: `classfile_ptr`
--> src/virtual_machine.rs:2770:17
|
2770 | let classfile_ptr = Arc::into_raw(class_file);
| ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_classfile_ptr`
warning: unused variable: `class_file`
--> src/virtual_machine.rs:2897:18
|
2897 | fn new_array(class_file: Arc, data: Box<[NativeJvmValue]>) -> Self {
| ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_class_file`
warning: unused variable: `data`
--> src/virtual_machine.rs:2897:46
|
2897 | fn new_array(class_file: Arc, data: Box<[NativeJvmValue]>) -> Self {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `idx`
--> src/virtual_machine.rs:2931:24
|
2931 | fn get_elem(&self, idx: usize) -> Option<&SimpleJvmValue> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_idx`
warning: unused variable: `idx`
--> src/virtual_machine.rs:2934:28
|
2934 | fn get_elem_mut(&self, idx: usize) -> Option<&mut SimpleJvmValue> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_idx`
warning: unused variable: `data`
--> src/virtual_machine.rs:2949:46
|
2949 | fn new_array(class_file: Arc, data: Box<[SimpleJvmValue]>) -> Self {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `v`
--> src/virtual_machine.rs:3104:14
|
3104 | fn float(v: f32) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_v`
warning: unused variable: `v`
--> src/virtual_machine.rs:3108:15
|
3108 | fn double(v: f64) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_v`
warning: unused variable: `s`
--> src/virtual_machine.rs:3112:13
|
3112 | fn null(s: String) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_s`
warning: variable does not need to be mutable
--> src/virtual_machine.rs:3272:13
|
3272 | let mut obj = Self::ObjectTy::new_inst(class_file);
| ----^^^
| |
| help: remove this `mut`
warning: unused variable: `managed_alloc_name`
--> src/compiler/mod.rs:467:17
|
467 | let managed_alloc_name = ExternalName::User { namespace: 0, index: 0 };
| ^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_managed_alloc_name`
warning: unused variable: `other`
--> src/compiler/mod.rs:567:29
|
567 | ... other => { return Err(ir::CompileError::InvalidSignature("managed alloc returned multiple values?")); }
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`
warning: unused variable: `value`
--> src/compiler/mod.rs:571:48
|
571 | ir::Instruction::Dealloc { value } => {
| ^^^^^ help: try ignoring the field: `value: _`
warning: unused variable: `name`
--> src/compiler/mod.rs:574:59
|
574 | ir::Instruction::CallImport { result, name, sig, args } => {
| ^^^^ help: try ignoring the field: `name: _`
warning: unused variable: `ret`
--> src/compiler/mod.rs:576:51
|
576 | let returns = if let Some(ret) = sig.1 {
| ^^^ help: if this is intentional, prefix it with an underscore: `_ret`
warning: unused variable: `other`
--> src/compiler/mod.rs:616:29
|
616 | ... other => { return Err(ir::CompileError::InvalidSignature("call returned multiple values?")); }
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`
warning: unused variable: `i`
--> src/compiler/mod.rs:1421:10
|
1421 | for (i, cls) in extra_classes.iter().enumerate() {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
warning: field `attributes` is never read
--> src/class_file/unvalidated/field.rs:46:16
|
42 | pub struct FieldInfo {
| --------- field in this struct
...
46 | pub(crate) attributes: Vec,
| ^^^^^^^^^^
|
= note: `FieldInfo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
warning: field `max_stack` is never read
--> src/class_file/validated/method.rs:25:16
|
24 | pub struct MethodBody {
| ---------- field in this struct
25 | pub(crate) max_stack: u16,
| ^^^^^^^^^
|
= note: `MethodBody` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: field `layout_id` is never read
--> src/virtual_machine.rs:2729:5
|
2728 | struct ZvmObjectVTable {
| --------------- field in this struct
2729 | layout_id: crate::compiler::ir::LayoutId,
| ^^^^^^^^^
warning: field `data` is never read
--> src/virtual_machine.rs:2849:5
|
2845 | pub struct NativeJvmArrayData {
| ------------------ field in this struct
...
2849 | data: [NativeJvmValue; 1]
| ^^^^
warning: associated function `of` is never used
--> src/virtual_machine.rs:3341:12
|
3340 | impl ValueRef {
| --------------------------------------------- associated function in this implementation
3341 | pub fn of(reference: &ValueImpl) -> Self {
| ^^
warning: methods `has_instance_field`, `get_instance_field`, and `put_instance_field` are never used
--> src/virtual_machine.rs:3455:8
|
3442 | impl VirtualMachine {
| --------------------------------------------------- methods in this implementation
...
3455 | fn has_instance_field(
| ^^^^^^^^^^^^^^^^^^
...
3487 | fn get_instance_field(
| ^^^^^^^^^^^^^^^^^^
...
3503 | fn put_instance_field(
| ^^^^^^^^^^^^^^^^^^
warning: fields `bytes` and `len` are never read
--> src/compiler/mod.rs:313:5
|
312 | pub struct FunctionEmitter {
| --------------- fields in this struct
313 | bytes: *mut u8,
| ^^^^^
314 | len: usize,
| ^^^
warning: methods `data_mut`, `data`, `link`, and `finalize` are never used
--> src/compiler/mod.rs:318:8
|
317 | impl FunctionEmitter {
| -------------------- methods in this implementation
318 | fn data_mut(&mut self) -> &mut [u8] {
| ^^^^^^^^
...
323 | fn data(&self) -> &[u8] {
| ^^^^
...
328 | fn link(&mut self, relocs: &[cranelift_codegen::MachReloc], rt_info: &dyn RuntimeInfo) -> Result<(), crate::compiler::ir::CompileErro...
| ^^^^
...
346 | fn finalize(self) -> (*mut u8, usize) {
| ^^^^^^^^
warning: struct `CompiledMethod` is never constructed
--> src/compiler/mod.rs:360:12
|
360 | pub struct CompiledMethod {
| ^^^^^^^^^^^^^^
warning: methods `data_mut` and `data` are never used
--> src/compiler/mod.rs:369:8
|
368 | impl CompiledMethod {
| ------------------- methods in this implementation
369 | fn data_mut(&mut self) -> &mut [u8] {
| ^^^^^^^^
...
374 | fn data(&self) -> &[u8] {
| ^^^^
warning: fields `arguments`, `locals`, `blocks`, and `returns` are never read
--> src/compiler/mod.rs:383:5
|
382 | pub struct ZvmMethod {
| --------- fields in this struct
383 | arguments: Vec,
| ^^^^^^^^^
384 | locals: Vec,
| ^^^^^^
385 | blocks: Vec,
| ^^^^^^
386 | returns: Option,
| ^^^^^^^
|
= note: `ZvmMethod` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: method `compile` is never used
--> src/compiler/mod.rs:416:12
|
415 | impl ZvmMethod {
| -------------- method in this implementation
416 | pub fn compile(&self, rt_info: &dyn RuntimeInfo) -> Result {
| ^^^^^^^
warning: fields `blocks` and `layouts` are never read
--> src/compiler/mod.rs:722:5
|
720 | struct TranslatorState<'layouts> {
| --------------- fields in this struct
721 | current_block: ir::Block,
722 | blocks: Vec,
| ^^^^^^
...
728 | layouts: &'layouts ir::LayoutsInfo,
| ^^^^^^^
|
= note: `TranslatorState` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: function `desc_to_ir_valuety` is never used
--> src/compiler/mod.rs:863:4
|
863 | fn desc_to_ir_valuety(desc: &str) -> ir::ValueType {
| ^^^^^^^^^^^^^^^^^^
warning: function `bytecode2ir` is never used
--> src/compiler/mod.rs:871:8
|
871 | pub fn bytecode2ir(rt_info: &mut dyn RuntimeInfo, method: &MethodBody, sig: (Vec, Option)) -> Result src/compiler/mod.rs:1122:5
|
1119 | pub struct StructLayout {
| ------------ field in this struct
...
1122 | layout_id: u64,
| ^^^^^^^^^
warning: associated function `init` is never used
--> src/compiler/mod.rs:1154:12
|
1153 | impl ZvmRuntime {
| --------------- associated function in this implementation
1154 | pub fn init() -> Self {
| ^^^^
warning: function `jit` is never used
--> src/compiler/mod.rs:1398:4
|
1398 | fn jit(args: &[i64], instructions: Vec, signature: &'static str, extra_classes: Vec>, rt_info: &mu...
| ^^^
warning: function `jitcall` is never used
--> src/compiler/mod.rs:1471:4
|
1471 | fn jitcall(args: &[i64], code: fn(i64, i64, i64, i64, i64, i64) -> i64) -> i64 {
| ^^^^^^^
warning: variants `Argument`, `Local`, and `Const` are never constructed
--> src/compiler/mod.rs:17:9
|
16 | pub enum Value {
| ----- variants in this enum
17 | Argument(Argument),
| ^^^^^^^^
18 | Local(Local),
| ^^^^^
19 | Const(Const),
| ^^^^^
|
= note: `Value` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: multiple variants are never constructed
--> src/compiler/mod.rs:34:9
|
33 | pub enum Const {
| ----- variants in this enum
34 | Byte(i8),
| ^^^^
35 | Short(i16),
| ^^^^^
36 | Int(i32),
| ^^^
37 | Long(i64),
| ^^^^
38 | Float(f32),
| ^^^^^
39 | Double(f64),
| ^^^^^^
40 | Null,
| ^^^^
|
= note: `Const` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: variants `Byte` and `Short` are never constructed
--> src/compiler/mod.rs:45:9
|
44 | pub enum ValueType {
| --------- variants in this enum
45 | Byte,
| ^^^^
46 | Short,
| ^^^^^
|
= note: `ValueType` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
warning: variant `Const` is never constructed
--> src/compiler/mod.rs:88:9
|
85 | pub enum ValuePool {
| --------- variant in this enum
...
88 | Const,
| ^^^^^
|
= note: `ValuePool` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
warning: associated function `constant` is never used
--> src/compiler/mod.rs:112:16
|
97 | impl ValueRef {
| ------------- associated function in this implementation
...
112 | pub fn constant(id: usize) -> Self {
| ^^^^^^^^
warning: struct `FunctionRef` is never constructed
--> src/compiler/mod.rs:120:12
|
120 | struct FunctionRef {
| ^^^^^^^^^^^
warning: multiple variants are never constructed
--> src/compiler/mod.rs:127:9
|
125 | pub enum Instruction {
| ----------- variants in this enum
126 | LoadArg { result: ValueRef, source: ValueRef, id: usize },
127 | ConstInt { result: ValueRef, value: i32 },
| ^^^^^^^^
128 | ConstLong { result: ValueRef, value: i64 },
| ^^^^^^^^^
129 | IntAdd { result: ValueRef, left: ValueRef, right: ValueRef },
| ^^^^^^
130 | IntXor { result: ValueRef, left: ValueRef, right: ValueRef },
| ^^^^^^
131 | AReturn { retval: ValueRef },
| ^^^^^^^
132 | IReturn { retval: ValueRef },
| ^^^^^^^
133 | TypeAdjust { value: ValueRef, current_ty: ValueType, result: ValueRef, new_ty: ValueType },
| ^^^^^^^^^^
134 | GetField { result: ValueRef, object: ValueRef, field_desc: LayoutFieldRef },
| ^^^^^^^^
135 | SetField { target: ValueRef, value: ValueRef, field_desc: LayoutFieldRef },
| ^^^^^^^^
136 | Alloc { result: ValueRef, layout_id: LayoutId },
| ^^^^^
137 | Dealloc { value: ValueRef },
| ^^^^^^^
138 | CallImport { result: Option, name: String, sig: (Vec, Option), args: Vec },
| ^^^^^^^^^^
139 | Return,
| ^^^^^^
|
= note: `Instruction` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: method `instructions` is never used
--> src/compiler/mod.rs:158:16
|
147 | impl Block {
| ---------- method in this implementation
...
158 | pub fn instructions(&self) -> &[Instruction] {
| ^^^^^^^^^^^^
warning: method `as_usize` is never used
--> src/compiler/mod.rs:167:16
|
166 | impl LayoutId {
| ------------- method in this implementation
167 | pub fn as_usize(&self) -> usize {
| ^^^^^^^^
warning: associated items `new` and `add_field` are never used
--> src/compiler/mod.rs:181:16
|
180 | impl Layout {
| ----------- associated items in this implementation
181 | pub fn new() -> Self {
| ^^^
...
187 | pub fn add_field(&mut self, field_layout: LayoutFieldRef) {
| ^^^^^^^^^
warning: constant `OBJ_HEADER_ZVM_LAYOUT_ID` is never used
--> src/compiler/mod.rs:222:22
|
222 | pub(crate) const OBJ_HEADER_ZVM_LAYOUT_ID: LayoutFieldRef = LayoutFieldRef {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: constant `OBJ_HEADER_CLASSFILE_REF` is never used
--> src/compiler/mod.rs:228:22
|
228 | pub(crate) const OBJ_HEADER_CLASSFILE_REF: LayoutFieldRef = LayoutFieldRef {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: associated function `new` is never used
--> src/compiler/mod.rs:241:16
|
240 | impl LayoutsInfo {
| ---------------- associated function in this implementation
241 | pub fn new() -> Self {
| ^^^
warning: variants `InvalidLoad`, `InvalidSignature`, and `InvalidTypeAdjust` are never constructed
--> src/compiler/mod.rs:285:9
|
284 | pub enum CompileError {
| ------------ variants in this enum
285 | InvalidLoad(&'static str),
| ^^^^^^^^^^^
286 | InvalidSignature(&'static str),
| ^^^^^^^^^^^^^^^^
287 | InvalidTypeAdjust(ValueRef, ValueType, ValueRef, ValueType),
| ^^^^^^^^^^^^^^^^^
|
= note: `CompileError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: variant `UnsupportedInstruction` is never constructed
--> src/compiler/mod.rs:294:9
|
293 | pub enum TranslationError {
| ---------------- variant in this enum
294 | UnsupportedInstruction(crate::class_file::validated::Instruction),
| ^^^^^^^^^^^^^^^^^^^^^^
warning: `extern` fn uses type `LayoutId`, which is not FFI-safe
--> src/virtual_machine.rs:2705:43
|
2705 | extern "C" fn zvm_layout_id(&self) -> crate::compiler::ir::LayoutId {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
note: the type is defined here
--> src/compiler/mod.rs:164:5
|
164 | pub struct LayoutId(pub usize);
| ^^^^^^^^^^^^^^^^^^^
= note: `#[warn(improper_ctypes_definitions)]` on by default
warning: `extern` fn uses type `Arc`, which is not FFI-safe
--> src/virtual_machine.rs:2714:40
|
2714 | extern "C" fn zvm_vtable(&self) -> Arc {
| ^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
warning: unused `std::result::Result` that must be used
--> src/compiler/mod.rs:1407:5
|
1407 | / rt_info.declare_layout({
1408 | | let mut layout = ir::Layout::new();
1409 | | layout.add_field(ir::LayoutFieldRef {
1410 | | offset: 0,
... |
1419 | | layout
1420 | | }, "java/lang/Integer".to_string());
| |_______________________________________^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
1407 | let _ = rt_info.declare_layout({
| +++++++
warning: unused `std::result::Result` that must be used
--> src/compiler/mod.rs:1422:9
|
1422 | / rt_info.declare_layout({
1423 | | let mut layout = ir::Layout::new();
1424 | | let mut offset = 0;
1425 | | for f in cls.fields.iter() {
... |
1433 | | layout
1434 | | }, cls.this_class.to_string());
| |______________________________________^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
1422 | let _ = rt_info.declare_layout({
| +++++++
warning: `zvm` (lib) generated 86 warnings (run `cargo fix --lib -p zvm` to apply 43 suggestions)
Compiling zvm-tools v0.1.0 (/home/iximeow/nvme0/ci.butactuallyin.space/tmpdir/zvm-tools)
Finished dev [unoptimized + debuginfo] target(s) in 0.86s
Tue, 18 Jul 2023 05:35:12 +0000
step:
cargo build -p zvm-cli log (stdout)
Tue, 18 Jul 2023 05:35:12 +0000
step:
cargo build -p zvm-cli log (stderr)
warning: unused import: `std::cell::RefCell`
--> src/virtual_machine/jvm/synthetic.rs:1:5
|
1 | use std::cell::RefCell;
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `attribute::Attribute`
--> src/virtual_machine/jvm/synthetic.rs:7:38
|
7 | use crate::class_file::unvalidated::{attribute::Attribute, AttributeInfo, MethodAccessFlags, MethodInfo};
| ^^^^^^^^^^^^^^^^^^^^
warning: unused import: `ValueRef`
--> src/virtual_machine/jvm/synthetic.rs:9:77
|
9 | use crate::virtual_machine::{ClassFile, ClassFileRef, UnvalidatedClassFile, ValueRef};
| ^^^^^^^^
warning: unused import: `NativeObject`
--> src/virtual_machine/jvm/synthetic.rs:10:73
|
10 | use crate::virtual_machine::{MethodBody, JvmArray, JvmObject, JvmValue, NativeObject};
| ^^^^^^^^^^^^
warning: unused import: `std::collections::hash_map::Entry`
--> src/virtual_machine.rs:3575:17
|
3575 | use std::collections::hash_map::Entry;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `std::rc::Rc`
--> src/compiler/mod.rs:2:5
|
2 | use std::rc::Rc;
| ^^^^^^^^^^^
warning: unused import: `SimpleJvmValue`
--> src/compiler/mod.rs:9:13
|
9 | use crate::{SimpleJvmValue, VirtualMachine, VMState};
| ^^^^^^^^^^^^^^
warning: unused import: `std::cell::RefCell`
--> src/compiler/mod.rs:1113:5
|
1113 | use std::cell::RefCell;
| ^^^^^^^^^^^^^^^^^^
warning: unused import: `std::borrow::Borrow`
--> src/compiler/mod.rs:1151:5
|
1151 | use std::borrow::Borrow;
| ^^^^^^^^^^^^^^^^^^^
warning: unreachable expression
--> src/virtual_machine/jvm/synthetic.rs:1154:9
|
1153 | let data: &[u8] = panic!("get string somehow");
| ---------------------------- any code following this expression is unreachable
1154 | / match &data[..] {
1155 | | b"file.encoding" => {
1156 | | ValueImpl::string(vm, "UTF-8")
1157 | | }
... |
1162 | | }
1163 | | }
| |_________^ unreachable expression
|
= note: `#[warn(unreachable_code)]` on by default
warning: unreachable statement
--> src/virtual_machine/jvm/synthetic.rs:1168:5
|
1165 | panic!("invalid argument for getProperty {:?}", argument);
| --------------------------------------------------------- any code following this expression is unreachable
...
1168 | state.current_frame_mut().operand_stack.push(property);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
warning: unreachable statement
--> src/virtual_machine/jvm/synthetic.rs:1202:9
|
1199 | panic!("todo: turn class name array into a real string");
| -------------------------------------------------------- any code following this expression is unreachable
...
1202 | / state.current_frame_mut()
1203 | | .operand_stack
1204 | | .push(ValueImpl::array_with_data(
1205 | | vm.resolve_class(class_name_string).expect("TODO: need to fish out the right string from `cls`."),
1206 | | elems.into_boxed_slice(),
1207 | | ));
| |_______________^ unreachable statement
warning: unreachable call
--> src/virtual_machine.rs:2765:61
|
2765 | let layout_id = ZVM.as_ref().unwrap().layouts().get_layout_id(panic!("&class_file.this_name")).expect("TODO: class exists");
| ^^^^^^^^^^^^^ ------------------------------- any code following this expression is unreachable
| |
| unreachable call
warning: unreachable expression
--> src/virtual_machine.rs:2950:9
|
2950 | / Self {
2951 | | cls: class_file,
2952 | | data: panic!("todo: do something with argument")
| | ------------------------------------------ any code following this expression is unreachable
2953 | | }
| |_________^ unreachable expression
warning: unused variable: `bytecode`
--> src/class_file/unvalidated/class.rs:180:9
|
180 | bytecode: Option>,
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_bytecode`
|
= note: `#[warn(unused_variables)]` on by default
warning: variable does not need to be mutable
--> src/class_file/unvalidated/class.rs:183:13
|
183 | let mut attributes = Vec::new();
| ----^^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: variable does not need to be mutable
--> src/class_file/unvalidated/class.rs:209:9
|
209 | mut self,
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:167:20
|
167 | pub fn extends(mut self, name: &str) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:175:24
|
175 | pub fn with_method(mut self, name: &str, sig: &str, native: Option>) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:178:13
|
178 | let mut bytecode_methods = self.bytecode_methods;
| ----^^^^^^^^^^^^^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:224:23
|
224 | pub fn with_field(mut self, name: &str, sig: &str) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:243:13
|
243 | let mut cls = ClassFile::validate(&self.cls).unwrap();
| ----^^^
| |
| help: remove this `mut`
warning: unused variable: `obj`
--> src/virtual_machine/jvm/synthetic.rs:427:24
|
427 | } else if let Some(obj) = argument.as_object() {
| ^^^ help: if this is intentional, prefix it with an underscore: `_obj`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:595:71
|
595 | fn object_equals(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `property`
--> src/virtual_machine/jvm/synthetic.rs:1152:9
|
1152 | let property = if argument.as_type("java/lang/String").is_some() {
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_property`
warning: unused variable: `data`
--> src/virtual_machine/jvm/synthetic.rs:1153:13
|
1153 | let data: &[u8] = panic!("get string somehow");
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:1145:77
|
1145 | fn system_get_property(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `class_name_string`
--> src/virtual_machine/jvm/synthetic.rs:1194:13
|
1194 | let class_name_string = {
| ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_class_name_string`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:1172:72
|
1172 | fn array_newarray(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `frame`
--> src/virtual_machine.rs:365:13
|
365 | let frame = self.current_frame();
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_frame`
warning: unused variable: `layout_id`
--> src/virtual_machine.rs:2765:17
|
2765 | let layout_id = ZVM.as_ref().unwrap().layouts().get_layout_id(panic!("&class_file.this_name")).expect("TODO: class exists");
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_layout_id`
warning: unused variable: `classfile_ptr`
--> src/virtual_machine.rs:2770:17
|
2770 | let classfile_ptr = Arc::into_raw(class_file);
| ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_classfile_ptr`
warning: unused variable: `class_file`
--> src/virtual_machine.rs:2897:18
|
2897 | fn new_array(class_file: Arc, data: Box<[NativeJvmValue]>) -> Self {
| ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_class_file`
warning: unused variable: `data`
--> src/virtual_machine.rs:2897:46
|
2897 | fn new_array(class_file: Arc, data: Box<[NativeJvmValue]>) -> Self {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `idx`
--> src/virtual_machine.rs:2931:24
|
2931 | fn get_elem(&self, idx: usize) -> Option<&SimpleJvmValue> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_idx`
warning: unused variable: `idx`
--> src/virtual_machine.rs:2934:28
|
2934 | fn get_elem_mut(&self, idx: usize) -> Option<&mut SimpleJvmValue> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_idx`
warning: unused variable: `data`
--> src/virtual_machine.rs:2949:46
|
2949 | fn new_array(class_file: Arc, data: Box<[SimpleJvmValue]>) -> Self {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `v`
--> src/virtual_machine.rs:3104:14
|
3104 | fn float(v: f32) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_v`
warning: unused variable: `v`
--> src/virtual_machine.rs:3108:15
|
3108 | fn double(v: f64) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_v`
warning: unused variable: `s`
--> src/virtual_machine.rs:3112:13
|
3112 | fn null(s: String) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_s`
warning: variable does not need to be mutable
--> src/virtual_machine.rs:3272:13
|
3272 | let mut obj = Self::ObjectTy::new_inst(class_file);
| ----^^^
| |
| help: remove this `mut`
warning: unused variable: `managed_alloc_name`
--> src/compiler/mod.rs:467:17
|
467 | let managed_alloc_name = ExternalName::User { namespace: 0, index: 0 };
| ^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_managed_alloc_name`
warning: unused variable: `other`
--> src/compiler/mod.rs:567:29
|
567 | ... other => { return Err(ir::CompileError::InvalidSignature("managed alloc returned multiple values?")); }
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`
warning: unused variable: `value`
--> src/compiler/mod.rs:571:48
|
571 | ir::Instruction::Dealloc { value } => {
| ^^^^^ help: try ignoring the field: `value: _`
warning: unused variable: `name`
--> src/compiler/mod.rs:574:59
|
574 | ir::Instruction::CallImport { result, name, sig, args } => {
| ^^^^ help: try ignoring the field: `name: _`
warning: unused variable: `ret`
--> src/compiler/mod.rs:576:51
|
576 | let returns = if let Some(ret) = sig.1 {
| ^^^ help: if this is intentional, prefix it with an underscore: `_ret`
warning: unused variable: `other`
--> src/compiler/mod.rs:616:29
|
616 | ... other => { return Err(ir::CompileError::InvalidSignature("call returned multiple values?")); }
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`
warning: unused variable: `i`
--> src/compiler/mod.rs:1421:10
|
1421 | for (i, cls) in extra_classes.iter().enumerate() {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
warning: field `attributes` is never read
--> src/class_file/unvalidated/field.rs:46:16
|
42 | pub struct FieldInfo {
| --------- field in this struct
...
46 | pub(crate) attributes: Vec,
| ^^^^^^^^^^
|
= note: `FieldInfo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
warning: field `max_stack` is never read
--> src/class_file/validated/method.rs:25:16
|
24 | pub struct MethodBody {
| ---------- field in this struct
25 | pub(crate) max_stack: u16,
| ^^^^^^^^^
|
= note: `MethodBody` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: field `layout_id` is never read
--> src/virtual_machine.rs:2729:5
|
2728 | struct ZvmObjectVTable {
| --------------- field in this struct
2729 | layout_id: crate::compiler::ir::LayoutId,
| ^^^^^^^^^
warning: field `data` is never read
--> src/virtual_machine.rs:2849:5
|
2845 | pub struct NativeJvmArrayData {
| ------------------ field in this struct
...
2849 | data: [NativeJvmValue; 1]
| ^^^^
warning: associated function `of` is never used
--> src/virtual_machine.rs:3341:12
|
3340 | impl ValueRef {
| --------------------------------------------- associated function in this implementation
3341 | pub fn of(reference: &ValueImpl) -> Self {
| ^^
warning: methods `has_instance_field`, `get_instance_field`, and `put_instance_field` are never used
--> src/virtual_machine.rs:3455:8
|
3442 | impl VirtualMachine {
| --------------------------------------------------- methods in this implementation
...
3455 | fn has_instance_field(
| ^^^^^^^^^^^^^^^^^^
...
3487 | fn get_instance_field(
| ^^^^^^^^^^^^^^^^^^
...
3503 | fn put_instance_field(
| ^^^^^^^^^^^^^^^^^^
warning: fields `bytes` and `len` are never read
--> src/compiler/mod.rs:313:5
|
312 | pub struct FunctionEmitter {
| --------------- fields in this struct
313 | bytes: *mut u8,
| ^^^^^
314 | len: usize,
| ^^^
warning: methods `data_mut`, `data`, `link`, and `finalize` are never used
--> src/compiler/mod.rs:318:8
|
317 | impl FunctionEmitter {
| -------------------- methods in this implementation
318 | fn data_mut(&mut self) -> &mut [u8] {
| ^^^^^^^^
...
323 | fn data(&self) -> &[u8] {
| ^^^^
...
328 | fn link(&mut self, relocs: &[cranelift_codegen::MachReloc], rt_info: &dyn RuntimeInfo) -> Result<(), crate::compiler::ir::CompileErro...
| ^^^^
...
346 | fn finalize(self) -> (*mut u8, usize) {
| ^^^^^^^^
warning: struct `CompiledMethod` is never constructed
--> src/compiler/mod.rs:360:12
|
360 | pub struct CompiledMethod {
| ^^^^^^^^^^^^^^
warning: methods `data_mut` and `data` are never used
--> src/compiler/mod.rs:369:8
|
368 | impl CompiledMethod {
| ------------------- methods in this implementation
369 | fn data_mut(&mut self) -> &mut [u8] {
| ^^^^^^^^
...
374 | fn data(&self) -> &[u8] {
| ^^^^
warning: fields `arguments`, `locals`, `blocks`, and `returns` are never read
--> src/compiler/mod.rs:383:5
|
382 | pub struct ZvmMethod {
| --------- fields in this struct
383 | arguments: Vec,
| ^^^^^^^^^
384 | locals: Vec,
| ^^^^^^
385 | blocks: Vec,
| ^^^^^^
386 | returns: Option,
| ^^^^^^^
|
= note: `ZvmMethod` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: method `compile` is never used
--> src/compiler/mod.rs:416:12
|
415 | impl ZvmMethod {
| -------------- method in this implementation
416 | pub fn compile(&self, rt_info: &dyn RuntimeInfo) -> Result {
| ^^^^^^^
warning: fields `blocks` and `layouts` are never read
--> src/compiler/mod.rs:722:5
|
720 | struct TranslatorState<'layouts> {
| --------------- fields in this struct
721 | current_block: ir::Block,
722 | blocks: Vec,
| ^^^^^^
...
728 | layouts: &'layouts ir::LayoutsInfo,
| ^^^^^^^
|
= note: `TranslatorState` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: function `desc_to_ir_valuety` is never used
--> src/compiler/mod.rs:863:4
|
863 | fn desc_to_ir_valuety(desc: &str) -> ir::ValueType {
| ^^^^^^^^^^^^^^^^^^
warning: function `bytecode2ir` is never used
--> src/compiler/mod.rs:871:8
|
871 | pub fn bytecode2ir(rt_info: &mut dyn RuntimeInfo, method: &MethodBody, sig: (Vec, Option)) -> Result src/compiler/mod.rs:1122:5
|
1119 | pub struct StructLayout {
| ------------ field in this struct
...
1122 | layout_id: u64,
| ^^^^^^^^^
warning: associated function `init` is never used
--> src/compiler/mod.rs:1154:12
|
1153 | impl ZvmRuntime {
| --------------- associated function in this implementation
1154 | pub fn init() -> Self {
| ^^^^
warning: function `jit` is never used
--> src/compiler/mod.rs:1398:4
|
1398 | fn jit(args: &[i64], instructions: Vec, signature: &'static str, extra_classes: Vec>, rt_info: &mu...
| ^^^
warning: function `jitcall` is never used
--> src/compiler/mod.rs:1471:4
|
1471 | fn jitcall(args: &[i64], code: fn(i64, i64, i64, i64, i64, i64) -> i64) -> i64 {
| ^^^^^^^
warning: variants `Argument`, `Local`, and `Const` are never constructed
--> src/compiler/mod.rs:17:9
|
16 | pub enum Value {
| ----- variants in this enum
17 | Argument(Argument),
| ^^^^^^^^
18 | Local(Local),
| ^^^^^
19 | Const(Const),
| ^^^^^
|
= note: `Value` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: multiple variants are never constructed
--> src/compiler/mod.rs:34:9
|
33 | pub enum Const {
| ----- variants in this enum
34 | Byte(i8),
| ^^^^
35 | Short(i16),
| ^^^^^
36 | Int(i32),
| ^^^
37 | Long(i64),
| ^^^^
38 | Float(f32),
| ^^^^^
39 | Double(f64),
| ^^^^^^
40 | Null,
| ^^^^
|
= note: `Const` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: variants `Byte` and `Short` are never constructed
--> src/compiler/mod.rs:45:9
|
44 | pub enum ValueType {
| --------- variants in this enum
45 | Byte,
| ^^^^
46 | Short,
| ^^^^^
|
= note: `ValueType` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
warning: variant `Const` is never constructed
--> src/compiler/mod.rs:88:9
|
85 | pub enum ValuePool {
| --------- variant in this enum
...
88 | Const,
| ^^^^^
|
= note: `ValuePool` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
warning: associated function `constant` is never used
--> src/compiler/mod.rs:112:16
|
97 | impl ValueRef {
| ------------- associated function in this implementation
...
112 | pub fn constant(id: usize) -> Self {
| ^^^^^^^^
warning: struct `FunctionRef` is never constructed
--> src/compiler/mod.rs:120:12
|
120 | struct FunctionRef {
| ^^^^^^^^^^^
warning: multiple variants are never constructed
--> src/compiler/mod.rs:127:9
|
125 | pub enum Instruction {
| ----------- variants in this enum
126 | LoadArg { result: ValueRef, source: ValueRef, id: usize },
127 | ConstInt { result: ValueRef, value: i32 },
| ^^^^^^^^
128 | ConstLong { result: ValueRef, value: i64 },
| ^^^^^^^^^
129 | IntAdd { result: ValueRef, left: ValueRef, right: ValueRef },
| ^^^^^^
130 | IntXor { result: ValueRef, left: ValueRef, right: ValueRef },
| ^^^^^^
131 | AReturn { retval: ValueRef },
| ^^^^^^^
132 | IReturn { retval: ValueRef },
| ^^^^^^^
133 | TypeAdjust { value: ValueRef, current_ty: ValueType, result: ValueRef, new_ty: ValueType },
| ^^^^^^^^^^
134 | GetField { result: ValueRef, object: ValueRef, field_desc: LayoutFieldRef },
| ^^^^^^^^
135 | SetField { target: ValueRef, value: ValueRef, field_desc: LayoutFieldRef },
| ^^^^^^^^
136 | Alloc { result: ValueRef, layout_id: LayoutId },
| ^^^^^
137 | Dealloc { value: ValueRef },
| ^^^^^^^
138 | CallImport { result: Option, name: String, sig: (Vec, Option), args: Vec },
| ^^^^^^^^^^
139 | Return,
| ^^^^^^
|
= note: `Instruction` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: method `instructions` is never used
--> src/compiler/mod.rs:158:16
|
147 | impl Block {
| ---------- method in this implementation
...
158 | pub fn instructions(&self) -> &[Instruction] {
| ^^^^^^^^^^^^
warning: method `as_usize` is never used
--> src/compiler/mod.rs:167:16
|
166 | impl LayoutId {
| ------------- method in this implementation
167 | pub fn as_usize(&self) -> usize {
| ^^^^^^^^
warning: associated items `new` and `add_field` are never used
--> src/compiler/mod.rs:181:16
|
180 | impl Layout {
| ----------- associated items in this implementation
181 | pub fn new() -> Self {
| ^^^
...
187 | pub fn add_field(&mut self, field_layout: LayoutFieldRef) {
| ^^^^^^^^^
warning: constant `OBJ_HEADER_ZVM_LAYOUT_ID` is never used
--> src/compiler/mod.rs:222:22
|
222 | pub(crate) const OBJ_HEADER_ZVM_LAYOUT_ID: LayoutFieldRef = LayoutFieldRef {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: constant `OBJ_HEADER_CLASSFILE_REF` is never used
--> src/compiler/mod.rs:228:22
|
228 | pub(crate) const OBJ_HEADER_CLASSFILE_REF: LayoutFieldRef = LayoutFieldRef {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: associated function `new` is never used
--> src/compiler/mod.rs:241:16
|
240 | impl LayoutsInfo {
| ---------------- associated function in this implementation
241 | pub fn new() -> Self {
| ^^^
warning: variants `InvalidLoad`, `InvalidSignature`, and `InvalidTypeAdjust` are never constructed
--> src/compiler/mod.rs:285:9
|
284 | pub enum CompileError {
| ------------ variants in this enum
285 | InvalidLoad(&'static str),
| ^^^^^^^^^^^
286 | InvalidSignature(&'static str),
| ^^^^^^^^^^^^^^^^
287 | InvalidTypeAdjust(ValueRef, ValueType, ValueRef, ValueType),
| ^^^^^^^^^^^^^^^^^
|
= note: `CompileError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: variant `UnsupportedInstruction` is never constructed
--> src/compiler/mod.rs:294:9
|
293 | pub enum TranslationError {
| ---------------- variant in this enum
294 | UnsupportedInstruction(crate::class_file::validated::Instruction),
| ^^^^^^^^^^^^^^^^^^^^^^
warning: `extern` fn uses type `LayoutId`, which is not FFI-safe
--> src/virtual_machine.rs:2705:43
|
2705 | extern "C" fn zvm_layout_id(&self) -> crate::compiler::ir::LayoutId {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
note: the type is defined here
--> src/compiler/mod.rs:164:5
|
164 | pub struct LayoutId(pub usize);
| ^^^^^^^^^^^^^^^^^^^
= note: `#[warn(improper_ctypes_definitions)]` on by default
warning: `extern` fn uses type `Arc`, which is not FFI-safe
--> src/virtual_machine.rs:2714:40
|
2714 | extern "C" fn zvm_vtable(&self) -> Arc {
| ^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
warning: unused `std::result::Result` that must be used
--> src/compiler/mod.rs:1407:5
|
1407 | / rt_info.declare_layout({
1408 | | let mut layout = ir::Layout::new();
1409 | | layout.add_field(ir::LayoutFieldRef {
1410 | | offset: 0,
... |
1419 | | layout
1420 | | }, "java/lang/Integer".to_string());
| |_______________________________________^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
1407 | let _ = rt_info.declare_layout({
| +++++++
warning: unused `std::result::Result` that must be used
--> src/compiler/mod.rs:1422:9
|
1422 | / rt_info.declare_layout({
1423 | | let mut layout = ir::Layout::new();
1424 | | let mut offset = 0;
1425 | | for f in cls.fields.iter() {
... |
1433 | | layout
1434 | | }, cls.this_class.to_string());
| |______________________________________^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
1422 | let _ = rt_info.declare_layout({
| +++++++
warning: `zvm` (lib) generated 86 warnings (run `cargo fix --lib -p zvm` to apply 43 suggestions)
Compiling zvm-cli v0.1.0 (/home/iximeow/nvme0/ci.butactuallyin.space/tmpdir/zvm-cli)
Finished dev [unoptimized + debuginfo] target(s) in 1.08s
Tue, 18 Jul 2023 05:35:13 +0000
step:
cargo test --workspace log (stdout)
running 4 tests
test compiler::test_translator ... ok
test compiler::test_field_access ... ok
test compiler::test_add_args ... ok
test compiler::test_object_return ... ok
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Tue, 18 Jul 2023 05:35:13 +0000
step:
cargo test --workspace log (stderr)
warning: unused import: `std::cell::RefCell`
--> src/virtual_machine/jvm/synthetic.rs:1:5
|
1 | use std::cell::RefCell;
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `attribute::Attribute`
--> src/virtual_machine/jvm/synthetic.rs:7:38
|
7 | use crate::class_file::unvalidated::{attribute::Attribute, AttributeInfo, MethodAccessFlags, MethodInfo};
| ^^^^^^^^^^^^^^^^^^^^
warning: unused import: `ValueRef`
--> src/virtual_machine/jvm/synthetic.rs:9:77
|
9 | use crate::virtual_machine::{ClassFile, ClassFileRef, UnvalidatedClassFile, ValueRef};
| ^^^^^^^^
warning: unused import: `NativeObject`
--> src/virtual_machine/jvm/synthetic.rs:10:73
|
10 | use crate::virtual_machine::{MethodBody, JvmArray, JvmObject, JvmValue, NativeObject};
| ^^^^^^^^^^^^
warning: unused import: `std::collections::hash_map::Entry`
--> src/virtual_machine.rs:3575:17
|
3575 | use std::collections::hash_map::Entry;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `std::rc::Rc`
--> src/compiler/mod.rs:2:5
|
2 | use std::rc::Rc;
| ^^^^^^^^^^^
warning: unused import: `SimpleJvmValue`
--> src/compiler/mod.rs:9:13
|
9 | use crate::{SimpleJvmValue, VirtualMachine, VMState};
| ^^^^^^^^^^^^^^
warning: unused import: `std::cell::RefCell`
--> src/compiler/mod.rs:1113:5
|
1113 | use std::cell::RefCell;
| ^^^^^^^^^^^^^^^^^^
warning: unused import: `std::borrow::Borrow`
--> src/compiler/mod.rs:1151:5
|
1151 | use std::borrow::Borrow;
| ^^^^^^^^^^^^^^^^^^^
warning: unreachable expression
--> src/virtual_machine/jvm/synthetic.rs:1154:9
|
1153 | let data: &[u8] = panic!("get string somehow");
| ---------------------------- any code following this expression is unreachable
1154 | / match &data[..] {
1155 | | b"file.encoding" => {
1156 | | ValueImpl::string(vm, "UTF-8")
1157 | | }
... |
1162 | | }
1163 | | }
| |_________^ unreachable expression
|
= note: `#[warn(unreachable_code)]` on by default
warning: unreachable statement
--> src/virtual_machine/jvm/synthetic.rs:1168:5
|
1165 | panic!("invalid argument for getProperty {:?}", argument);
| --------------------------------------------------------- any code following this expression is unreachable
...
1168 | state.current_frame_mut().operand_stack.push(property);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
warning: unreachable statement
--> src/virtual_machine/jvm/synthetic.rs:1202:9
|
1199 | panic!("todo: turn class name array into a real string");
| -------------------------------------------------------- any code following this expression is unreachable
...
1202 | / state.current_frame_mut()
1203 | | .operand_stack
1204 | | .push(ValueImpl::array_with_data(
1205 | | vm.resolve_class(class_name_string).expect("TODO: need to fish out the right string from `cls`."),
1206 | | elems.into_boxed_slice(),
1207 | | ));
| |_______________^ unreachable statement
warning: unreachable call
--> src/virtual_machine.rs:2765:61
|
2765 | let layout_id = ZVM.as_ref().unwrap().layouts().get_layout_id(panic!("&class_file.this_name")).expect("TODO: class exists");
| ^^^^^^^^^^^^^ ------------------------------- any code following this expression is unreachable
| |
| unreachable call
warning: unreachable expression
--> src/virtual_machine.rs:2950:9
|
2950 | / Self {
2951 | | cls: class_file,
2952 | | data: panic!("todo: do something with argument")
| | ------------------------------------------ any code following this expression is unreachable
2953 | | }
| |_________^ unreachable expression
warning: unused variable: `bytecode`
--> src/class_file/unvalidated/class.rs:180:9
|
180 | bytecode: Option>,
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_bytecode`
|
= note: `#[warn(unused_variables)]` on by default
warning: variable does not need to be mutable
--> src/class_file/unvalidated/class.rs:183:13
|
183 | let mut attributes = Vec::new();
| ----^^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: variable does not need to be mutable
--> src/class_file/unvalidated/class.rs:209:9
|
209 | mut self,
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:167:20
|
167 | pub fn extends(mut self, name: &str) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:175:24
|
175 | pub fn with_method(mut self, name: &str, sig: &str, native: Option>) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:178:13
|
178 | let mut bytecode_methods = self.bytecode_methods;
| ----^^^^^^^^^^^^^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:224:23
|
224 | pub fn with_field(mut self, name: &str, sig: &str) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:243:13
|
243 | let mut cls = ClassFile::validate(&self.cls).unwrap();
| ----^^^
| |
| help: remove this `mut`
warning: unused variable: `obj`
--> src/virtual_machine/jvm/synthetic.rs:427:24
|
427 | } else if let Some(obj) = argument.as_object() {
| ^^^ help: if this is intentional, prefix it with an underscore: `_obj`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:595:71
|
595 | fn object_equals(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `property`
--> src/virtual_machine/jvm/synthetic.rs:1152:9
|
1152 | let property = if argument.as_type("java/lang/String").is_some() {
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_property`
warning: unused variable: `data`
--> src/virtual_machine/jvm/synthetic.rs:1153:13
|
1153 | let data: &[u8] = panic!("get string somehow");
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:1145:77
|
1145 | fn system_get_property(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `class_name_string`
--> src/virtual_machine/jvm/synthetic.rs:1194:13
|
1194 | let class_name_string = {
| ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_class_name_string`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:1172:72
|
1172 | fn array_newarray(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `frame`
--> src/virtual_machine.rs:365:13
|
365 | let frame = self.current_frame();
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_frame`
warning: unused variable: `layout_id`
--> src/virtual_machine.rs:2765:17
|
2765 | let layout_id = ZVM.as_ref().unwrap().layouts().get_layout_id(panic!("&class_file.this_name")).expect("TODO: class exists");
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_layout_id`
warning: unused variable: `classfile_ptr`
--> src/virtual_machine.rs:2770:17
|
2770 | let classfile_ptr = Arc::into_raw(class_file);
| ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_classfile_ptr`
warning: unused variable: `class_file`
--> src/virtual_machine.rs:2897:18
|
2897 | fn new_array(class_file: Arc, data: Box<[NativeJvmValue]>) -> Self {
| ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_class_file`
warning: unused variable: `data`
--> src/virtual_machine.rs:2897:46
|
2897 | fn new_array(class_file: Arc, data: Box<[NativeJvmValue]>) -> Self {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `idx`
--> src/virtual_machine.rs:2931:24
|
2931 | fn get_elem(&self, idx: usize) -> Option<&SimpleJvmValue> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_idx`
warning: unused variable: `idx`
--> src/virtual_machine.rs:2934:28
|
2934 | fn get_elem_mut(&self, idx: usize) -> Option<&mut SimpleJvmValue> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_idx`
warning: unused variable: `data`
--> src/virtual_machine.rs:2949:46
|
2949 | fn new_array(class_file: Arc, data: Box<[SimpleJvmValue]>) -> Self {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `v`
--> src/virtual_machine.rs:3104:14
|
3104 | fn float(v: f32) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_v`
warning: unused variable: `v`
--> src/virtual_machine.rs:3108:15
|
3108 | fn double(v: f64) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_v`
warning: unused variable: `s`
--> src/virtual_machine.rs:3112:13
|
3112 | fn null(s: String) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_s`
warning: variable does not need to be mutable
--> src/virtual_machine.rs:3272:13
|
3272 | let mut obj = Self::ObjectTy::new_inst(class_file);
| ----^^^
| |
| help: remove this `mut`
warning: unused variable: `managed_alloc_name`
--> src/compiler/mod.rs:467:17
|
467 | let managed_alloc_name = ExternalName::User { namespace: 0, index: 0 };
| ^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_managed_alloc_name`
warning: unused variable: `other`
--> src/compiler/mod.rs:567:29
|
567 | ... other => { return Err(ir::CompileError::InvalidSignature("managed alloc returned multiple values?")); }
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`
warning: unused variable: `value`
--> src/compiler/mod.rs:571:48
|
571 | ir::Instruction::Dealloc { value } => {
| ^^^^^ help: try ignoring the field: `value: _`
warning: unused variable: `name`
--> src/compiler/mod.rs:574:59
|
574 | ir::Instruction::CallImport { result, name, sig, args } => {
| ^^^^ help: try ignoring the field: `name: _`
warning: unused variable: `ret`
--> src/compiler/mod.rs:576:51
|
576 | let returns = if let Some(ret) = sig.1 {
| ^^^ help: if this is intentional, prefix it with an underscore: `_ret`
warning: unused variable: `other`
--> src/compiler/mod.rs:616:29
|
616 | ... other => { return Err(ir::CompileError::InvalidSignature("call returned multiple values?")); }
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`
warning: unused variable: `i`
--> src/compiler/mod.rs:1421:10
|
1421 | for (i, cls) in extra_classes.iter().enumerate() {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
warning: field `attributes` is never read
--> src/class_file/unvalidated/field.rs:46:16
|
42 | pub struct FieldInfo {
| --------- field in this struct
...
46 | pub(crate) attributes: Vec,
| ^^^^^^^^^^
|
= note: `FieldInfo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
warning: field `max_stack` is never read
--> src/class_file/validated/method.rs:25:16
|
24 | pub struct MethodBody {
| ---------- field in this struct
25 | pub(crate) max_stack: u16,
| ^^^^^^^^^
|
= note: `MethodBody` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: field `layout_id` is never read
--> src/virtual_machine.rs:2729:5
|
2728 | struct ZvmObjectVTable {
| --------------- field in this struct
2729 | layout_id: crate::compiler::ir::LayoutId,
| ^^^^^^^^^
warning: field `data` is never read
--> src/virtual_machine.rs:2849:5
|
2845 | pub struct NativeJvmArrayData {
| ------------------ field in this struct
...
2849 | data: [NativeJvmValue; 1]
| ^^^^
warning: associated function `of` is never used
--> src/virtual_machine.rs:3341:12
|
3340 | impl ValueRef {
| --------------------------------------------- associated function in this implementation
3341 | pub fn of(reference: &ValueImpl) -> Self {
| ^^
warning: methods `has_instance_field`, `get_instance_field`, and `put_instance_field` are never used
--> src/virtual_machine.rs:3455:8
|
3442 | impl VirtualMachine {
| --------------------------------------------------- methods in this implementation
...
3455 | fn has_instance_field(
| ^^^^^^^^^^^^^^^^^^
...
3487 | fn get_instance_field(
| ^^^^^^^^^^^^^^^^^^
...
3503 | fn put_instance_field(
| ^^^^^^^^^^^^^^^^^^
warning: fields `bytes` and `len` are never read
--> src/compiler/mod.rs:313:5
|
312 | pub struct FunctionEmitter {
| --------------- fields in this struct
313 | bytes: *mut u8,
| ^^^^^
314 | len: usize,
| ^^^
warning: methods `data_mut`, `data`, `link`, and `finalize` are never used
--> src/compiler/mod.rs:318:8
|
317 | impl FunctionEmitter {
| -------------------- methods in this implementation
318 | fn data_mut(&mut self) -> &mut [u8] {
| ^^^^^^^^
...
323 | fn data(&self) -> &[u8] {
| ^^^^
...
328 | fn link(&mut self, relocs: &[cranelift_codegen::MachReloc], rt_info: &dyn RuntimeInfo) -> Result<(), crate::compiler::ir::CompileErro...
| ^^^^
...
346 | fn finalize(self) -> (*mut u8, usize) {
| ^^^^^^^^
warning: struct `CompiledMethod` is never constructed
--> src/compiler/mod.rs:360:12
|
360 | pub struct CompiledMethod {
| ^^^^^^^^^^^^^^
warning: methods `data_mut` and `data` are never used
--> src/compiler/mod.rs:369:8
|
368 | impl CompiledMethod {
| ------------------- methods in this implementation
369 | fn data_mut(&mut self) -> &mut [u8] {
| ^^^^^^^^
...
374 | fn data(&self) -> &[u8] {
| ^^^^
warning: fields `arguments`, `locals`, `blocks`, and `returns` are never read
--> src/compiler/mod.rs:383:5
|
382 | pub struct ZvmMethod {
| --------- fields in this struct
383 | arguments: Vec,
| ^^^^^^^^^
384 | locals: Vec,
| ^^^^^^
385 | blocks: Vec,
| ^^^^^^
386 | returns: Option,
| ^^^^^^^
|
= note: `ZvmMethod` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: method `compile` is never used
--> src/compiler/mod.rs:416:12
|
415 | impl ZvmMethod {
| -------------- method in this implementation
416 | pub fn compile(&self, rt_info: &dyn RuntimeInfo) -> Result {
| ^^^^^^^
warning: fields `blocks` and `layouts` are never read
--> src/compiler/mod.rs:722:5
|
720 | struct TranslatorState<'layouts> {
| --------------- fields in this struct
721 | current_block: ir::Block,
722 | blocks: Vec,
| ^^^^^^
...
728 | layouts: &'layouts ir::LayoutsInfo,
| ^^^^^^^
|
= note: `TranslatorState` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: function `desc_to_ir_valuety` is never used
--> src/compiler/mod.rs:863:4
|
863 | fn desc_to_ir_valuety(desc: &str) -> ir::ValueType {
| ^^^^^^^^^^^^^^^^^^
warning: function `bytecode2ir` is never used
--> src/compiler/mod.rs:871:8
|
871 | pub fn bytecode2ir(rt_info: &mut dyn RuntimeInfo, method: &MethodBody, sig: (Vec, Option)) -> Result src/compiler/mod.rs:1122:5
|
1119 | pub struct StructLayout {
| ------------ field in this struct
...
1122 | layout_id: u64,
| ^^^^^^^^^
warning: associated function `init` is never used
--> src/compiler/mod.rs:1154:12
|
1153 | impl ZvmRuntime {
| --------------- associated function in this implementation
1154 | pub fn init() -> Self {
| ^^^^
warning: function `jit` is never used
--> src/compiler/mod.rs:1398:4
|
1398 | fn jit(args: &[i64], instructions: Vec, signature: &'static str, extra_classes: Vec>, rt_info: &mu...
| ^^^
warning: function `jitcall` is never used
--> src/compiler/mod.rs:1471:4
|
1471 | fn jitcall(args: &[i64], code: fn(i64, i64, i64, i64, i64, i64) -> i64) -> i64 {
| ^^^^^^^
warning: variants `Argument`, `Local`, and `Const` are never constructed
--> src/compiler/mod.rs:17:9
|
16 | pub enum Value {
| ----- variants in this enum
17 | Argument(Argument),
| ^^^^^^^^
18 | Local(Local),
| ^^^^^
19 | Const(Const),
| ^^^^^
|
= note: `Value` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: multiple variants are never constructed
--> src/compiler/mod.rs:34:9
|
33 | pub enum Const {
| ----- variants in this enum
34 | Byte(i8),
| ^^^^
35 | Short(i16),
| ^^^^^
36 | Int(i32),
| ^^^
37 | Long(i64),
| ^^^^
38 | Float(f32),
| ^^^^^
39 | Double(f64),
| ^^^^^^
40 | Null,
| ^^^^
|
= note: `Const` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: variants `Byte` and `Short` are never constructed
--> src/compiler/mod.rs:45:9
|
44 | pub enum ValueType {
| --------- variants in this enum
45 | Byte,
| ^^^^
46 | Short,
| ^^^^^
|
= note: `ValueType` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
warning: variant `Const` is never constructed
--> src/compiler/mod.rs:88:9
|
85 | pub enum ValuePool {
| --------- variant in this enum
...
88 | Const,
| ^^^^^
|
= note: `ValuePool` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
warning: associated function `constant` is never used
--> src/compiler/mod.rs:112:16
|
97 | impl ValueRef {
| ------------- associated function in this implementation
...
112 | pub fn constant(id: usize) -> Self {
| ^^^^^^^^
warning: struct `FunctionRef` is never constructed
--> src/compiler/mod.rs:120:12
|
120 | struct FunctionRef {
| ^^^^^^^^^^^
warning: multiple variants are never constructed
--> src/compiler/mod.rs:127:9
|
125 | pub enum Instruction {
| ----------- variants in this enum
126 | LoadArg { result: ValueRef, source: ValueRef, id: usize },
127 | ConstInt { result: ValueRef, value: i32 },
| ^^^^^^^^
128 | ConstLong { result: ValueRef, value: i64 },
| ^^^^^^^^^
129 | IntAdd { result: ValueRef, left: ValueRef, right: ValueRef },
| ^^^^^^
130 | IntXor { result: ValueRef, left: ValueRef, right: ValueRef },
| ^^^^^^
131 | AReturn { retval: ValueRef },
| ^^^^^^^
132 | IReturn { retval: ValueRef },
| ^^^^^^^
133 | TypeAdjust { value: ValueRef, current_ty: ValueType, result: ValueRef, new_ty: ValueType },
| ^^^^^^^^^^
134 | GetField { result: ValueRef, object: ValueRef, field_desc: LayoutFieldRef },
| ^^^^^^^^
135 | SetField { target: ValueRef, value: ValueRef, field_desc: LayoutFieldRef },
| ^^^^^^^^
136 | Alloc { result: ValueRef, layout_id: LayoutId },
| ^^^^^
137 | Dealloc { value: ValueRef },
| ^^^^^^^
138 | CallImport { result: Option, name: String, sig: (Vec, Option), args: Vec },
| ^^^^^^^^^^
139 | Return,
| ^^^^^^
|
= note: `Instruction` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: method `instructions` is never used
--> src/compiler/mod.rs:158:16
|
147 | impl Block {
| ---------- method in this implementation
...
158 | pub fn instructions(&self) -> &[Instruction] {
| ^^^^^^^^^^^^
warning: method `as_usize` is never used
--> src/compiler/mod.rs:167:16
|
166 | impl LayoutId {
| ------------- method in this implementation
167 | pub fn as_usize(&self) -> usize {
| ^^^^^^^^
warning: associated items `new` and `add_field` are never used
--> src/compiler/mod.rs:181:16
|
180 | impl Layout {
| ----------- associated items in this implementation
181 | pub fn new() -> Self {
| ^^^
...
187 | pub fn add_field(&mut self, field_layout: LayoutFieldRef) {
| ^^^^^^^^^
warning: constant `OBJ_HEADER_ZVM_LAYOUT_ID` is never used
--> src/compiler/mod.rs:222:22
|
222 | pub(crate) const OBJ_HEADER_ZVM_LAYOUT_ID: LayoutFieldRef = LayoutFieldRef {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: constant `OBJ_HEADER_CLASSFILE_REF` is never used
--> src/compiler/mod.rs:228:22
|
228 | pub(crate) const OBJ_HEADER_CLASSFILE_REF: LayoutFieldRef = LayoutFieldRef {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: associated function `new` is never used
--> src/compiler/mod.rs:241:16
|
240 | impl LayoutsInfo {
| ---------------- associated function in this implementation
241 | pub fn new() -> Self {
| ^^^
warning: variants `InvalidLoad`, `InvalidSignature`, and `InvalidTypeAdjust` are never constructed
--> src/compiler/mod.rs:285:9
|
284 | pub enum CompileError {
| ------------ variants in this enum
285 | InvalidLoad(&'static str),
| ^^^^^^^^^^^
286 | InvalidSignature(&'static str),
| ^^^^^^^^^^^^^^^^
287 | InvalidTypeAdjust(ValueRef, ValueType, ValueRef, ValueType),
| ^^^^^^^^^^^^^^^^^
|
= note: `CompileError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: variant `UnsupportedInstruction` is never constructed
--> src/compiler/mod.rs:294:9
|
293 | pub enum TranslationError {
| ---------------- variant in this enum
294 | UnsupportedInstruction(crate::class_file::validated::Instruction),
| ^^^^^^^^^^^^^^^^^^^^^^
warning: `extern` fn uses type `LayoutId`, which is not FFI-safe
--> src/virtual_machine.rs:2705:43
|
2705 | extern "C" fn zvm_layout_id(&self) -> crate::compiler::ir::LayoutId {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
note: the type is defined here
--> src/compiler/mod.rs:164:5
|
164 | pub struct LayoutId(pub usize);
| ^^^^^^^^^^^^^^^^^^^
= note: `#[warn(improper_ctypes_definitions)]` on by default
warning: `extern` fn uses type `Arc`, which is not FFI-safe
--> src/virtual_machine.rs:2714:40
|
2714 | extern "C" fn zvm_vtable(&self) -> Arc {
| ^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
warning: unused `std::result::Result` that must be used
--> src/compiler/mod.rs:1407:5
|
1407 | / rt_info.declare_layout({
1408 | | let mut layout = ir::Layout::new();
1409 | | layout.add_field(ir::LayoutFieldRef {
1410 | | offset: 0,
... |
1419 | | layout
1420 | | }, "java/lang/Integer".to_string());
| |_______________________________________^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
1407 | let _ = rt_info.declare_layout({
| +++++++
warning: unused `std::result::Result` that must be used
--> src/compiler/mod.rs:1422:9
|
1422 | / rt_info.declare_layout({
1423 | | let mut layout = ir::Layout::new();
1424 | | let mut offset = 0;
1425 | | for f in cls.fields.iter() {
... |
1433 | | layout
1434 | | }, cls.this_class.to_string());
| |______________________________________^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
1422 | let _ = rt_info.declare_layout({
| +++++++
Compiling zvm v0.1.0 (/home/iximeow/nvme0/ci.butactuallyin.space/tmpdir)
warning: `zvm` (lib) generated 86 warnings (run `cargo fix --lib -p zvm` to apply 43 suggestions)
Compiling zvm-cli v0.1.0 (/home/iximeow/nvme0/ci.butactuallyin.space/tmpdir/zvm-cli)
Compiling zvm-stdlib v0.1.0 (/home/iximeow/nvme0/ci.butactuallyin.space/tmpdir/zvm-stdlib)
Compiling zvm-tools v0.1.0 (/home/iximeow/nvme0/ci.butactuallyin.space/tmpdir/zvm-tools)
warning: method `data` is never used
--> src/compiler/mod.rs:323:8
|
317 | impl FunctionEmitter {
| -------------------- method in this implementation
...
323 | fn data(&self) -> &[u8] {
| ^^^^
warning: field `relocs` is never read
--> src/compiler/mod.rs:363:5
|
360 | pub struct CompiledMethod {
| -------------- field in this struct
...
363 | relocs: Box<[cranelift_codegen::MachReloc]>,
| ^^^^^^
warning: method `data_mut` is never used
--> src/compiler/mod.rs:369:8
|
368 | impl CompiledMethod {
| ------------------- method in this implementation
369 | fn data_mut(&mut self) -> &mut [u8] {
| ^^^^^^^^
warning: field `blocks` is never read
--> src/compiler/mod.rs:722:5
|
720 | struct TranslatorState<'layouts> {
| --------------- field in this struct
721 | current_block: ir::Block,
722 | blocks: Vec,
| ^^^^^^
|
= note: `TranslatorState` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: variant `Dealloc` is never constructed
--> src/compiler/mod.rs:137:9
|
125 | pub enum Instruction {
| ----------- variant in this enum
...
137 | Dealloc { value: ValueRef },
| ^^^^^^^
|
= note: `Instruction` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: variant `InvalidLoad` is never constructed
--> src/compiler/mod.rs:285:9
|
284 | pub enum CompileError {
| ------------ variant in this enum
285 | InvalidLoad(&'static str),
| ^^^^^^^^^^^
|
= note: `CompileError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: `zvm` (lib test) generated 72 warnings (66 duplicates)
Finished test [unoptimized + debuginfo] target(s) in 2.26s
Running unittests src/lib.rs (target/debug/deps/zvm-b75fae38f372d1bb)
Running unittests src/main.rs (target/debug/deps/zvm-1a2c3317e0b8e190)
Running unittests src/lib.rs (target/debug/deps/zvm_stdlib-539f5ff70b39f85c)
Running unittests src/class_info.rs (target/debug/deps/zvm_class_info-1fcbb5863be8cea1)
Doc-tests zvm
Tue, 18 Jul 2023 05:35:16 +0000
step:
cargo build -p zvm --release log (stdout)
Tue, 18 Jul 2023 05:35:16 +0000
step:
cargo build -p zvm --release log (stderr)
Compiling autocfg v1.1.0
Compiling cfg-if v1.0.0
Compiling log v0.4.17
Compiling libc v0.2.126
Compiling smallvec v1.9.0
Compiling proc-macro2 v1.0.42
Compiling cranelift-isle v0.86.1
Compiling parking_lot_core v0.8.5
Compiling byteorder v1.3.2
Compiling unicode-ident v1.0.2
Compiling quote v1.0.20
Compiling cranelift-codegen-shared v0.86.1
Compiling syn v1.0.98
Compiling scopeguard v1.1.0
Compiling serde_derive v1.0.140
Compiling serde v1.0.140
Compiling target-lexicon v0.12.4
Compiling hashbrown v0.12.3
Compiling cranelift-entity v0.86.1
Compiling lazy_static v1.4.0
Compiling bitflags v1.3.2
Compiling slice-group-by v0.3.0
Compiling yaxpeax-x86 v1.1.4
Compiling instant v0.1.12
Compiling cranelift-codegen-meta v0.86.1
Compiling cranelift-bforest v0.86.1
Compiling lock_api v0.4.7
Compiling indexmap v1.9.1
Compiling num-traits v0.2.15
Compiling fxhash v0.2.1
Compiling regalloc2 v0.3.1
Compiling mio v0.7.14
Compiling signal-hook-registry v1.4.0
Compiling gimli v0.26.2
Compiling signal-hook v0.1.17
Compiling parking_lot v0.11.2
Compiling crossterm v0.19.0
Compiling cranelift-codegen v0.86.1
Compiling yaxpeax-arch v0.2.7
Compiling cranelift-frontend v0.86.1
Compiling zvm v0.1.0 (/home/iximeow/nvme0/ci.butactuallyin.space/tmpdir)
warning: unused import: `std::cell::RefCell`
--> src/virtual_machine/jvm/synthetic.rs:1:5
|
1 | use std::cell::RefCell;
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `attribute::Attribute`
--> src/virtual_machine/jvm/synthetic.rs:7:38
|
7 | use crate::class_file::unvalidated::{attribute::Attribute, AttributeInfo, MethodAccessFlags, MethodInfo};
| ^^^^^^^^^^^^^^^^^^^^
warning: unused import: `ValueRef`
--> src/virtual_machine/jvm/synthetic.rs:9:77
|
9 | use crate::virtual_machine::{ClassFile, ClassFileRef, UnvalidatedClassFile, ValueRef};
| ^^^^^^^^
warning: unused import: `NativeObject`
--> src/virtual_machine/jvm/synthetic.rs:10:73
|
10 | use crate::virtual_machine::{MethodBody, JvmArray, JvmObject, JvmValue, NativeObject};
| ^^^^^^^^^^^^
warning: unused import: `std::collections::hash_map::Entry`
--> src/virtual_machine.rs:3575:17
|
3575 | use std::collections::hash_map::Entry;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `std::rc::Rc`
--> src/compiler/mod.rs:2:5
|
2 | use std::rc::Rc;
| ^^^^^^^^^^^
warning: unused import: `SimpleJvmValue`
--> src/compiler/mod.rs:9:13
|
9 | use crate::{SimpleJvmValue, VirtualMachine, VMState};
| ^^^^^^^^^^^^^^
warning: unused import: `std::cell::RefCell`
--> src/compiler/mod.rs:1113:5
|
1113 | use std::cell::RefCell;
| ^^^^^^^^^^^^^^^^^^
warning: unused import: `std::borrow::Borrow`
--> src/compiler/mod.rs:1151:5
|
1151 | use std::borrow::Borrow;
| ^^^^^^^^^^^^^^^^^^^
warning: unreachable expression
--> src/virtual_machine/jvm/synthetic.rs:1154:9
|
1153 | let data: &[u8] = panic!("get string somehow");
| ---------------------------- any code following this expression is unreachable
1154 | / match &data[..] {
1155 | | b"file.encoding" => {
1156 | | ValueImpl::string(vm, "UTF-8")
1157 | | }
... |
1162 | | }
1163 | | }
| |_________^ unreachable expression
|
= note: `#[warn(unreachable_code)]` on by default
warning: unreachable statement
--> src/virtual_machine/jvm/synthetic.rs:1168:5
|
1165 | panic!("invalid argument for getProperty {:?}", argument);
| --------------------------------------------------------- any code following this expression is unreachable
...
1168 | state.current_frame_mut().operand_stack.push(property);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
warning: unreachable statement
--> src/virtual_machine/jvm/synthetic.rs:1202:9
|
1199 | panic!("todo: turn class name array into a real string");
| -------------------------------------------------------- any code following this expression is unreachable
...
1202 | / state.current_frame_mut()
1203 | | .operand_stack
1204 | | .push(ValueImpl::array_with_data(
1205 | | vm.resolve_class(class_name_string).expect("TODO: need to fish out the right string from `cls`."),
1206 | | elems.into_boxed_slice(),
1207 | | ));
| |_______________^ unreachable statement
warning: unreachable call
--> src/virtual_machine.rs:2765:61
|
2765 | let layout_id = ZVM.as_ref().unwrap().layouts().get_layout_id(panic!("&class_file.this_name")).expect("TODO: class exists");
| ^^^^^^^^^^^^^ ------------------------------- any code following this expression is unreachable
| |
| unreachable call
warning: unreachable expression
--> src/virtual_machine.rs:2950:9
|
2950 | / Self {
2951 | | cls: class_file,
2952 | | data: panic!("todo: do something with argument")
| | ------------------------------------------ any code following this expression is unreachable
2953 | | }
| |_________^ unreachable expression
warning: unused variable: `bytecode`
--> src/class_file/unvalidated/class.rs:180:9
|
180 | bytecode: Option>,
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_bytecode`
|
= note: `#[warn(unused_variables)]` on by default
warning: variable does not need to be mutable
--> src/class_file/unvalidated/class.rs:183:13
|
183 | let mut attributes = Vec::new();
| ----^^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: variable does not need to be mutable
--> src/class_file/unvalidated/class.rs:209:9
|
209 | mut self,
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:167:20
|
167 | pub fn extends(mut self, name: &str) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:175:24
|
175 | pub fn with_method(mut self, name: &str, sig: &str, native: Option>) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:178:13
|
178 | let mut bytecode_methods = self.bytecode_methods;
| ----^^^^^^^^^^^^^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:224:23
|
224 | pub fn with_field(mut self, name: &str, sig: &str) -> Self {
| ----^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/virtual_machine/jvm/synthetic.rs:243:13
|
243 | let mut cls = ClassFile::validate(&self.cls).unwrap();
| ----^^^
| |
| help: remove this `mut`
warning: unused variable: `obj`
--> src/virtual_machine/jvm/synthetic.rs:427:24
|
427 | } else if let Some(obj) = argument.as_object() {
| ^^^ help: if this is intentional, prefix it with an underscore: `_obj`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:595:71
|
595 | fn object_equals(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `property`
--> src/virtual_machine/jvm/synthetic.rs:1152:9
|
1152 | let property = if argument.as_type("java/lang/String").is_some() {
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_property`
warning: unused variable: `data`
--> src/virtual_machine/jvm/synthetic.rs:1153:13
|
1153 | let data: &[u8] = panic!("get string somehow");
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:1145:77
|
1145 | fn system_get_property(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `class_name_string`
--> src/virtual_machine/jvm/synthetic.rs:1194:13
|
1194 | let class_name_string = {
| ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_class_name_string`
warning: unused variable: `vm`
--> src/virtual_machine/jvm/synthetic.rs:1172:72
|
1172 | fn array_newarray(state: &mut VMState, vm: &mut VirtualMachine) -> Result<(), VMError> {
| ^^ help: if this is intentional, prefix it with an underscore: `_vm`
warning: unused variable: `frame`
--> src/virtual_machine.rs:365:13
|
365 | let frame = self.current_frame();
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_frame`
warning: unused variable: `layout_id`
--> src/virtual_machine.rs:2765:17
|
2765 | let layout_id = ZVM.as_ref().unwrap().layouts().get_layout_id(panic!("&class_file.this_name")).expect("TODO: class exists");
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_layout_id`
warning: unused variable: `classfile_ptr`
--> src/virtual_machine.rs:2770:17
|
2770 | let classfile_ptr = Arc::into_raw(class_file);
| ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_classfile_ptr`
warning: unused variable: `class_file`
--> src/virtual_machine.rs:2897:18
|
2897 | fn new_array(class_file: Arc, data: Box<[NativeJvmValue]>) -> Self {
| ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_class_file`
warning: unused variable: `data`
--> src/virtual_machine.rs:2897:46
|
2897 | fn new_array(class_file: Arc, data: Box<[NativeJvmValue]>) -> Self {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `idx`
--> src/virtual_machine.rs:2931:24
|
2931 | fn get_elem(&self, idx: usize) -> Option<&SimpleJvmValue> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_idx`
warning: unused variable: `idx`
--> src/virtual_machine.rs:2934:28
|
2934 | fn get_elem_mut(&self, idx: usize) -> Option<&mut SimpleJvmValue> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_idx`
warning: unused variable: `data`
--> src/virtual_machine.rs:2949:46
|
2949 | fn new_array(class_file: Arc, data: Box<[SimpleJvmValue]>) -> Self {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `v`
--> src/virtual_machine.rs:3104:14
|
3104 | fn float(v: f32) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_v`
warning: unused variable: `v`
--> src/virtual_machine.rs:3108:15
|
3108 | fn double(v: f64) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_v`
warning: unused variable: `s`
--> src/virtual_machine.rs:3112:13
|
3112 | fn null(s: String) -> Self {
| ^ help: if this is intentional, prefix it with an underscore: `_s`
warning: variable does not need to be mutable
--> src/virtual_machine.rs:3272:13
|
3272 | let mut obj = Self::ObjectTy::new_inst(class_file);
| ----^^^
| |
| help: remove this `mut`
warning: unused variable: `managed_alloc_name`
--> src/compiler/mod.rs:467:17
|
467 | let managed_alloc_name = ExternalName::User { namespace: 0, index: 0 };
| ^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_managed_alloc_name`
warning: unused variable: `other`
--> src/compiler/mod.rs:567:29
|
567 | ... other => { return Err(ir::CompileError::InvalidSignature("managed alloc returned multiple values?")); }
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`
warning: unused variable: `value`
--> src/compiler/mod.rs:571:48
|
571 | ir::Instruction::Dealloc { value } => {
| ^^^^^ help: try ignoring the field: `value: _`
warning: unused variable: `name`
--> src/compiler/mod.rs:574:59
|
574 | ir::Instruction::CallImport { result, name, sig, args } => {
| ^^^^ help: try ignoring the field: `name: _`
warning: unused variable: `ret`
--> src/compiler/mod.rs:576:51
|
576 | let returns = if let Some(ret) = sig.1 {
| ^^^ help: if this is intentional, prefix it with an underscore: `_ret`
warning: unused variable: `other`
--> src/compiler/mod.rs:616:29
|
616 | ... other => { return Err(ir::CompileError::InvalidSignature("call returned multiple values?")); }
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`
warning: unused variable: `i`
--> src/compiler/mod.rs:1421:10
|
1421 | for (i, cls) in extra_classes.iter().enumerate() {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
warning: field `attributes` is never read
--> src/class_file/unvalidated/field.rs:46:16
|
42 | pub struct FieldInfo {
| --------- field in this struct
...
46 | pub(crate) attributes: Vec,
| ^^^^^^^^^^
|
= note: `FieldInfo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
warning: field `max_stack` is never read
--> src/class_file/validated/method.rs:25:16
|
24 | pub struct MethodBody {
| ---------- field in this struct
25 | pub(crate) max_stack: u16,
| ^^^^^^^^^
|
= note: `MethodBody` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: field `layout_id` is never read
--> src/virtual_machine.rs:2729:5
|
2728 | struct ZvmObjectVTable {
| --------------- field in this struct
2729 | layout_id: crate::compiler::ir::LayoutId,
| ^^^^^^^^^
warning: field `data` is never read
--> src/virtual_machine.rs:2849:5
|
2845 | pub struct NativeJvmArrayData {
| ------------------ field in this struct
...
2849 | data: [NativeJvmValue; 1]
| ^^^^
warning: associated function `of` is never used
--> src/virtual_machine.rs:3341:12
|
3340 | impl ValueRef {
| --------------------------------------------- associated function in this implementation
3341 | pub fn of(reference: &ValueImpl) -> Self {
| ^^
warning: methods `has_instance_field`, `get_instance_field`, and `put_instance_field` are never used
--> src/virtual_machine.rs:3455:8
|
3442 | impl VirtualMachine {
| --------------------------------------------------- methods in this implementation
...
3455 | fn has_instance_field(
| ^^^^^^^^^^^^^^^^^^
...
3487 | fn get_instance_field(
| ^^^^^^^^^^^^^^^^^^
...
3503 | fn put_instance_field(
| ^^^^^^^^^^^^^^^^^^
warning: fields `bytes` and `len` are never read
--> src/compiler/mod.rs:313:5
|
312 | pub struct FunctionEmitter {
| --------------- fields in this struct
313 | bytes: *mut u8,
| ^^^^^
314 | len: usize,
| ^^^
warning: methods `data_mut`, `data`, `link`, and `finalize` are never used
--> src/compiler/mod.rs:318:8
|
317 | impl FunctionEmitter {
| -------------------- methods in this implementation
318 | fn data_mut(&mut self) -> &mut [u8] {
| ^^^^^^^^
...
323 | fn data(&self) -> &[u8] {
| ^^^^
...
328 | fn link(&mut self, relocs: &[cranelift_codegen::MachReloc], rt_info: &dyn RuntimeInfo) -> Result<(), crate::compiler::ir::CompileErro...
| ^^^^
...
346 | fn finalize(self) -> (*mut u8, usize) {
| ^^^^^^^^
warning: struct `CompiledMethod` is never constructed
--> src/compiler/mod.rs:360:12
|
360 | pub struct CompiledMethod {
| ^^^^^^^^^^^^^^
warning: methods `data_mut` and `data` are never used
--> src/compiler/mod.rs:369:8
|
368 | impl CompiledMethod {
| ------------------- methods in this implementation
369 | fn data_mut(&mut self) -> &mut [u8] {
| ^^^^^^^^
...
374 | fn data(&self) -> &[u8] {
| ^^^^
warning: fields `arguments`, `locals`, `blocks`, and `returns` are never read
--> src/compiler/mod.rs:383:5
|
382 | pub struct ZvmMethod {
| --------- fields in this struct
383 | arguments: Vec,
| ^^^^^^^^^
384 | locals: Vec,
| ^^^^^^
385 | blocks: Vec,
| ^^^^^^
386 | returns: Option,
| ^^^^^^^
|
= note: `ZvmMethod` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: method `compile` is never used
--> src/compiler/mod.rs:416:12
|
415 | impl ZvmMethod {
| -------------- method in this implementation
416 | pub fn compile(&self, rt_info: &dyn RuntimeInfo) -> Result {
| ^^^^^^^
warning: fields `blocks` and `layouts` are never read
--> src/compiler/mod.rs:722:5
|
720 | struct TranslatorState<'layouts> {
| --------------- fields in this struct
721 | current_block: ir::Block,
722 | blocks: Vec,
| ^^^^^^
...
728 | layouts: &'layouts ir::LayoutsInfo,
| ^^^^^^^
|
= note: `TranslatorState` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: function `desc_to_ir_valuety` is never used
--> src/compiler/mod.rs:863:4
|
863 | fn desc_to_ir_valuety(desc: &str) -> ir::ValueType {
| ^^^^^^^^^^^^^^^^^^
warning: function `bytecode2ir` is never used
--> src/compiler/mod.rs:871:8
|
871 | pub fn bytecode2ir(rt_info: &mut dyn RuntimeInfo, method: &MethodBody, sig: (Vec, Option)) -> Result src/compiler/mod.rs:1122:5
|
1119 | pub struct StructLayout {
| ------------ field in this struct
...
1122 | layout_id: u64,
| ^^^^^^^^^
warning: associated function `init` is never used
--> src/compiler/mod.rs:1154:12
|
1153 | impl ZvmRuntime {
| --------------- associated function in this implementation
1154 | pub fn init() -> Self {
| ^^^^
warning: function `jit` is never used
--> src/compiler/mod.rs:1398:4
|
1398 | fn jit(args: &[i64], instructions: Vec, signature: &'static str, extra_classes: Vec>, rt_info: &mu...
| ^^^
warning: function `jitcall` is never used
--> src/compiler/mod.rs:1471:4
|
1471 | fn jitcall(args: &[i64], code: fn(i64, i64, i64, i64, i64, i64) -> i64) -> i64 {
| ^^^^^^^
warning: variants `Argument`, `Local`, and `Const` are never constructed
--> src/compiler/mod.rs:17:9
|
16 | pub enum Value {
| ----- variants in this enum
17 | Argument(Argument),
| ^^^^^^^^
18 | Local(Local),
| ^^^^^
19 | Const(Const),
| ^^^^^
|
= note: `Value` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: multiple variants are never constructed
--> src/compiler/mod.rs:34:9
|
33 | pub enum Const {
| ----- variants in this enum
34 | Byte(i8),
| ^^^^
35 | Short(i16),
| ^^^^^
36 | Int(i32),
| ^^^
37 | Long(i64),
| ^^^^
38 | Float(f32),
| ^^^^^
39 | Double(f64),
| ^^^^^^
40 | Null,
| ^^^^
|
= note: `Const` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: variants `Byte` and `Short` are never constructed
--> src/compiler/mod.rs:45:9
|
44 | pub enum ValueType {
| --------- variants in this enum
45 | Byte,
| ^^^^
46 | Short,
| ^^^^^
|
= note: `ValueType` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
warning: variant `Const` is never constructed
--> src/compiler/mod.rs:88:9
|
85 | pub enum ValuePool {
| --------- variant in this enum
...
88 | Const,
| ^^^^^
|
= note: `ValuePool` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
warning: associated function `constant` is never used
--> src/compiler/mod.rs:112:16
|
97 | impl ValueRef {
| ------------- associated function in this implementation
...
112 | pub fn constant(id: usize) -> Self {
| ^^^^^^^^
warning: struct `FunctionRef` is never constructed
--> src/compiler/mod.rs:120:12
|
120 | struct FunctionRef {
| ^^^^^^^^^^^
warning: multiple variants are never constructed
--> src/compiler/mod.rs:127:9
|
125 | pub enum Instruction {
| ----------- variants in this enum
126 | LoadArg { result: ValueRef, source: ValueRef, id: usize },
127 | ConstInt { result: ValueRef, value: i32 },
| ^^^^^^^^
128 | ConstLong { result: ValueRef, value: i64 },
| ^^^^^^^^^
129 | IntAdd { result: ValueRef, left: ValueRef, right: ValueRef },
| ^^^^^^
130 | IntXor { result: ValueRef, left: ValueRef, right: ValueRef },
| ^^^^^^
131 | AReturn { retval: ValueRef },
| ^^^^^^^
132 | IReturn { retval: ValueRef },
| ^^^^^^^
133 | TypeAdjust { value: ValueRef, current_ty: ValueType, result: ValueRef, new_ty: ValueType },
| ^^^^^^^^^^
134 | GetField { result: ValueRef, object: ValueRef, field_desc: LayoutFieldRef },
| ^^^^^^^^
135 | SetField { target: ValueRef, value: ValueRef, field_desc: LayoutFieldRef },
| ^^^^^^^^
136 | Alloc { result: ValueRef, layout_id: LayoutId },
| ^^^^^
137 | Dealloc { value: ValueRef },
| ^^^^^^^
138 | CallImport { result: Option, name: String, sig: (Vec, Option), args: Vec },
| ^^^^^^^^^^
139 | Return,
| ^^^^^^
|
= note: `Instruction` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: method `instructions` is never used
--> src/compiler/mod.rs:158:16
|
147 | impl Block {
| ---------- method in this implementation
...
158 | pub fn instructions(&self) -> &[Instruction] {
| ^^^^^^^^^^^^
warning: method `as_usize` is never used
--> src/compiler/mod.rs:167:16
|
166 | impl LayoutId {
| ------------- method in this implementation
167 | pub fn as_usize(&self) -> usize {
| ^^^^^^^^
warning: associated items `new` and `add_field` are never used
--> src/compiler/mod.rs:181:16
|
180 | impl Layout {
| ----------- associated items in this implementation
181 | pub fn new() -> Self {
| ^^^
...
187 | pub fn add_field(&mut self, field_layout: LayoutFieldRef) {
| ^^^^^^^^^
warning: constant `OBJ_HEADER_ZVM_LAYOUT_ID` is never used
--> src/compiler/mod.rs:222:22
|
222 | pub(crate) const OBJ_HEADER_ZVM_LAYOUT_ID: LayoutFieldRef = LayoutFieldRef {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: constant `OBJ_HEADER_CLASSFILE_REF` is never used
--> src/compiler/mod.rs:228:22
|
228 | pub(crate) const OBJ_HEADER_CLASSFILE_REF: LayoutFieldRef = LayoutFieldRef {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: associated function `new` is never used
--> src/compiler/mod.rs:241:16
|
240 | impl LayoutsInfo {
| ---------------- associated function in this implementation
241 | pub fn new() -> Self {
| ^^^
warning: variants `InvalidLoad`, `InvalidSignature`, and `InvalidTypeAdjust` are never constructed
--> src/compiler/mod.rs:285:9
|
284 | pub enum CompileError {
| ------------ variants in this enum
285 | InvalidLoad(&'static str),
| ^^^^^^^^^^^
286 | InvalidSignature(&'static str),
| ^^^^^^^^^^^^^^^^
287 | InvalidTypeAdjust(ValueRef, ValueType, ValueRef, ValueType),
| ^^^^^^^^^^^^^^^^^
|
= note: `CompileError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: variant `UnsupportedInstruction` is never constructed
--> src/compiler/mod.rs:294:9
|
293 | pub enum TranslationError {
| ---------------- variant in this enum
294 | UnsupportedInstruction(crate::class_file::validated::Instruction),
| ^^^^^^^^^^^^^^^^^^^^^^
warning: `extern` fn uses type `LayoutId`, which is not FFI-safe
--> src/virtual_machine.rs:2705:43
|
2705 | extern "C" fn zvm_layout_id(&self) -> crate::compiler::ir::LayoutId {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
note: the type is defined here
--> src/compiler/mod.rs:164:5
|
164 | pub struct LayoutId(pub usize);
| ^^^^^^^^^^^^^^^^^^^
= note: `#[warn(improper_ctypes_definitions)]` on by default
warning: `extern` fn uses type `Arc`, which is not FFI-safe
--> src/virtual_machine.rs:2714:40
|
2714 | extern "C" fn zvm_vtable(&self) -> Arc {
| ^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
warning: unused `std::result::Result` that must be used
--> src/compiler/mod.rs:1407:5
|
1407 | / rt_info.declare_layout({
1408 | | let mut layout = ir::Layout::new();
1409 | | layout.add_field(ir::LayoutFieldRef {
1410 | | offset: 0,
... |
1419 | | layout
1420 | | }, "java/lang/Integer".to_string());
| |_______________________________________^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
1407 | let _ = rt_info.declare_layout({
| +++++++
warning: unused `std::result::Result` that must be used
--> src/compiler/mod.rs:1422:9
|
1422 | / rt_info.declare_layout({
1423 | | let mut layout = ir::Layout::new();
1424 | | let mut offset = 0;
1425 | | for f in cls.fields.iter() {
... |
1433 | | layout
1434 | | }, cls.this_class.to_string());
| |______________________________________^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
1422 | let _ = rt_info.declare_layout({
| +++++++
warning: `zvm` (lib) generated 86 warnings (run `cargo fix --lib -p zvm` to apply 43 suggestions)
Finished release [optimized] target(s) in 10.92s
metrics
| name | ivorytowerx86_64 Matisse @ 3.500GHz |
| rust version | rustc 1.72.0-nightly (8c74a5d27 2023-06-14)
|