From d15d7149b17e8b399cf4030580649cc18b59ed6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kj=C3=A4ll?= Date: Sat, 14 Feb 2026 21:02:46 +0100 Subject: [PATCH 1/2] fix smol_str compilation error the command 'cargo build --no-default-features --features borsh' failed with: error[E0599]: no function or associated item named 'other' found for struct 'borsh::io::Error' in the current scope --> lib/smol_str/src/borsh.rs:33:39 | 33 | .ok_or_else(|| Error::other("u8::vec_from_reader unexpectedly returned None"))?; | ^^^^^ function or associated item not found in 'borsh::io::Error' | --- src/tools/rust-analyzer/lib/smol_str/src/borsh.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tools/rust-analyzer/lib/smol_str/src/borsh.rs b/src/tools/rust-analyzer/lib/smol_str/src/borsh.rs index 527ce85a1746..b684a4910c96 100644 --- a/src/tools/rust-analyzer/lib/smol_str/src/borsh.rs +++ b/src/tools/rust-analyzer/lib/smol_str/src/borsh.rs @@ -29,8 +29,9 @@ impl BorshDeserialize for SmolStr { })) } else { // u8::vec_from_reader always returns Some on success in current implementation - let vec = u8::vec_from_reader(len, reader)? - .ok_or_else(|| Error::other("u8::vec_from_reader unexpectedly returned None"))?; + let vec = u8::vec_from_reader(len, reader)?.ok_or_else(|| { + Error::new(ErrorKind::Other, "u8::vec_from_reader unexpectedly returned None") + })?; Ok(SmolStr::from(String::from_utf8(vec).map_err(|err| { let msg = err.to_string(); Error::new(ErrorKind::InvalidData, msg) From 8d3b9f4a81f7763e7901287a477bc4e17e16f30b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kj=C3=A4ll?= Date: Sun, 15 Feb 2026 10:28:47 +0100 Subject: [PATCH 2/2] gate borsh tests on std also, as they depend on both --- src/tools/rust-analyzer/lib/smol_str/tests/test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rust-analyzer/lib/smol_str/tests/test.rs b/src/tools/rust-analyzer/lib/smol_str/tests/test.rs index 640e7df681c9..00fab2ee1c7f 100644 --- a/src/tools/rust-analyzer/lib/smol_str/tests/test.rs +++ b/src/tools/rust-analyzer/lib/smol_str/tests/test.rs @@ -393,7 +393,7 @@ mod test_str_ext { } } -#[cfg(feature = "borsh")] +#[cfg(all(feature = "borsh", feature = "std"))] mod borsh_tests { use borsh::BorshDeserialize; use smol_str::{SmolStr, ToSmolStr};