From f01a7b17c4ef32f772a640f2acd9c96fb38def9c Mon Sep 17 00:00:00 2001 From: Noa <33094578+coolreader18@users.noreply.github.com> Date: Wed, 3 Nov 2021 13:26:40 -0500 Subject: [PATCH 1/2] Upgrade nix --- Cargo.lock | 27 ++++++++++++++++++++------- stdlib/Cargo.toml | 2 +- vm/Cargo.toml | 2 +- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3a4d5376..579c817d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -138,9 +138,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "blake2" @@ -1145,9 +1145,22 @@ dependencies = [ [[package]] name = "nix" -version = "0.22.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3bb9a13fa32bc5aeb64150cd3f32d6cf4c748f8f8a417cce5d2eb976a8370ba" +checksum = "cf1e25ee6b412c2a1e3fcb6a4499a5c1bfe7f43e014bdce9a6b6666e5aa2d187" +dependencies = [ + "bitflags", + "cc", + "cfg-if", + "libc", + "memoffset", +] + +[[package]] +name = "nix" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f305c2c2e4c39a82f7bf0bf65fb557f9070ce06781d4f2454295cc34b1c43188" dependencies = [ "bitflags", "cc", @@ -1876,7 +1889,7 @@ dependencies = [ "md-5", "memchr", "mt19937", - "nix", + "nix 0.23.0", "num-bigint", "num-complex", "num-integer", @@ -1941,7 +1954,7 @@ dependencies = [ "libc", "log", "memchr", - "nix", + "nix 0.23.0", "num-bigint", "num-complex", "num-integer", @@ -2024,7 +2037,7 @@ dependencies = [ "libc", "log", "memchr", - "nix", + "nix 0.22.0", "radix_trie", "scopeguard", "smallvec", diff --git a/stdlib/Cargo.toml b/stdlib/Cargo.toml index aeeb7ec41..18d2119ec 100644 --- a/stdlib/Cargo.toml +++ b/stdlib/Cargo.toml @@ -55,7 +55,7 @@ base64 = "0.13" csv-core = "0.1" hex = "0.4.0" puruspe = "0.1" -nix = "0.22.1" +nix = "0.23" xml-rs = "0.8" libc = "0.2.102" cfg-if = "1.0.0" diff --git a/vm/Cargo.toml b/vm/Cargo.toml index b2ceb2064..92367915b 100644 --- a/vm/Cargo.toml +++ b/vm/Cargo.toml @@ -49,7 +49,7 @@ indexmap = "1.0.2" ahash = "0.7.2" bitflags = "1.2.1" libc = "0.2.99" -nix = "0.22.1" +nix = "0.23" paste = "1.0.5" is-macro = "0.1" result-like = "0.4.2" From 2c70bf26c3866afb5ec103b13c9cd224f8f7a3b3 Mon Sep 17 00:00:00 2001 From: Noa <33094578+coolreader18@users.noreply.github.com> Date: Wed, 3 Nov 2021 13:29:52 -0500 Subject: [PATCH 2/2] Move the cfg(debug_assertions) inside the quote!} --- derive/src/pyclass.rs | 22 +++++++++++++--------- vm/Cargo.toml | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/derive/src/pyclass.rs b/derive/src/pyclass.rs index 2754a3c04..81a7a6aff 100644 --- a/derive/src/pyclass.rs +++ b/derive/src/pyclass.rs @@ -68,7 +68,7 @@ pub(crate) fn impl_pyimpl(attr: AttributeArgs, item: Item) -> Result Result { let mut withs = Vec::new(); let mut with_slots = Vec::new(); - let mut flags = vec![quote! { ::rustpython_vm::types::PyTypeFlags::DEFAULT.bits() }]; - #[cfg(debug_assertions)] - { - flags.push(quote! { - | ::rustpython_vm::types::PyTypeFlags::_CREATED_WITH_FLAGS.bits() - }); - } + let mut flags = vec![quote! { + { + #[cfg(not(debug_assertions))] { + ::rustpython_vm::types::PyTypeFlags::DEFAULT + } + #[cfg(debug_assertions)] { + ::rustpython_vm::types::PyTypeFlags::DEFAULT + .union(::rustpython_vm::types::PyTypeFlags::_CREATED_WITH_FLAGS) + } + } + }]; for attr in attr { match attr { @@ -905,7 +909,7 @@ fn extract_impl_attrs(attr: AttributeArgs, item: &Ident) -> Result { if let Some(ident) = path.get_ident() { flags.push(quote_spanned! { ident.span() => - | ::rustpython_vm::types::PyTypeFlags::#ident.bits() + .union(::rustpython_vm::types::PyTypeFlags::#ident) }); } else { bail_span!( diff --git a/vm/Cargo.toml b/vm/Cargo.toml index 92367915b..914baf292 100644 --- a/vm/Cargo.toml +++ b/vm/Cargo.toml @@ -47,7 +47,7 @@ hex = "0.4.0" hexf-parse = "0.2.1" indexmap = "1.0.2" ahash = "0.7.2" -bitflags = "1.2.1" +bitflags = "1.3" libc = "0.2.99" nix = "0.23" paste = "1.0.5"