From 4343affee8c26aa20a9ace281421bcdb5f12ea44 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Mon, 30 Sep 2024 11:57:33 +0800 Subject: [PATCH 1/4] fix: make rustc nigthly work by drop cursor_remaining It only use this nightly feature in unit tests that in `test_bincode_deserialize_many` assert!(buf.is_empty()) its a break change in Cursor nightly feature, so comments this and add FIXME to make rustc nightly work. Signed-off-by: yihong0618 --- src/storage/hummock_trace/src/lib.rs | 5 ++++- src/storage/hummock_trace/src/read.rs | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/storage/hummock_trace/src/lib.rs b/src/storage/hummock_trace/src/lib.rs index 48b0a71010a74..5da9fd927214c 100644 --- a/src/storage/hummock_trace/src/lib.rs +++ b/src/storage/hummock_trace/src/lib.rs @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![feature(cursor_remaining)] +// FIXME: open the assert when 1.8.2 is stable that can use #![feature(cursor_split)] instead of #![feature(cursor_remaining)] +// see: https://github.com/rust-lang/rust/pull/109174 +// #![feature(cursor_remaining)] + #![feature(trait_alias)] #![feature(coroutines)] diff --git a/src/storage/hummock_trace/src/read.rs b/src/storage/hummock_trace/src/read.rs index bf6563123044c..6fa23e1732688 100644 --- a/src/storage/hummock_trace/src/read.rs +++ b/src/storage/hummock_trace/src/read.rs @@ -185,7 +185,9 @@ mod test { } assert!(deserializer.deserialize(&mut buf).is_err()); - assert!(buf.is_empty()); + // FIXME: open the assert when 1.8.2 is stable that can use #![feature(cursor_split)] instead of #![feature(cursor_remaining)] + // see: https://github.com/rust-lang/rust/pull/109174 + // assert!(buf.is_empty()); } #[test] From f8dac95452ef90ecb59089f34d78ddd43e0af015 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Mon, 30 Sep 2024 12:14:33 +0800 Subject: [PATCH 2/4] fix: ci lint Signed-off-by: yihong0618 --- src/storage/hummock_trace/src/lib.rs | 3 ++- src/storage/hummock_trace/src/read.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/storage/hummock_trace/src/lib.rs b/src/storage/hummock_trace/src/lib.rs index 5da9fd927214c..edfa1a4bb74f4 100644 --- a/src/storage/hummock_trace/src/lib.rs +++ b/src/storage/hummock_trace/src/lib.rs @@ -13,7 +13,8 @@ // limitations under the License. // FIXME: open the assert when 1.8.2 is stable that can use #![feature(cursor_split)] instead of #![feature(cursor_remaining)] -// see: https://github.com/rust-lang/rust/pull/109174 + +// see: https://github.com/rust-lang/rust/pull/109174 // #![feature(cursor_remaining)] #![feature(trait_alias)] diff --git a/src/storage/hummock_trace/src/read.rs b/src/storage/hummock_trace/src/read.rs index 6fa23e1732688..c21e2c0b7b522 100644 --- a/src/storage/hummock_trace/src/read.rs +++ b/src/storage/hummock_trace/src/read.rs @@ -186,7 +186,8 @@ mod test { assert!(deserializer.deserialize(&mut buf).is_err()); // FIXME: open the assert when 1.8.2 is stable that can use #![feature(cursor_split)] instead of #![feature(cursor_remaining)] - // see: https://github.com/rust-lang/rust/pull/109174 + + // see: https://github.com/rust-lang/rust/pull/109174 // assert!(buf.is_empty()); } From d268f9a0e430e228287bce71dc1b7af6aa1b9f38 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Mon, 30 Sep 2024 17:21:23 +0800 Subject: [PATCH 3/4] fix: use new assert instead of only comment it Signed-off-by: yihong0618 --- src/storage/hummock_trace/src/read.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/storage/hummock_trace/src/read.rs b/src/storage/hummock_trace/src/read.rs index c21e2c0b7b522..200467012f3db 100644 --- a/src/storage/hummock_trace/src/read.rs +++ b/src/storage/hummock_trace/src/read.rs @@ -185,10 +185,12 @@ mod test { } assert!(deserializer.deserialize(&mut buf).is_err()); - // FIXME: open the assert when 1.8.2 is stable that can use #![feature(cursor_split)] instead of #![feature(cursor_remaining)] + // FIXME: use buf.is_empty() when 1.8.2 is stable that can use #![feature(cursor_split)] instead of #![feature(cursor_remaining)] // see: https://github.com/rust-lang/rust/pull/109174 // assert!(buf.is_empty()); + + assert_eq!(buf.get_ref().len() as u64 - buf.position(), 0); } #[test] From 0bf46a05597145f27831ae694a0dd8b4cb50e890 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Tue, 8 Oct 2024 13:18:59 +0800 Subject: [PATCH 4/4] fix: nightly build for map_entry_replace Signed-off-by: yihong0618 --- src/common/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/common/src/lib.rs b/src/common/src/lib.rs index e3417853b0201..5e34c6e4a9705 100644 --- a/src/common/src/lib.rs +++ b/src/common/src/lib.rs @@ -35,7 +35,6 @@ #![feature(iter_order_by)] #![feature(binary_heap_into_iter_sorted)] #![feature(impl_trait_in_assoc_type)] -#![feature(map_entry_replace)] #![feature(negative_impls)] #![feature(register_tool)] #![feature(btree_cursors)]