Skip to content

Commit

Permalink
Merge pull request #947 from stargazing-dino/no_std_sync
Browse files Browse the repository at this point in the history
Use alloc for `Shared` type
  • Loading branch information
schungx authored Jan 5, 2025
2 parents ae662cb + 1ae69a1 commit eb81baf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/func/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ impl<T> SendSync for T {}

/// Immutable reference-counted container.
#[cfg(not(feature = "sync"))]
pub use std::rc::Rc as Shared;
// TODO: Further audit no_std compatibility
// When building with no_std + sync features, explicit imports from alloc
// are needed despite using no_std_compat. This fixed compilation errors
// around missing trait implementations for some users.
pub use alloc::rc::Rc as Shared;

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,no_float,serde,metadata,internals,debugging, sta...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (stable, macos-latest, false)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,no_position,serde,metadata,internals,debugging, ...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,f32_float,serde,metadata,internals,debugging, st...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,no_optimize,serde,metadata,internals,debugging, ...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (nightly, ubuntu-latest, true, --features unstable)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (beta, ubuntu-latest, false, --features unstable)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Codegen Build (stable, ubuntu-latest, false, --features metadata)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,only_i64,serde,metadata,internals,debugging, sta...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Check Wasm build (--target wasm32-unknown-unknown --no-default-features)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,no_custom_syntax,serde,metadata,internals,debugg...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Check Wasm build (--target wasm32-unknown-unknown --no-default-features --features wasm-bindgen)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Check Wasm build (--target wasm32-wasi)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,no_index,serde,metadata,internals,debugging, sta...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Check Formatting

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,no_module,serde,metadata,internals,debugging, st...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,no_closure,serde,metadata,internals,debugging, s...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,metadata, stable, false)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,no_time,no_function,no_float,no_position,no_inde...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,no_float,decimal, stable, false)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,no_function,serde,metadata,internals,debugging, ...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (stable, windows-latest, false)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,no_object,serde,metadata,internals,debugging, st...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,serde, stable, false)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,no_time,serde,metadata,internals,debugging, stab...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,decimal, stable, false)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,decimal,serde,metadata,internals,debugging, stab...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,unicode-xid-ident, stable, false)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,internals, stable, false)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,debugging, stable, false)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --tests --features testing-environ,only_i32,serde,metadata,internals,debugg...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, stable, false)

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,unchecked,serde,metadata,internals,debugging, st...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 37 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / msrv

failed to resolve: use of undeclared crate or module `alloc`
/// Immutable reference-counted container.
#[cfg(feature = "sync")]
pub use std::sync::Arc as Shared;
// TODO: Further audit no_std compatibility
// While no_std_compat should map std::sync::Arc to alloc::sync::Arc,
// there appear to be cases where this mapping fails.
pub use alloc::sync::Arc as Shared;

Check failure on line 43 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,sync,serde,metadata,internals,debugging, stable,...

failed to resolve: use of undeclared crate or module `alloc`

Check failure on line 43 in src/func/native.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,sync,no_time,no_function,no_float,no_position,no...

failed to resolve: use of undeclared crate or module `alloc`

/// Synchronized shared object.
#[cfg(not(feature = "sync"))]
Expand Down

0 comments on commit eb81baf

Please sign in to comment.