From 52ced7e85f4ed18f5467f4fc1799ac84e489f292 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Mar 2023 08:12:08 +0800 Subject: [PATCH] build(deps): bump bitflags from 1.3.2 to 2.0.2 (#6387) * build(deps): bump bitflags from 1.3.2 to 2.0.2 Bumps [bitflags](https://github.com/bitflags/bitflags) from 1.3.2 to 2.0.2. - [Release notes](https://github.com/bitflags/bitflags/releases) - [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md) - [Commits](https://github.com/bitflags/bitflags/compare/1.3.2...2.0.2) --- updated-dependencies: - dependency-name: bitflags dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * deps: Resolve bitflags 2.0 breaking changes Bitflags 2.0 release made some breaking changes requiring some small changes to the Helix codebase. Almost all of the necessary changes are to manually `#[derive(..)]` trait implementations which are no longer automatically derived for all bitflags. All of these were previously automatically derived: #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy] I have derived the minimum traits for each bitflag type. The other change was to the `.bits` field. This is now a `.bits()` method so the usage of this has been updated in the `Borders` type. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michael Davis --- Cargo.lock | 32 +++++++++++++++++++------------- helix-core/Cargo.toml | 2 +- helix-core/src/syntax.rs | 1 + helix-tui/Cargo.toml | 2 +- helix-tui/src/widgets/mod.rs | 4 ++-- helix-view/Cargo.toml | 2 +- helix-view/src/graphics.rs | 1 + helix-view/src/keyboard.rs | 1 + 8 files changed, 27 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ba5e43f0..c86b5aac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -73,6 +73,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" + [[package]] name = "bstr" version = "1.3.0" @@ -210,7 +216,7 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a84cda67535339806297f1b331d6dd6320470d2a0fe65381e79ee9e156dd3d13" dependencies = [ - "bitflags", + "bitflags 1.3.2", "crossterm_winapi", "futures-core", "libc", @@ -623,7 +629,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "693d4a4ba0531e46fe558459557a5b29fb86c3e4b2666c1c0861d93c7c678331" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bstr", "gix-path", "libc", @@ -708,7 +714,7 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93e43efd776bc543f46f0fd0ca3d920c37af71a764a16f2aebd89765e9ff2993" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bstr", ] @@ -739,7 +745,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "546ee7855d5d8731288f05a63c07ab41b59cb406660a825ed3fe89d7223823df" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bstr", "btoi", "filetime", @@ -923,7 +929,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8ffa5bf0772f9b01de501c035b6b084cf9b8bb07dec41e3afc6a17336a65f47" dependencies = [ - "bitflags", + "bitflags 1.3.2", "dirs", "gix-path", "libc", @@ -1074,7 +1080,7 @@ version = "0.6.0" dependencies = [ "ahash 0.8.3", "arc-swap", - "bitflags", + "bitflags 2.0.2", "chrono", "encoding_rs", "etcetera", @@ -1198,7 +1204,7 @@ dependencies = [ name = "helix-tui" version = "0.6.0" dependencies = [ - "bitflags", + "bitflags 2.0.2", "cassowary", "crossterm", "helix-core", @@ -1230,7 +1236,7 @@ version = "0.6.0" dependencies = [ "anyhow", "arc-swap", - "bitflags", + "bitflags 2.0.2", "chardetng", "clipboard-win", "crossterm", @@ -1462,7 +1468,7 @@ version = "0.94.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b63735a13a1f9cd4f4835223d828ed9c2e35c8c5e61837774399f558b6a1237" dependencies = [ - "bitflags", + "bitflags 1.3.2", "serde", "serde_json", "serde_repr", @@ -1517,7 +1523,7 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46a58d1d356c6597d08cde02c2f09d785b09e28711837b1ed667dc652c08a694" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", "static_assertions", @@ -1648,7 +1654,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d9cc634bc78768157b5cbfe988ffcd1dcba95cd2b2f03a88316c08c6d00ed63" dependencies = [ - "bitflags", + "bitflags 1.3.2", "memchr", "unicase", ] @@ -1695,7 +1701,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1748,7 +1754,7 @@ version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", diff --git a/helix-core/Cargo.toml b/helix-core/Cargo.toml index c8db7f89..9dfef9ae 100644 --- a/helix-core/Cargo.toml +++ b/helix-core/Cargo.toml @@ -29,7 +29,7 @@ tree-sitter = "0.20" once_cell = "1.17" arc-swap = "1" regex = "1" -bitflags = "1.3" +bitflags = "2.0" ahash = "0.8.3" hashbrown = { version = "0.13.2", features = ["raw"] } diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 941e3ba7..e494ee9b 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -1157,6 +1157,7 @@ impl Syntax { bitflags! { /// Flags that track the status of a layer /// in the `Sytaxn::update` function + #[derive(Debug)] struct LayerUpdateFlags : u32{ const MODIFIED = 0b001; const MOVED = 0b010; diff --git a/helix-tui/Cargo.toml b/helix-tui/Cargo.toml index 8a6d5367..5a250bdc 100644 --- a/helix-tui/Cargo.toml +++ b/helix-tui/Cargo.toml @@ -16,7 +16,7 @@ include = ["src/**/*", "README.md"] default = ["crossterm"] [dependencies] -bitflags = "1.3" +bitflags = "2.0" cassowary = "0.3" unicode-segmentation = "1.10" crossterm = { version = "0.26", optional = true } diff --git a/helix-tui/src/widgets/mod.rs b/helix-tui/src/widgets/mod.rs index 8946ef05..3a0dfc5d 100644 --- a/helix-tui/src/widgets/mod.rs +++ b/helix-tui/src/widgets/mod.rs @@ -27,7 +27,7 @@ use helix_view::graphics::Rect; bitflags! { /// Bitflags that can be composed to set the visible borders essentially on the block widget. - #[derive(Default)] + #[derive(Debug, PartialEq, Eq, Clone, Copy, Default)] pub struct Borders: u8 { /// Show the top border const TOP = 0b0000_0001; @@ -38,7 +38,7 @@ bitflags! { /// Show the left border const LEFT = 0b0000_1000; /// Show all borders - const ALL = Self::TOP.bits | Self::RIGHT.bits | Self::BOTTOM.bits | Self::LEFT.bits; + const ALL = Self::TOP.bits() | Self::RIGHT.bits() | Self::BOTTOM.bits() | Self::LEFT.bits(); } } diff --git a/helix-view/Cargo.toml b/helix-view/Cargo.toml index e3f98a8d..4f7b08ed 100644 --- a/helix-view/Cargo.toml +++ b/helix-view/Cargo.toml @@ -14,7 +14,7 @@ default = [] term = ["crossterm"] [dependencies] -bitflags = "1.3" +bitflags = "2.0" anyhow = "1" helix-core = { version = "0.6", path = "../helix-core" } helix-loader = { version = "0.6", path = "../helix-loader" } diff --git a/helix-view/src/graphics.rs b/helix-view/src/graphics.rs index e813fb56..046db86a 100644 --- a/helix-view/src/graphics.rs +++ b/helix-view/src/graphics.rs @@ -352,6 +352,7 @@ bitflags! { /// /// let m = Modifier::BOLD | Modifier::ITALIC; /// ``` + #[derive(PartialEq, Eq, Debug, Clone, Copy)] pub struct Modifier: u16 { const BOLD = 0b0000_0000_0001; const DIM = 0b0000_0000_0010; diff --git a/helix-view/src/keyboard.rs b/helix-view/src/keyboard.rs index 04a9922a..080bce8d 100644 --- a/helix-view/src/keyboard.rs +++ b/helix-view/src/keyboard.rs @@ -2,6 +2,7 @@ use bitflags::bitflags; bitflags! { /// Represents key modifiers (shift, control, alt). + #[derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Copy, Hash)] pub struct KeyModifiers: u8 { const SHIFT = 0b0000_0001; const CONTROL = 0b0000_0010;