Skip to content

Commit

Permalink
Fix build issues with no_std and ptr_metadata
Browse files Browse the repository at this point in the history
Fix CI script
Fix warnings in on no_std

Signed-off-by: Tin Svagelj <tin.svagelj@live.com>
  • Loading branch information
Caellian committed Aug 29, 2023
1 parent 2297bbe commit 6881138
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ jobs:
- uses: actions/checkout@v3
- name: Build default
run: cargo build --verbose
- name: Build
run: cargo build --verbose --features ptr_metadata error_in_core
- name: Build no_std
run: cargo build --verbose --no-default-features --features no_std,error_in_core
- name: Build with ptr_metadata
run: cargo build --verbose --features ptr_metadata
- name: Build restrictive
run: cargo build --verbose --no-default-features --features std
- name: Run tests
run: cargo test --verbose --features ptr_metadata error_in_core
run: cargo test --verbose --features ptr_metadata
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ portable-atomic = { version = "1", default-features = false }
spin = { version = "0.9", optional = true }

[features]
default = ["no_std", "leak_data"]
default = ["std", "leak_data"]
std = ["portable-atomic/std"]
no_std = ["dep:spin"]
debug = []
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ impl<T: ?Sized> SyncContiguousMemoryRef<T> {
{
unsafe {
SyncContiguousMemoryRef {
inner: std::mem::transmute(self.inner),
inner: core::mem::transmute(self.inner),
metadata,
}
}
Expand Down Expand Up @@ -647,7 +647,7 @@ impl<T: ?Sized> ContiguousMemoryRef<T> {
{
unsafe {
ContiguousMemoryRef {
inner: std::mem::transmute(self.inner),
inner: core::mem::transmute(self.inner),
metadata,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl<T> LockTypesafe<T> for Mutex<T> {
}
fn try_lock_named(
&self,
which: MutexKind,
_which: MutexKind,
) -> Result<MutexGuard<T>, crate::error::LockingError> {
match self.try_lock() {
Some(it) => Ok(it),
Expand Down

0 comments on commit 6881138

Please sign in to comment.