Skip to content

Fix cfgs for wasm32-linux support #1707

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

Merged
merged 1 commit into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/datetime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1881,7 +1881,7 @@ impl<Tz: TimeZone> From<DateTime<Tz>> for SystemTime {
#[cfg(all(
target_arch = "wasm32",
feature = "wasmbind",
not(any(target_os = "emscripten", target_os = "wasi"))
not(any(target_os = "emscripten", target_os = "wasi", target_os = "linux"))
))]
impl From<js_sys::Date> for DateTime<Utc> {
fn from(date: js_sys::Date) -> DateTime<Utc> {
Expand All @@ -1892,7 +1892,7 @@ impl From<js_sys::Date> for DateTime<Utc> {
#[cfg(all(
target_arch = "wasm32",
feature = "wasmbind",
not(any(target_os = "emscripten", target_os = "wasi"))
not(any(target_os = "emscripten", target_os = "wasi", target_os = "linux"))
))]
impl From<&js_sys::Date> for DateTime<Utc> {
fn from(date: &js_sys::Date) -> DateTime<Utc> {
Expand All @@ -1903,7 +1903,7 @@ impl From<&js_sys::Date> for DateTime<Utc> {
#[cfg(all(
target_arch = "wasm32",
feature = "wasmbind",
not(any(target_os = "emscripten", target_os = "wasi"))
not(any(target_os = "emscripten", target_os = "wasi", target_os = "linux"))
))]
impl From<DateTime<Utc>> for js_sys::Date {
/// Converts a `DateTime<Utc>` to a JS `Date`. The resulting value may be lossy,
Expand Down
2 changes: 1 addition & 1 deletion src/offset/local/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ mod inner {
#[cfg(all(
target_arch = "wasm32",
feature = "wasmbind",
not(any(target_os = "emscripten", target_os = "wasi"))
not(any(target_os = "emscripten", target_os = "wasi", target_os = "linux"))
))]
mod inner {
use crate::{Datelike, FixedOffset, MappedLocalTime, NaiveDateTime, Timelike};
Expand Down
6 changes: 3 additions & 3 deletions src/offset/utc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use core::fmt;
not(all(
target_arch = "wasm32",
feature = "wasmbind",
not(any(target_os = "emscripten", target_os = "wasi"))
not(any(target_os = "emscripten", target_os = "wasi", target_os = "linux"))
))
))]
use std::time::{SystemTime, UNIX_EPOCH};
Expand Down Expand Up @@ -89,7 +89,7 @@ impl Utc {
#[cfg(not(all(
target_arch = "wasm32",
feature = "wasmbind",
not(any(target_os = "emscripten", target_os = "wasi"))
not(any(target_os = "emscripten", target_os = "wasi", target_os = "linux"))
)))]
#[must_use]
pub fn now() -> DateTime<Utc> {
Expand All @@ -102,7 +102,7 @@ impl Utc {
#[cfg(all(
target_arch = "wasm32",
feature = "wasmbind",
not(any(target_os = "emscripten", target_os = "wasi"))
not(any(target_os = "emscripten", target_os = "wasi", target_os = "linux"))
))]
#[must_use]
pub fn now() -> DateTime<Utc> {
Expand Down
Loading