diff --git a/src/handle.rs b/src/handle.rs index 98c144f5..bc0aaaf6 100644 --- a/src/handle.rs +++ b/src/handle.rs @@ -397,6 +397,7 @@ impl HandleHost { ) } + #[allow(dead_code)] fn match_isolate(self, isolate: &mut Isolate) -> bool { self.match_host(isolate.into(), Some(isolate)) } @@ -413,6 +414,7 @@ impl HandleHost { } } + #[allow(dead_code)] fn get_isolate_handle(self) -> IsolateHandle { unsafe { self.get_isolate().as_ref() }.thread_safe_handle() } diff --git a/src/isolate.rs b/src/isolate.rs index c740822f..c150b6e9 100644 --- a/src/isolate.rs +++ b/src/isolate.rs @@ -379,12 +379,14 @@ impl Isolate { /// Retrieve embedder-specific data from the isolate. /// Returns NULL if SetData has never been called for the given `slot`. + #[allow(dead_code)] fn get_data(&self, slot: u32) -> *mut c_void { unsafe { v8__Isolate__GetData(self, slot + Self::INTERNAL_SLOT_COUNT) } } /// Returns the maximum number of available embedder data slots. Valid slots /// are in the range of 0 - `Isolate::get_number_of_data_slots() - 1`. + #[allow(dead_code)] fn get_number_of_data_slots(&self) -> u32 { unsafe { v8__Isolate__GetNumberOfDataSlots(self) - Self::INTERNAL_SLOT_COUNT diff --git a/src/lib.rs b/src/lib.rs index f4ceeb40..3a3421b5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,7 +3,6 @@ //! # Example //! //! ```rust -//! //! //! let platform = v8::new_default_platform(0, false).make_shared(); //! v8::V8::initialize_platform(platform); //! v8::V8::initialize(); @@ -24,13 +23,11 @@ //! ``` #![allow(clippy::missing_safety_doc)] -#![allow(dead_code)] #[macro_use] extern crate bitflags; #[macro_use] extern crate lazy_static; -extern crate libc; mod array_buffer; mod array_buffer_view; diff --git a/src/script_compiler.rs b/src/script_compiler.rs index 64bb29c5..2273187a 100644 --- a/src/script_compiler.rs +++ b/src/script_compiler.rs @@ -101,6 +101,7 @@ impl<'a> std::ops::Deref for CachedData<'a> { } } +#[allow(dead_code)] #[repr(C)] #[derive(Debug)] enum BufferPolicy { diff --git a/src/string.rs b/src/string.rs index 7c9ce45c..19a3f0ac 100644 --- a/src/string.rs +++ b/src/string.rs @@ -77,9 +77,11 @@ extern "C" { length: int, ) -> *const String; + #[allow(dead_code)] fn v8__String__IsExternal(this: *const String) -> bool; fn v8__String__IsExternalOneByte(this: *const String) -> bool; fn v8__String__IsExternalTwoByte(this: *const String) -> bool; + #[allow(dead_code)] fn v8__String__IsOneByte(this: *const String) -> bool; fn v8__String__ContainsOnlyOneByte(this: *const String) -> bool; } diff --git a/src/value.rs b/src/value.rs index d0be552a..34c4ac61 100644 --- a/src/value.rs +++ b/src/value.rs @@ -42,6 +42,7 @@ extern "C" { fn v8__Value__IsRegExp(this: *const Value) -> bool; fn v8__Value__IsAsyncFunction(this: *const Value) -> bool; fn v8__Value__IsGeneratorFunction(this: *const Value) -> bool; + #[allow(dead_code)] fn v8__Value__IsGeneratorObject(this: *const Value) -> bool; fn v8__Value__IsPromise(this: *const Value) -> bool; fn v8__Value__IsMap(this: *const Value) -> bool; diff --git a/src/value_deserializer.rs b/src/value_deserializer.rs index c8223eb5..dac5d469 100644 --- a/src/value_deserializer.rs +++ b/src/value_deserializer.rs @@ -150,11 +150,10 @@ extern "C" { /// The ValueDeserializerImpl trait allows for /// custom callback functions used by v8. pub trait ValueDeserializerImpl { - #[allow(unused_variables)] fn read_host_object<'s>( &mut self, scope: &mut HandleScope<'s>, - value_deserializer: &mut dyn ValueDeserializerHelper, + _value_deserializer: &mut dyn ValueDeserializerHelper, ) -> Option> { let msg = String::new(scope, "Deno deserializer: read_host_object not implemented") @@ -164,11 +163,10 @@ pub trait ValueDeserializerImpl { None } - #[allow(unused_variables)] fn get_shared_array_buffer_from_id<'s>( &mut self, scope: &mut HandleScope<'s>, - transfer_id: u32, + _transfer_id: u32, ) -> Option> { let msg = String::new( scope, @@ -180,11 +178,10 @@ pub trait ValueDeserializerImpl { None } - #[allow(unused_variables)] fn get_wasm_module_from_id<'s>( &mut self, scope: &mut HandleScope<'s>, - clone_id: u32, + _clone_id: u32, ) -> Option> { let msg = String::new( scope, @@ -221,6 +218,7 @@ impl<'a, 's> ValueDeserializerHeap<'a, 's> { } /// Starting from 'this' pointer a ValueDeserializerHeap ref can be created + #[allow(dead_code)] pub unsafe fn dispatch( value_serializer_delegate: &'s CxxValueDeserializerDelegate, ) -> &Self { diff --git a/src/value_serializer.rs b/src/value_serializer.rs index 698a5faa..65c229e2 100644 --- a/src/value_serializer.rs +++ b/src/value_serializer.rs @@ -210,12 +210,11 @@ pub trait ValueSerializerImpl { message: Local<'s, String>, ); - #[allow(unused_variables)] fn write_host_object<'s>( &mut self, scope: &mut HandleScope<'s>, - object: Local<'s, Object>, - value_serializer: &mut dyn ValueSerializerHelper, + _object: Local<'s, Object>, + _value_serializer: &mut dyn ValueSerializerHelper, ) -> Option { let msg = String::new(scope, "Deno serializer: write_host_object not implemented") @@ -225,11 +224,10 @@ pub trait ValueSerializerImpl { None } - #[allow(unused_variables)] fn get_shared_array_buffer_id<'s>( &mut self, scope: &mut HandleScope<'s>, - shared_array_buffer: Local<'s, SharedArrayBuffer>, + _shared_array_buffer: Local<'s, SharedArrayBuffer>, ) -> Option { let msg = String::new( scope, @@ -241,11 +239,10 @@ pub trait ValueSerializerImpl { None } - #[allow(unused_variables)] fn get_wasm_module_transfer_id( &mut self, scope: &mut HandleScope<'_>, - module: Local, + _module: Local, ) -> Option { let msg = String::new( scope, @@ -283,6 +280,7 @@ impl<'a, 's> ValueSerializerHeap<'a, 's> { } /// Starting from 'this' pointer a ValueSerializerHeap ref can be created + #[allow(dead_code)] pub unsafe fn dispatch( value_serializer_delegate: &'s CxxValueSerializerDelegate, ) -> &Self {