From c72675e89eb544e164b008d11d6034a323b26fb7 Mon Sep 17 00:00:00 2001 From: Boshen Date: Fri, 8 Mar 2024 20:54:36 +0800 Subject: [PATCH] chore: Rust v1.76.0 (#2643) --- Cargo.toml | 1 + crates/oxc_cli/src/command/lint.rs | 1 + crates/oxc_codegen/src/sourcemap_builder.rs | 4 ++-- rust-toolchain.toml | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0a4d464fdf70..bb821424fb90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,6 +38,7 @@ rc_mutex = "warn" rest_pat_in_fully_bound_structs = "warn" unnecessary_safety_comment = "warn" undocumented_unsafe_blocks = "warn" +infinite_loop = "warn" # I want to write the best Rust code so pedantic is enabled. # We should only disable rules globally if they are either false positives, chaotic, or does not make sense. pedantic = { level = "warn", priority = -1 } diff --git a/crates/oxc_cli/src/command/lint.rs b/crates/oxc_cli/src/command/lint.rs index c1aa8dc33b72..6145ab144908 100644 --- a/crates/oxc_cli/src/command/lint.rs +++ b/crates/oxc_cli/src/command/lint.rs @@ -66,6 +66,7 @@ pub struct LintOptions { pub paths: Vec, } +#[allow(clippy::ptr_arg)] fn validate_paths(paths: &Vec) -> bool { if paths.is_empty() { true diff --git a/crates/oxc_codegen/src/sourcemap_builder.rs b/crates/oxc_codegen/src/sourcemap_builder.rs index 603338a12e90..043536f303ca 100644 --- a/crates/oxc_codegen/src/sourcemap_builder.rs +++ b/crates/oxc_codegen/src/sourcemap_builder.rs @@ -57,7 +57,7 @@ impl SourcemapBuilder { self.enable_sourcemap.then(|| self.sourcemap_builder.into_sourcemap()) } - pub fn add_source_mapping(&mut self, output: &Vec, position: u32, name: Option<&str>) { + pub fn add_source_mapping(&mut self, output: &[u8], position: u32, name: Option<&str>) { if self.enable_sourcemap { if matches!(self.last_position, Some(last_position) if last_position >= position) { return; @@ -94,7 +94,7 @@ impl SourcemapBuilder { } #[allow(clippy::cast_possible_truncation)] - fn update_generated_line_and_column(&mut self, output: &Vec) { + fn update_generated_line_and_column(&mut self, output: &[u8]) { let remaining = &output[self.last_generated_update..]; // Find last line break diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 1c8cfba9f594..06c745813187 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.75.0" +channel = "1.76.0" profile = "default"