Skip to content

Commit

Permalink
Bump bitflags to 2.0.0 (#2666)
Browse files Browse the repository at this point in the history
Updated `bitflags`, overrides #2665.
  • Loading branch information
Razican committed Mar 14, 2023
1 parent 6173a73 commit 0a843d2
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 23 deletions.
39 changes: 24 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions boa_ast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ repository.workspace = true
rust-version.workspace = true

[features]
serde = ["dep:serde", "boa_interner/serde"]
serde = ["dep:serde", "boa_interner/serde", "bitflags/serde"]
arbitrary = ["dep:arbitrary", "boa_interner/arbitrary", "num-bigint/arbitrary"]

[dependencies]
boa_interner.workspace = true
boa_macros.workspace = true
rustc-hash = "1.1.0"
bitflags = "1.3.2"
bitflags = "2.0.0"
num-bigint = "0.4.3"
serde = { version = "1.0.156", features = ["derive"], optional = true }
arbitrary = { version = "1", features = ["derive"], optional = true }
2 changes: 1 addition & 1 deletion boa_ast/src/function/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl<'a> arbitrary::Arbitrary<'a> for FormalParameterList {

bitflags! {
/// Flags for a [`FormalParameterList`].
#[allow(clippy::unsafe_derive_deserialize)]
#[derive(Debug, Copy, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct FormalParameterListFlags: u8 {
/// Has only identifier parameters with no initialization expressions.
Expand Down
2 changes: 1 addition & 1 deletion boa_engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ regress = "0.5.0"
rustc-hash = "1.1.0"
num-bigint = { version = "0.4.3", features = ["serde"] }
num-integer = "0.1.45"
bitflags = "1.3.2"
bitflags = "2.0.0"
indexmap = "1.9.2"
ryu-js = "0.2.2"
chrono = { version = "0.4.24", default-features = false, features = ["clock", "std", "wasmbind"] }
Expand Down
1 change: 1 addition & 0 deletions boa_engine/src/bytecompiler/jump_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub(crate) struct JumpControlInfo {

bitflags! {
/// A bitflag that contains the type flags and relevant booleans for `JumpControlInfo`.
#[derive(Debug, Clone, Copy)]
pub(crate) struct JumpControlInfoFlags: u8 {
const LOOP = 0b0000_0001;
const SWITCH = 0b0000_0010;
Expand Down
3 changes: 2 additions & 1 deletion boa_engine/src/property/attribute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ bitflags! {
/// - `[[Configurable]]` (`CONFIGURABLE`) - If `false`, attempts to delete the property,
/// change the property to be an `accessor property`, or change its attributes (other than `[[Value]]`,
/// or changing `[[Writable]]` to `false`) will fail.
#[derive(Debug, Clone, Copy)]
pub struct Attribute: u8 {
/// The `Writable` attribute decides whether the value associated with the property can be changed or not, from its initial value.
const WRITABLE = 0b0000_0001;
Expand All @@ -40,7 +41,7 @@ impl Attribute {
/// Clear all flags.
#[inline]
pub fn clear(&mut self) {
self.bits = 0;
*self.0.bits_mut() = 0;
}

/// Sets the `writable` flag.
Expand Down
2 changes: 1 addition & 1 deletion boa_parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ boa_unicode.workspace = true
rustc-hash = "1.1.0"
fast-float = "0.2.0"
num-traits = "0.2.15"
bitflags = "1.3.2"
bitflags = "2.0.0"
num-bigint = "0.4.3"
regress = "0.5.0"
2 changes: 1 addition & 1 deletion boa_parser/src/lexer/regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl<R> Tokenizer<R> for RegexLiteral {

bitflags! {
/// Flags of a regular expression.
#[derive(Default)]
#[derive(Debug, Default, Copy, Clone)]
pub struct RegExpFlags: u8 {
/// Whether to test the regular expression against all possible matches in a string,
/// or only against the first.
Expand Down
2 changes: 1 addition & 1 deletion boa_tester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ clap = { version = "4.1.8", features = ["derive"] }
serde = { version = "1.0.156", features = ["derive"] }
serde_yaml = "0.9.19"
serde_json = "1.0.94"
bitflags = "1.3.2"
bitflags = "2.0.0"
regex = "1.7.1"
once_cell = "1.17.1"
colored = "2.0.0"
Expand Down
1 change: 1 addition & 0 deletions boa_tester/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ impl From<Option<Negative>> for Outcome {
}

bitflags! {
#[derive(Debug, Clone, Copy)]
struct TestFlags: u16 {
const STRICT = 0b0_0000_0001;
const NO_STRICT = 0b0_0000_0010;
Expand Down

0 comments on commit 0a843d2

Please sign in to comment.