1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-24 22:01:47 +03:00

fix: Update bitflags to 2.0 and fix compilation errors

- v2.0 no longer derives a bunch of traits (Debug, Clone, Copy, PartialEq, Eq)
  by default, so I manually derived them.
- It also changed the snapshot results so I updated them:

  An empty bitflags struct is no longer displayed as `None` but as
  `BitFlags(0x0)`.

- `bits` is no longer a field but a method so I added the missing
  parenthesis.
This commit is contained in:
Jalil David Salamé Messina 2023-03-27 01:51:30 -03:00 committed by Wez Furlong
parent 7721126fdd
commit 7f89f46ae5
7 changed files with 74 additions and 61 deletions

112
Cargo.lock generated
View File

@ -364,6 +364,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 = "block"
version = "0.1.6"
@ -528,7 +534,7 @@ version = "2.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"textwrap 0.11.0",
"unicode-width",
]
@ -539,7 +545,7 @@ version = "4.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c911b090850d79fc64fe9ea01e28e465f65e821e08813ced95bced72f7a8a9b"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"clap_derive",
"clap_lex",
"is-terminal",
@ -615,7 +621,7 @@ version = "0.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c49e86fc36d5704151f5996b7b3795385f50ce09e3be0f47a0cfde869681cf8"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"block",
"core-foundation 0.7.0",
"core-graphics 0.19.2",
@ -723,7 +729,7 @@ name = "config"
version = "0.1.0"
dependencies = [
"anyhow",
"bitflags",
"bitflags 1.3.2",
"colorgrad",
"dirs-next",
"enum-display-derive",
@ -791,7 +797,7 @@ version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"core-foundation 0.7.0",
"foreign-types",
"libc",
@ -803,7 +809,7 @@ version = "0.22.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"core-foundation 0.9.3",
"core-graphics-types",
"foreign-types",
@ -816,7 +822,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"core-foundation 0.9.3",
"foreign-types",
"libc",
@ -1052,7 +1058,7 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"libloading 0.7.4",
"winapi",
]
@ -1790,7 +1796,7 @@ version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccf7f68c2995f392c49fffb4f95ae2c873297830eb25c6bc4c114ce8f4562acc"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"libc",
"libgit2-sys",
"log",
@ -1844,7 +1850,7 @@ version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"ignore",
"walkdir",
]
@ -1884,7 +1890,7 @@ version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fc59e5f710e310e76e6707f86c561dd646f69a8876da9131703b2f717de818d"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"gpu-alloc-types",
]
@ -1894,7 +1900,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5"
dependencies = [
"bitflags",
"bitflags 1.3.2",
]
[[package]]
@ -1916,7 +1922,7 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b0c02e1ba0bdb14e965058ca34e09c020f8e507a760df1121728e0aef68d57a"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"gpu-descriptor-types",
"hashbrown 0.12.3",
]
@ -1927,7 +1933,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126"
dependencies = [
"bitflags",
"bitflags 1.3.2",
]
[[package]]
@ -2015,7 +2021,7 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90601c6189668c7345fc53842cb3f3a3d872203d523be1b3cb44a36a3e62fb85"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"com-rs",
"libc",
"libloading 0.7.4",
@ -2279,7 +2285,7 @@ version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"inotify-sys",
"libc",
]
@ -2452,7 +2458,7 @@ version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"libc",
]
@ -2579,7 +2585,7 @@ name = "libssh-rs"
version = "0.1.7"
source = "git+https://github.com/wez/libssh-rs.git#44a08196acd1a2277ec7ebce2a47618775f3c59c"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"libssh-rs-sys",
"openssl-sys",
"thiserror",
@ -2836,7 +2842,7 @@ version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"block",
"core-graphics-types",
"foreign-types",
@ -2947,7 +2953,7 @@ dependencies = [
"async-trait",
"base64 0.21.0",
"bintree",
"bitflags",
"bitflags 1.3.2",
"chrono",
"config",
"crossbeam",
@ -3013,7 +3019,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5eafe22a23b797c9bc227c6c896419b26b5bb88fa903417a3adaed08778850d5"
dependencies = [
"bit-set",
"bitflags",
"bitflags 1.3.2",
"codespan-reporting",
"hexf-parse",
"indexmap",
@ -3068,7 +3074,7 @@ version = "0.23.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"cc",
"cfg-if",
"libc",
@ -3081,7 +3087,7 @@ version = "0.24.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"cfg-if",
"libc",
"memoffset 0.6.5",
@ -3094,7 +3100,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4"
dependencies = [
"autocfg",
"bitflags",
"bitflags 1.3.2",
"cfg-if",
"libc",
"memoffset 0.6.5",
@ -3107,7 +3113,7 @@ version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"cfg-if",
"libc",
"memoffset 0.7.1",
@ -3149,7 +3155,7 @@ version = "5.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58ea850aa68a06e48fdb069c0ec44d0d64c8dbffa49bf3b6f7f0a901fdea1ba9"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"crossbeam-channel",
"filetime",
"fsevent-sys",
@ -3344,7 +3350,7 @@ version = "0.10.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"cfg-if",
"foreign-types",
"libc",
@ -3671,7 +3677,7 @@ version = "0.17.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"crc32fast",
"flate2",
"miniz_oxide 0.6.2",
@ -3684,7 +3690,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e1f879b2998099c2d69ab9605d145d5b661195627eccc680002c4918a7fb6fa"
dependencies = [
"autocfg",
"bitflags",
"bitflags 1.3.2",
"cfg-if",
"concurrent-queue",
"libc",
@ -3698,7 +3704,7 @@ name = "portable-pty"
version = "0.8.1"
dependencies = [
"anyhow",
"bitflags",
"bitflags 1.3.2",
"downcast-rs",
"filedescriptor",
"futures",
@ -3821,7 +3827,7 @@ version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d9cc634bc78768157b5cbfe988ffcd1dcba95cd2b2f03a88316c08c6d00ed63"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"getopts",
"memchr",
"unicase",
@ -3943,7 +3949,7 @@ version = "10.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332"
dependencies = [
"bitflags",
"bitflags 1.3.2",
]
[[package]]
@ -3992,7 +3998,7 @@ version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
dependencies = [
"bitflags",
"bitflags 1.3.2",
]
[[package]]
@ -4143,7 +4149,7 @@ version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85127183a999f7db96d1a976a309eebbfb6ea3b0b400ddd8340190129de6eb7a"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"fallible-iterator",
"fallible-streaming-iterator",
"hashlink",
@ -4179,7 +4185,7 @@ version = "0.36.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"errno 0.2.8",
"io-lifetimes",
"libc",
@ -4193,7 +4199,7 @@ version = "0.37.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62b24138615de35e32031d041a09032ef3487a616d901ca4db224e7d557efae2"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"errno 0.3.0",
"io-lifetimes",
"libc",
@ -4255,7 +4261,7 @@ version = "2.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"core-foundation 0.9.3",
"core-foundation-sys 0.8.3",
"libc",
@ -4585,7 +4591,7 @@ version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f307c47d32d2715eb2e0ece5589057820e0e5e70d07c247d1063e844e107f454"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"dlib",
"lazy_static",
"log",
@ -4700,7 +4706,7 @@ version = "0.2.0+1.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"num-traits",
]
@ -4732,7 +4738,7 @@ version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7fe461910559f6d5604c3731d00d2aafc4a83d1665922e280f42f9a168d5455"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"libc",
"libssh2-sys",
"parking_lot 0.11.2",
@ -4953,7 +4959,7 @@ version = "0.22.0"
dependencies = [
"anyhow",
"base64 0.21.0",
"bitflags",
"bitflags 2.0.2",
"cassowary",
"criterion",
"env_logger",
@ -5618,7 +5624,7 @@ version = "0.29.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f3b068c05a039c9f755f881dc50f01732214f5685e379829759088967c46715"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"downcast-rs",
"libc",
"nix 0.24.3",
@ -5667,7 +5673,7 @@ version = "0.29.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b950621f9354b322ee817a23474e479b34be96c2e909c14f7bc0100e9a970bc6"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"wayland-client",
"wayland-commons",
"wayland-scanner",
@ -5890,7 +5896,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"benchmarking",
"bitflags",
"bitflags 1.3.2",
"bytemuck",
"cc",
"chrono",
@ -5986,7 +5992,7 @@ dependencies = [
name = "wezterm-input-types"
version = "0.1.0"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"euclid",
"lazy_static",
"serde",
@ -6057,7 +6063,7 @@ dependencies = [
"assert_fs",
"async_ossl",
"base64 0.21.0",
"bitflags",
"bitflags 1.3.2",
"camino",
"clap 4.1.13",
"dirs-next",
@ -6089,7 +6095,7 @@ name = "wezterm-term"
version = "0.1.0"
dependencies = [
"anyhow",
"bitflags",
"bitflags 1.3.2",
"csscolorparser",
"env_logger",
"finl_unicode",
@ -6162,7 +6168,7 @@ checksum = "7131408d940e335792645a98f03639573b0480e9e2e7cddbbab74f7c6d9f3fff"
dependencies = [
"arrayvec",
"bit-vec",
"bitflags",
"bitflags 1.3.2",
"codespan-reporting",
"fxhash",
"log",
@ -6187,7 +6193,7 @@ dependencies = [
"arrayvec",
"ash",
"bit-set",
"bitflags",
"bitflags 1.3.2",
"block",
"core-graphics-types",
"d3d12",
@ -6225,7 +6231,7 @@ version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32444e121b0bd00cb02c0de32fde457a9491bd44e03e7a5db6df9b1da2f6f110"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"js-sys",
"web-sys",
]
@ -6286,7 +6292,7 @@ dependencies = [
"async-io",
"async-task",
"async-trait",
"bitflags",
"bitflags 1.3.2",
"bytes",
"cgl",
"clipboard-win",
@ -6561,7 +6567,7 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0faeb4d7e2d54fff4a0584f61297e86b106914af2029778de7b427f72564d6c5"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"libc",
"quick-xml 0.22.0",
"x11",
@ -6572,7 +6578,7 @@ name = "xcb-imdkit"
version = "0.2.0"
source = "git+https://github.com/wez/xcb-imdkit-rs.git?branch=hangfix#c6859ab2b8a233ca5dda5e8e4f1634d34ce9c85c"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"cc",
"lazy_static",
"pkg-config",

View File

@ -13,7 +13,7 @@ readme = "README.md"
[dependencies]
# backtrace = "0.3"
base64 = "0.21"
bitflags = "1.3"
bitflags = "2.0"
cassowary = {version="0.3", optional=true}
anyhow = "1.0"
filedescriptor = { version="0.8", path = "../filedescriptor" }

View File

@ -53,6 +53,7 @@ fn csi_size() {
}
bitflags::bitflags! {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct KittyKeyboardFlags: u16 {
const NONE = 0;
const DISAMBIGUATE_ESCAPE_CODES = 1;

View File

@ -72,6 +72,7 @@ pub struct ChangeColorPair {
}
bitflags! {
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Selection :u16{
const NONE = 0;
const CLIPBOARD = 1<<1;

View File

@ -44,7 +44,7 @@ use winapi::um::wincon::{
bitflags! {
#[cfg_attr(feature="use_serde", derive(Serialize, Deserialize))]
#[derive(Default)]
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq)]
pub struct Modifiers: u8 {
const NONE = 0;
const SHIFT = 1<<1;
@ -58,7 +58,7 @@ bitflags! {
}
bitflags! {
#[cfg_attr(feature="use_serde", derive(Serialize, Deserialize))]
#[derive(Default)]
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub struct MouseButtons: u8 {
const NONE = 0;
const LEFT = 1<<1;

View File

@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
bitflags! {
#[cfg_attr(feature="use_serde", derive(Serialize, Deserialize))]
#[derive(Debug, Clone, Copy, PartialEq)]
pub(crate) struct LineBits : u16 {
const NONE = 0;
/// The line contains 1+ cells with explicit hyperlinks set
@ -26,9 +27,9 @@ bitflags! {
const DOUBLE_HEIGHT_BOTTOM = 1<<6;
const DOUBLE_WIDTH_HEIGHT_MASK =
Self::DOUBLE_WIDTH.bits |
Self::DOUBLE_HEIGHT_TOP.bits |
Self::DOUBLE_HEIGHT_BOTTOM.bits;
Self::DOUBLE_WIDTH.bits() |
Self::DOUBLE_HEIGHT_TOP.bits() |
Self::DOUBLE_HEIGHT_BOTTOM.bits();
/// true if the line should have the bidi algorithm
/// applied as part of presentation.

View File

@ -288,7 +288,9 @@ Line {
),
zones: [],
seqno: 1,
bits: NONE,
bits: LineBits(
0x0,
),
appdata: Mutex {
data: None,
poisoned: false,
@ -598,7 +600,9 @@ Line {
),
zones: [],
seqno: 5,
bits: NONE,
bits: LineBits(
0x0,
),
appdata: Mutex {
data: None,
poisoned: false,