-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
borsh::io::Error::new
diverges from std::io::Error
#342
Comments
@kayabaNerve i guess i did notice this discrepancy too when moving the module back and forth.
|
yes, ok, the reason is that https://doc.rust-lang.org/std/error/trait.Error.html was never transferred to If one starts to transfer that, then he/she would become unsure of when to stop. @kayabaNerve you'd have to share the results of your experiments, in which way specifically borsh is blocking you. /// let custom_error = Error::new(ErrorKind::Other, "oh no!");
thas is all, which is the only thing https://doc.rust-lang.org/std/string/struct.String.html#impl-From%3CString%3E-for-Box%3Cdyn+Error%3E |
this thingy looks relatively actively used, especially recently, https://crates.io/crates/no_std_io but then it doesn't look too officially and actively maintained |
There is now core::error::Error if the MSRV bump is acceptable. There doesn't have to be a reproduction of it. Otherwise, I'd advocate a |
The msrv bump feels a little too high, we could try doing https://crates.io/crates/rustversion |
Just a note: Rust 1.81 is the last version that compiles wasm files compatible with nearcore out of the box. The newer Rust versions include new Wasm features that are not supported by Wasm runtime in nearcore. What worries me much more is the breaking change. While I don't like misalignment, the breaking change + too recent MSRV make me really uneasy, and I would strongly consider keeping it as is until there is a real demand for this to be fixed or we batch it with other breaking changes |
@frol Isn't that why wasm32v1-none, tier 2 since 1.84, explicitly exists? |
@kayabaNerve |
From the very link you cited. The fact wasm targets doesn't support std inherently is a limitation of WASM being a machine specification, not a full operating system, and not a limitation of the specific target I noted. |
@kayabaNerve I certanly understand that, but I refer to developer experience that we don't want to degrade for near-sdk-rs users, which is why we don't want to switch to recommending wasm32v1-none and still have to use wasm32-unknown-unknown, and as such support for Rust 1.81 is helpful since 1.82 introduced new default features to wasm32-unknown-unknown target that are not yet supported by nearcore |
borsh-rs/borsh/src/nostd_io.rs
Line 229 in a34f324
https://docs.rs/borsh/latest/borsh/io/struct.Error.html#method.new
Into<String>
vsInto<Box<dyn Error + Send + Sync>>
.I don't see a reason why it should be so specialized. This is technically a breaking change for the no-std API, as a type may impl
Into<String>
but notInto<Box<dyn Error>>
, but I'd argue it as a bug fix.I open this issue not for the hell of it, but because I did run into this while mapping borsh's no-std
io
to some work of my own.The text was updated successfully, but these errors were encountered: