From 039c46ba7b3d6d672bfe7c6bc395677e1240874b Mon Sep 17 00:00:00 2001 From: Iban Eguia Date: Thu, 23 Dec 2021 17:43:15 +0000 Subject: [PATCH] Removed a bunch of warnings and clippy errors (#1754) This Pull Request fixes some warnings and clips errors. It conflicts with the VM/non-VM PR, so should probably go in first, so that this branch gets properly updated and we get the list of real warnings/errors there. --- boa/src/environment/lexical_environment.rs | 1 + boa/src/lib.rs | 1 + boa_tester/src/main.rs | 3 +++ boa_tester/src/read.rs | 1 + 4 files changed, 6 insertions(+) diff --git a/boa/src/environment/lexical_environment.rs b/boa/src/environment/lexical_environment.rs index f75bac14d2..69391eab00 100644 --- a/boa/src/environment/lexical_environment.rs +++ b/boa/src/environment/lexical_environment.rs @@ -93,6 +93,7 @@ impl Context { .recursive_get_this_binding(self) } + #[cfg(feature = "vm")] pub(crate) fn get_global_this_binding(&mut self) -> JsResult { let global = self.realm.global_env.clone(); global.get_this_binding(self) diff --git a/boa/src/lib.rs b/boa/src/lib.rs index aa00bdea82..4f2d0e1020 100644 --- a/boa/src/lib.rs +++ b/boa/src/lib.rs @@ -99,6 +99,7 @@ pub fn parse>(src: T, strict_mode: bool) -> StdResult>(context: &mut Context, src: T) -> String { let src_bytes: &[u8] = src.as_ref(); let result = context.eval(src_bytes).map_or_else( diff --git a/boa_tester/src/main.rs b/boa_tester/src/main.rs index 33619c1ba3..0c82ab6c3c 100644 --- a/boa_tester/src/main.rs +++ b/boa_tester/src/main.rs @@ -329,6 +329,7 @@ struct SuiteResult { /// Outcome of a test. #[derive(Debug, Clone, Serialize, Deserialize)] +#[allow(dead_code)] struct TestResult { #[serde(rename = "n")] name: Box, @@ -354,6 +355,7 @@ enum TestOutcomeResult { /// Represents a test. #[derive(Debug, Clone, Default)] +#[allow(dead_code)] struct Test { name: Box, description: Box, @@ -493,6 +495,7 @@ enum Phase { /// Locale information structure. #[derive(Debug, Default, Clone, Deserialize)] #[serde(transparent)] +#[allow(dead_code)] struct Locale { locale: Box<[Box]>, } diff --git a/boa_tester/src/read.rs b/boa_tester/src/read.rs index a2f0e8ffcd..25407bd875 100644 --- a/boa_tester/src/read.rs +++ b/boa_tester/src/read.rs @@ -7,6 +7,7 @@ use std::{fs, io, path::Path, str::FromStr}; /// Representation of the YAML metadata in Test262 tests. #[derive(Debug, Clone, Deserialize)] +#[allow(dead_code)] pub(super) struct MetaData { pub(super) description: Box, pub(super) esid: Option>,