mirror of
https://github.com/leptos-rs/leptos.git
synced 2025-12-27 09:54:41 -05:00
fix: only use diagnostic attribute on versions after 1.78
This commit is contained in:
@@ -16,6 +16,7 @@ server_fn_macro_default = { workspace = true }
|
||||
const_format = "0.2.33"
|
||||
const-str = "0.5.7"
|
||||
xxhash-rust = { version = "0.8.12", features = ["const_xxh64"] }
|
||||
rustversion = { workspace = true}
|
||||
# used across multiple features
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
send_wrapper = { version = "0.6.0", features = ["futures"], optional = true }
|
||||
|
||||
@@ -560,13 +560,13 @@ where
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[diagnostic::on_unimplemented(
|
||||
#[rustversion::attr(since(1.78), diagnostic::on_unimplemented(
|
||||
message = "{Self} is not a `Result` or aliased `Result`. Server functions \
|
||||
must return a `Result` or aliased `Result`.",
|
||||
label = "Must return a `Result` or aliased `Result`.",
|
||||
note = "If you are trying to return an alias of `Result`, you must also \
|
||||
implement `FromServerFnError` for the error type."
|
||||
)]
|
||||
))]
|
||||
/// A trait for extracting the error and ok types from a [`Result`]. This is used to allow alias types to be returned from server functions.
|
||||
pub trait ServerFnMustReturnResult {
|
||||
/// The error type of the [`Result`].
|
||||
|
||||
Reference in New Issue
Block a user