summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Lafeldt <mathias.lafeldt@gmail.com>2022-08-21 19:31:14 +0200
committerGitHub <noreply@github.com>2022-08-21 19:31:14 +0200
commite96933bc163fd81a276cbc169b17f76724a5ac33 (patch)
tree9baab891a4035c4a03b490bb81ade8b42c426d9a
parentfb2aeb79a113e576ff2cc4f1bf3fc30741969508 (diff)
chore: use Rust 1.63.0 (#15464)
-rw-r--r--.cargo/config.toml2
-rw-r--r--cli/main.rs4
-rw-r--r--cli/tools/test.rs2
-rw-r--r--core/async_cancel.rs2
-rw-r--r--core/inspector.rs1
-rw-r--r--core/modules.rs2
-rw-r--r--core/ops_builtin_v8.rs1
-rw-r--r--ext/ffi/lib.rs11
-rw-r--r--ext/net/io.rs1
-rw-r--r--ext/net/ops.rs1
-rw-r--r--rust-toolchain.toml2
-rw-r--r--serde_v8/magic/buffer.rs6
-rw-r--r--serde_v8/magic/v8slice.rs1
-rw-r--r--serde_v8/serializable.rs2
-rw-r--r--test_util/src/lib.rs3
15 files changed, 26 insertions, 15 deletions
diff --git a/.cargo/config.toml b/.cargo/config.toml
index cac99a377..cc7682522 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -23,4 +23,6 @@ rustflags = [
"clippy::missing_safety_doc",
"-D",
"clippy::undocumented_unsafe_blocks",
+ "-A",
+ "clippy::derive-partial-eq-without-eq",
]
diff --git a/cli/main.rs b/cli/main.rs
index 17f3fcffa..8e53d1f0c 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -1070,9 +1070,7 @@ pub fn main() {
logger::init(flags.log_level);
- let exit_code = get_subcommand(flags).await;
-
- exit_code
+ get_subcommand(flags).await
};
let exit_code = unwrap_or_exit(run_local(exit_code));
diff --git a/cli/tools/test.rs b/cli/tools/test.rs
index 6d24a7e4c..da44eba7c 100644
--- a/cli/tools/test.rs
+++ b/cli/tools/test.rs
@@ -752,7 +752,7 @@ fn extract_files_from_regex_blocks(
return None;
}
- match attributes.get(0) {
+ match attributes.first() {
Some(&"js") => MediaType::JavaScript,
Some(&"javascript") => MediaType::JavaScript,
Some(&"mjs") => MediaType::Mjs,
diff --git a/core/async_cancel.rs b/core/async_cancel.rs
index 55ab8f4d1..11b07e189 100644
--- a/core/async_cancel.rs
+++ b/core/async_cancel.rs
@@ -219,7 +219,7 @@ mod internal {
// Do a cancellation check _before_ polling the inner future. If it has
// already been canceled the inner future will not be polled.
let node = match &*registration {
- Registration::WillRegister { head_node } => &*head_node,
+ Registration::WillRegister { head_node } => head_node,
Registration::Registered { node } => node,
};
if node.is_canceled() {
diff --git a/core/inspector.rs b/core/inspector.rs
index bec22d257..6a254b76c 100644
--- a/core/inspector.rs
+++ b/core/inspector.rs
@@ -438,6 +438,7 @@ struct InspectorWakerInner {
isolate_handle: v8::IsolateHandle,
}
+// SAFETY: unsafe trait must have unsafe implementation
unsafe impl Send for InspectorWakerInner {}
struct InspectorWaker(Mutex<InspectorWakerInner>);
diff --git a/core/modules.rs b/core/modules.rs
index c4fa53b51..545ad54d8 100644
--- a/core/modules.rs
+++ b/core/modules.rs
@@ -1346,7 +1346,7 @@ import "/a.js";
Err(..) => return Err(MockError::ResolveErr.into()),
};
- if mock_source_code(&output_specifier.to_string()).is_some() {
+ if mock_source_code(output_specifier.as_ref()).is_some() {
Ok(output_specifier)
} else {
Err(MockError::ResolveErr.into())
diff --git a/core/ops_builtin_v8.rs b/core/ops_builtin_v8.rs
index b828f908d..fe6a38bb4 100644
--- a/core/ops_builtin_v8.rs
+++ b/core/ops_builtin_v8.rs
@@ -673,6 +673,7 @@ fn op_set_wasm_streaming_callback(
Ok(())
}
+#[allow(clippy::let_and_return)]
#[op(v8)]
fn op_abort_wasm_streaming(
scope: &mut v8::HandleScope,
diff --git a/ext/ffi/lib.rs b/ext/ffi/lib.rs
index 6d0bda649..1d400069e 100644
--- a/ext/ffi/lib.rs
+++ b/ext/ffi/lib.rs
@@ -97,7 +97,9 @@ struct Symbol {
}
#[allow(clippy::non_send_fields_in_send_ty)]
+// SAFETY: unsafe trait must have unsafe implementation
unsafe impl Send for Symbol {}
+// SAFETY: unsafe trait must have unsafe implementation
unsafe impl Sync for Symbol {}
#[derive(Clone)]
@@ -123,7 +125,9 @@ impl PtrSymbol {
}
#[allow(clippy::non_send_fields_in_send_ty)]
+// SAFETY: unsafe trait must have unsafe implementation
unsafe impl Send for PtrSymbol {}
+// SAFETY: unsafe trait must have unsafe implementation
unsafe impl Sync for PtrSymbol {}
struct DynamicLibraryResource {
@@ -363,7 +367,7 @@ impl NativeValue {
}
NativeType::ISize => {
let value = self.isize_value;
- if value > MAX_SAFE_INTEGER || value < MIN_SAFE_INTEGER {
+ if !(MIN_SAFE_INTEGER..=MAX_SAFE_INTEGER).contains(&value) {
json!(U32x2::from(self.isize_value as u64))
} else {
Value::from(value)
@@ -458,7 +462,7 @@ impl NativeValue {
NativeType::ISize => {
let value = self.isize_value;
let local_value: v8::Local<v8::Value> =
- if value > MAX_SAFE_INTEGER || value < MIN_SAFE_INTEGER {
+ if !(MIN_SAFE_INTEGER..=MAX_SAFE_INTEGER).contains(&value) {
v8::BigInt::new_from_i64(scope, self.isize_value as i64).into()
} else {
v8::Number::new(scope, value as f64).into()
@@ -489,6 +493,7 @@ impl NativeValue {
}
}
+// SAFETY: unsafe trait must have unsafe implementation
unsafe impl Send for NativeValue {}
#[derive(Serialize, Debug, Clone, Copy)]
@@ -1979,7 +1984,7 @@ fn op_ffi_get_static<'scope>(
// SAFETY: ptr is user provided
let result = unsafe { ptr::read_unaligned(data_ptr as *const isize) };
let integer: v8::Local<v8::Value> =
- if result > MAX_SAFE_INTEGER || result < MIN_SAFE_INTEGER {
+ if !(MIN_SAFE_INTEGER..=MAX_SAFE_INTEGER).contains(&result) {
v8::BigInt::new_from_i64(scope, result as i64).into()
} else {
v8::Number::new(scope, result as f64).into()
diff --git a/ext/net/io.rs b/ext/net/io.rs
index 02caf7473..c9587c851 100644
--- a/ext/net/io.rs
+++ b/ext/net/io.rs
@@ -136,6 +136,7 @@ impl TcpStreamResource {
.map_socket(Box::new(move |socket| Ok(socket.set_keepalive(keepalive)?)))
}
+ #[allow(clippy::type_complexity)]
fn map_socket(
self: Rc<Self>,
map: Box<dyn FnOnce(SockRef) -> Result<(), AnyError>>,
diff --git a/ext/net/ops.rs b/ext/net/ops.rs
index 87bfc3272..a05c21da8 100644
--- a/ext/net/ops.rs
+++ b/ext/net/ops.rs
@@ -1047,6 +1047,7 @@ mod tests {
check_sockopt(String::from("127.0.0.1:4246"), set_keepalive, test_fn).await;
}
+ #[allow(clippy::type_complexity)]
async fn check_sockopt(
addr: String,
set_sockopt_fn: Box<dyn Fn(&mut OpState, u32)>,
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index 9e2065b1c..4a6c26620 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -1,3 +1,3 @@
[toolchain]
-channel = "1.62.1"
+channel = "1.63.0"
components = ["rustfmt", "clippy"]
diff --git a/serde_v8/magic/buffer.rs b/serde_v8/magic/buffer.rs
index da87c8b86..db50e3896 100644
--- a/serde_v8/magic/buffer.rs
+++ b/serde_v8/magic/buffer.rs
@@ -58,7 +58,7 @@ impl Clone for ZeroCopyBuf {
impl AsRef<[u8]> for ZeroCopyBuf {
fn as_ref(&self) -> &[u8] {
- &*self
+ self
}
}
@@ -72,8 +72,8 @@ impl Deref for ZeroCopyBuf {
type Target = [u8];
fn deref(&self) -> &[u8] {
match self {
- Self::FromV8(buf) => &*buf,
- Self::Temp(vec) => &*vec,
+ Self::FromV8(buf) => buf,
+ Self::Temp(vec) => vec,
Self::ToV8(_) => panic!("Don't Deref a ZeroCopyBuf sent to v8"),
}
}
diff --git a/serde_v8/magic/v8slice.rs b/serde_v8/magic/v8slice.rs
index 94e21b0e0..4772abd42 100644
--- a/serde_v8/magic/v8slice.rs
+++ b/serde_v8/magic/v8slice.rs
@@ -25,6 +25,7 @@ pub struct V8Slice {
pub(crate) range: Range<usize>,
}
+// SAFETY: unsafe trait must have unsafe implementation
unsafe impl Send for V8Slice {}
impl V8Slice {
diff --git a/serde_v8/serializable.rs b/serde_v8/serializable.rs
index abde544c7..7820d02ec 100644
--- a/serde_v8/serializable.rs
+++ b/serde_v8/serializable.rs
@@ -39,7 +39,7 @@ impl SerializablePkg {
&self,
scope: &mut v8::HandleScope<'a>,
) -> Result<v8::Local<'a, v8::Value>, crate::Error> {
- match &*self {
+ match self {
Self::Primitive(x) => crate::to_v8(scope, x),
Self::Serializable(x) => x.to_v8(scope),
}
diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs
index 79c74aef8..d15538e54 100644
--- a/test_util/src/lib.rs
+++ b/test_util/src/lib.rs
@@ -1052,6 +1052,7 @@ impl hyper::server::accept::Accept for HyperAcceptor<'_> {
}
#[allow(clippy::non_send_fields_in_send_ty)]
+// SAFETY: unsafe trait must have unsafe implementation
unsafe impl std::marker::Send for HyperAcceptor<'_> {}
async fn wrap_redirect_server() {
@@ -1897,7 +1898,7 @@ impl<'a> CheckOutputIntegrationTest<'a> {
// deno test's output capturing flushes with a zero-width space in order to
// synchronize the output pipes. Occassionally this zero width space
// might end up in the output so strip it from the output comparison here.
- if args.get(0) == Some(&"test") {
+ if args.first() == Some(&"test") {
actual = actual.replace('\u{200B}', "");
}