From 899a52bf284a1b8c13a1bf70094fb6c6cb240ce9 Mon Sep 17 00:00:00 2001 From: Boshen Date: Sun, 19 May 2024 00:54:52 +0800 Subject: [PATCH] fix: fix some nightly warnings --- crates/oxc_ast/src/ast/js.rs | 2 +- crates/oxc_language_server/src/main.rs | 1 - crates/oxc_language_server/src/options.rs | 10 ---------- crates/oxc_sourcemap/src/encode.rs | 6 +++--- tasks/coverage/src/test262_meta.rs | 24 +++++++++++------------ 5 files changed, 16 insertions(+), 27 deletions(-) delete mode 100644 crates/oxc_language_server/src/options.rs diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index 9cb8b2cca..4266b1299 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -1727,7 +1727,7 @@ pub struct UsingDeclaration<'a> { #[cfg_attr(feature = "serialize", serde(flatten))] pub span: Span, pub is_await: bool, - #[cfg_attr(feature = "serde-impl", serde(default))] + #[cfg_attr(feature = "serialize", serde(default))] pub declarations: Vec<'a, VariableDeclarator<'a>>, } diff --git a/crates/oxc_language_server/src/main.rs b/crates/oxc_language_server/src/main.rs index a144706f2..d8f52c7d4 100644 --- a/crates/oxc_language_server/src/main.rs +++ b/crates/oxc_language_server/src/main.rs @@ -1,5 +1,4 @@ mod linter; -mod options; use crate::linter::{DiagnosticReport, ServerLinter}; use globset::Glob; diff --git a/crates/oxc_language_server/src/options.rs b/crates/oxc_language_server/src/options.rs deleted file mode 100644 index 05e7b4bc9..000000000 --- a/crates/oxc_language_server/src/options.rs +++ /dev/null @@ -1,10 +0,0 @@ -use std::path::PathBuf; - -#[derive(Debug, Default)] -pub struct LintOptions { - pub paths: Vec, - pub fix: bool, - pub ignore_path: PathBuf, - pub no_ignore: bool, - pub ignore_pattern: Vec, -} diff --git a/crates/oxc_sourcemap/src/encode.rs b/crates/oxc_sourcemap/src/encode.rs index 66c49ceb3..7d70f23cc 100644 --- a/crates/oxc_sourcemap/src/encode.rs +++ b/crates/oxc_sourcemap/src/encode.rs @@ -4,7 +4,7 @@ use crate::error::{Error, Result}; /// - Quote `source_content` at parallel. /// - If you using `ConcatSourceMapBuilder`, serialize `tokens` to vlq `mappings` at parallel. use crate::{token::TokenChunk, SourceMap, Token}; -#[cfg(feature = "rayon")] +#[cfg(feature = "concurrent")] use rayon::prelude::*; // Here using `serde_json::to_string` to serialization `names/source_contents/sources`. @@ -42,7 +42,7 @@ pub fn encode(sourcemap: &SourceMap) -> Result { if let Some(source_contents) = &sourcemap.source_contents { buf.push_str("],\"sourcesContent\":["); cfg_if::cfg_if! { - if #[cfg(feature = "rayon")] { + if #[cfg(feature = "concurrent")] { let quote_source_contents = source_contents .par_iter() .map(|x| serde_json::to_string(x.as_ref())) @@ -82,7 +82,7 @@ fn serialize_sourcemap_mappings(sm: &SourceMap) -> String { |token_chunks| { // Serialize `tokens` to vlq `mappings` at parallel. cfg_if::cfg_if! { - if #[cfg(feature = "rayon")] { + if #[cfg(feature = "concurrent")] { token_chunks .par_iter() .map(|token_chunk| serialize_mappings(&sm.tokens, token_chunk)) diff --git a/tasks/coverage/src/test262_meta.rs b/tasks/coverage/src/test262_meta.rs index c662de0f3..0cf232033 100644 --- a/tasks/coverage/src/test262_meta.rs +++ b/tasks/coverage/src/test262_meta.rs @@ -2,16 +2,16 @@ use saphyr::{Yaml, YamlLoader}; #[derive(Debug, Clone, Default)] pub struct MetaData { - pub description: Box, - pub esid: Option>, - pub es5id: Option>, - pub es6id: Option>, - pub info: Box, + // pub description: Box, + // pub esid: Option>, + // pub es5id: Option>, + // pub es6id: Option>, + // pub info: Box, pub features: Box<[Box]>, pub includes: Box<[Box]>, pub flags: Box<[TestFlag]>, pub negative: Option, - pub locale: Box<[Box]>, + // pub locale: Box<[Box]>, } /// Individual test flag. @@ -90,11 +90,11 @@ impl MetaData { let yamls = YamlLoader::load_from_str(s).unwrap_or_default(); let Some(yaml) = yamls.first() else { return Self::default() }; Self { - description: yaml["description"].as_str().unwrap_or_default().into(), - esid: yaml["esid"].as_str().map(Into::into), - es5id: yaml["es5id"].as_str().map(Into::into), - es6id: yaml["es6id"].as_str().map(Into::into), - info: yaml["info"].as_str().unwrap_or_default().into(), + // description: yaml["description"].as_str().unwrap_or_default().into(), + // esid: yaml["esid"].as_str().map(Into::into), + // es5id: yaml["es5id"].as_str().map(Into::into), + // es6id: yaml["es6id"].as_str().map(Into::into), + // info: yaml["info"].as_str().unwrap_or_default().into(), features: Self::get_vec_of_string(&yaml["features"]), includes: Self::get_vec_of_string(&yaml["includes"]), flags: yaml["flags"] @@ -109,7 +109,7 @@ impl MetaData { let yaml = &yaml["negative"]; (!yaml.is_null() && !yaml.is_badvalue()).then(|| Negative::from_yaml(yaml)) }, - locale: Self::get_vec_of_string(&yaml["locale"]), + // locale: Self::get_vec_of_string(&yaml["locale"]), } }