diff --git a/Cargo.lock b/Cargo.lock index 40a5f4e02f..9b699df62a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -53,6 +53,12 @@ dependencies = [ "memchr 2.3.3", ] +[[package]] +name = "aliasable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" + [[package]] name = "ansi_term" version = "0.11.0" @@ -2753,21 +2759,23 @@ dependencies = [ [[package]] name = "ouroboros" -version = "0.5.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc04551635026d3ac7bc646698ea1836a85ed2a26b7094fe1d15d8b14854c4a2" +checksum = "f0e3827c8742f21283e9374adf7905984e7b85731ad94a203137b56955d818b3" dependencies = [ + "aliasable", "ouroboros_macro", "stable_deref_trait", ] [[package]] name = "ouroboros_macro" -version = "0.5.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cec33dfceabec83cd0e95a5ce9d20e76ab3a5cbfef59659b8c927f69b93ed8ae" +checksum = "1ef06077e08eac7e2aeaacfbd113a25fcb1b9b903437bd89d2bd513da6e04112" dependencies = [ "Inflector", + "proc-macro-error", "proc-macro2 1.0.24", "quote 1.0.6", "syn 1.0.60", @@ -3100,6 +3108,30 @@ dependencies = [ "toml", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2 1.0.24", + "quote 1.0.6", + "syn 1.0.60", + "version_check 0.9.2", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2 1.0.24", + "quote 1.0.6", + "version_check 0.9.2", +] + [[package]] name = "proc-macro-hack" version = "0.5.19" diff --git a/ci/test-checks.sh b/ci/test-checks.sh index 6f8ff8d9c7..7352a59806 100755 --- a/ci/test-checks.sh +++ b/ci/test-checks.sh @@ -67,7 +67,8 @@ _ ci/order-crates-for-publishing.py # -Z... is needed because of clippy bug: https://github.com/rust-lang/rust-clippy/issues/4612 # run nightly clippy for `sdk/` as there's a moderate amount of nightly-only code there -_ "$cargo" nightly clippy -Zunstable-options --workspace --all-targets -- --deny=warnings --deny=clippy::integer_arithmetic +_ "$cargo" nightly clippy -Zunstable-options --workspace --all-targets -- \ + --deny=warnings --deny=clippy::integer_arithmetic --allow=clippy::inconsistent_struct_constructor _ "$cargo" stable fmt --all -- --check diff --git a/programs/bpf/Cargo.lock b/programs/bpf/Cargo.lock index ddbbe4cb5b..a43102bea7 100644 --- a/programs/bpf/Cargo.lock +++ b/programs/bpf/Cargo.lock @@ -42,6 +42,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "aliasable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" + [[package]] name = "ansi_term" version = "0.11.0" @@ -1957,21 +1963,23 @@ dependencies = [ [[package]] name = "ouroboros" -version = "0.5.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc04551635026d3ac7bc646698ea1836a85ed2a26b7094fe1d15d8b14854c4a2" +checksum = "f0e3827c8742f21283e9374adf7905984e7b85731ad94a203137b56955d818b3" dependencies = [ + "aliasable", "ouroboros_macro", "stable_deref_trait", ] [[package]] name = "ouroboros_macro" -version = "0.5.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cec33dfceabec83cd0e95a5ce9d20e76ab3a5cbfef59659b8c927f69b93ed8ae" +checksum = "1ef06077e08eac7e2aeaacfbd113a25fcb1b9b903437bd89d2bd513da6e04112" dependencies = [ "Inflector", + "proc-macro-error", "proc-macro2 1.0.24", "quote 1.0.6", "syn 1.0.67", @@ -2169,6 +2177,30 @@ dependencies = [ "toml", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2 1.0.24", + "quote 1.0.6", + "syn 1.0.67", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2 1.0.24", + "quote 1.0.6", + "version_check", +] + [[package]] name = "proc-macro-hack" version = "0.5.19" diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 8399cbd244..b4b8bd93a4 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -30,7 +30,7 @@ memmap2 = "0.1.0" num-derive = { version = "0.3" } num-traits = { version = "0.2" } num_cpus = "1.13.0" -ouroboros = "0.5.1" +ouroboros = "0.10.0" rand = "0.7.0" rayon = "1.5.0" regex = "1.3.9" diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index ebf671ec3f..16985fd342 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -115,6 +115,7 @@ impl AccountMapEntryInner { pub struct ReadAccountMapEntry { owned_entry: AccountMapEntry, #[borrows(owned_entry)] + #[covariant] slot_list_guard: RwLockReadGuard<'this, SlotList>, } @@ -132,7 +133,7 @@ impl ReadAccountMapEntry { } pub fn ref_count(&self) -> &AtomicU64 { - &self.borrow_owned_entry_contents().ref_count + &self.borrow_owned_entry().ref_count } pub fn unref(&self) { @@ -144,6 +145,7 @@ impl ReadAccountMapEntry { pub struct WriteAccountMapEntry { owned_entry: AccountMapEntry, #[borrows(owned_entry)] + #[covariant] slot_list_guard: RwLockWriteGuard<'this, SlotList>, } @@ -168,7 +170,7 @@ impl WriteAccountMapEntry { } pub fn ref_count(&self) -> &AtomicU64 { - &self.borrow_owned_entry_contents().ref_count + &self.borrow_owned_entry().ref_count } // Try to update an item in the slot list the given `slot` If an item for the slot