fix: limit server_fn server macro trybuild tests nightly only

This commit is contained in:
Saber Haj Rabiee
2025-05-02 08:32:38 -07:00
parent eed3d21b40
commit 3a4e2a19aa
4 changed files with 18 additions and 2 deletions

View File

@@ -16,7 +16,7 @@ server_fn_macro_default = { workspace = true }
const_format = "0.2.33"
const-str = "0.6.2"
xxhash-rust = { version = "0.8.12", features = ["const_xxh64"] }
rustversion = { workspace = true}
rustversion = { workspace = true }
# used across multiple features
serde = { version = "1.0", features = ["derive"] }
send_wrapper = { version = "0.6.0", features = ["futures"], optional = true }
@@ -82,6 +82,9 @@ url = "2"
pin-project-lite = "0.2.15"
tokio = { version = "1.43.0", features = ["rt"], optional = true }
[build-dependencies]
rustc_version = "0.4.1"
[dev-dependencies]
trybuild = { workspace = true }
@@ -238,4 +241,7 @@ skip_feature_sets = [
max_combination_size = 2
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(leptos_debuginfo)'] }
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(leptos_debuginfo)',
'cfg(rustc_nightly)',
] }

8
server_fn/build.rs Normal file
View File

@@ -0,0 +1,8 @@
use rustc_version::{version_meta, Channel};
fn main() {
// Set cfg flags depending on release channel
if matches!(version_meta().unwrap().channel, Channel::Nightly) {
println!("cargo:rustc-cfg=rustc_nightly");
}
}

View File

@@ -3,6 +3,7 @@
// multiple combinations of features are tested. This ensures this file is only
// run when **only** the browser feature is enabled.
#![cfg(all(
rustc_nightly,
feature = "browser",
not(any(
feature = "postcard",