Skip to content

Commit b0541bf

Browse files
committed
runtime: cleanup some warnings
1 parent 4ad70bf commit b0541bf

File tree

10 files changed

+10
-8
lines changed

10 files changed

+10
-8
lines changed

native/macros/src/call.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ pub fn generate(input: &ItemFn, no_env: bool, no_strict_types: bool) -> JniFn {
249249

250250
let extern_fn_def = generate_extern_fn(input, &params, return_ty, no_env);
251251
let extern_fn = quote! {
252+
#[allow(unused_imports)]
252253
mod #raw_mod_name {
253254
use super::*;
254255

native/macros/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ pub fn jni_fn_module(_attr: TokenStream, input: TokenStream) -> TokenStream {
8989
#(#items)*
9090

9191
/// Generated C bindings for sun.io.fs.UnixNativeDispatcher methods
92+
#[allow(unused_imports)]
9293
pub mod raw {
9394
#(#raw_mod_entries)*
9495
}

runtime/src/classes/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ macro_rules! field_constructor {
154154
}
155155

156156
let mut field_set = 0;
157+
158+
#[allow(unused_variables)]
157159
for field in class.fields() {
158160
crate::classes::field_constructor!(@CHECKS field, field_set, 0, $($field_tt)*);
159161
}
@@ -231,7 +233,7 @@ macro_rules! field_constructor {
231233
impl FieldNames {
232234
const VARIANTS: [FieldNames; $current_shift] = [];
233235

234-
fn find_missing(found: usize) -> [Option<FieldNames>; $current_shift] {
236+
fn find_missing(_found: usize) -> [Option<FieldNames>; $current_shift] {
235237
[]
236238
}
237239
}

runtime/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#![feature(try_with_capacity)]
99
#![feature(try_trait_v2)]
1010
#![feature(associated_type_defaults)]
11-
#![feature(ptr_as_ref_unchecked)]
1211
#![feature(iter_next_chunk)]
1312
#![feature(if_let_guard)]
1413
#![feature(reentrant_lock)]

runtime/src/native/jdk/internal/loader/NativeLibraries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn extract_and_verify_lib_name(name: Reference) -> Option<LibraryName> {
6666
}
6767

6868
fn find_jni_on_load<'a>(lib: &'a Library, name: Option<&str>) -> Option<Sym<'a, JniOnLoadFn>> {
69-
let mut on_load_sym = match name {
69+
let on_load_sym = match name {
7070
Some(name) => format!("JNI_OnLoad_{}\0", name).into_bytes(),
7171
None => String::from("JNI_OnLoad\0").into_bytes(),
7272
};

runtime/src/native/jvm/arrays.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use jni::env::JniEnv;
44
use jni::objects::{JClass, JIntArray, JObject};
5-
use jni::sys::{jbyte, jint, jvalue};
5+
use jni::sys::{jint, jvalue};
66
use native_macros::jni_call;
77
use std::ffi::c_uchar;
88

runtime/src/native/jvm/libraries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ pub extern "C" fn JVM_UnloadLibrary(_handle: *mut c_void) {
2323
}
2424

2525
#[jni_call(no_env, no_strict_types)]
26-
pub extern "C" fn JVM_FindLibraryEntry(_handle: *mut c_void, name: *const c_char) -> *mut c_void {
26+
pub extern "C" fn JVM_FindLibraryEntry(_handle: *mut c_void, _name: *const c_char) -> *mut c_void {
2727
todo!()
2828
}

runtime/src/native/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub(crate) fn lib_java() -> &'static Library {
4545
},
4646
);
4747

48-
unsafe { (&*LIB_JAVA.get()) }
48+
unsafe { &*LIB_JAVA.get() }
4949
.as_ref()
5050
.expect("Should be set at this point")
5151
}

runtime/src/stack/operand_stack.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::thread::exceptions::{Throws, throw};
44
use std::alloc;
55
use std::alloc::Layout;
66
use std::fmt::Debug;
7-
use std::mem::ManuallyDrop;
87

98
use common::int_types::{s4, s8};
109
use instructions::{Operand, StackLike};

runtime/src/thread/frame/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::objects::method::Method;
66
use crate::stack::local_stack::LocalStack;
77
use crate::stack::operand_stack::OperandStack;
88
use crate::thread::JavaThread;
9-
use crate::thread::exceptions::{ExceptionKind, Throws};
9+
use crate::thread::exceptions::Throws;
1010

1111
use std::cell::UnsafeCell;
1212
use std::fmt::{Debug, Formatter};

0 commit comments

Comments
 (0)