Exclude AsRef<Path> for no-std builds
And test no-std in CI.
This commit is contained in:
@@ -44,9 +44,12 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cargo update -p serde_test --precise 1.0.163
|
cargo update -p serde_test --precise 1.0.163
|
||||||
cargo update -p serde --precise 1.0.69
|
cargo update -p serde --precise 1.0.69
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
cargo build -v --no-default-features
|
||||||
|
cargo build --verbose --features "${{ matrix.features }}"
|
||||||
- name: Tests
|
- name: Tests
|
||||||
run: |
|
run: |
|
||||||
cargo build --verbose --features "${{ matrix.features }}"
|
|
||||||
cargo doc --verbose --features "${{ matrix.features }}" --no-deps
|
cargo doc --verbose --features "${{ matrix.features }}" --no-deps
|
||||||
cargo test --verbose --features "${{ matrix.features }}"
|
cargo test --verbose --features "${{ matrix.features }}"
|
||||||
cargo test --release --verbose --features "${{ matrix.features }}"
|
cargo test --release --verbose --features "${{ matrix.features }}"
|
||||||
@@ -54,6 +57,28 @@ jobs:
|
|||||||
if: matrix.bench != ''
|
if: matrix.bench != ''
|
||||||
run: cargo test -v --benches
|
run: cargo test -v --benches
|
||||||
|
|
||||||
|
nostd:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
continue-on-error: false
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- rust: stable
|
||||||
|
target: thumbv6m-none-eabi
|
||||||
|
features: zeroize
|
||||||
|
|
||||||
|
name: nostd/${{ matrix.target }}/${{ matrix.rust }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
|
toolchain: ${{ matrix.rust }}
|
||||||
|
targets: ${{ matrix.target }}
|
||||||
|
- name: Tests
|
||||||
|
run: |
|
||||||
|
cargo rustc "--target=${{ matrix.target }}" --no-default-features --features "${{ matrix.features }}"
|
||||||
|
|
||||||
|
|
||||||
miri:
|
miri:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ use std::fmt;
|
|||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
use std::mem::MaybeUninit;
|
use std::mem::MaybeUninit;
|
||||||
use std::ops::{Deref, DerefMut};
|
use std::ops::{Deref, DerefMut};
|
||||||
|
#[cfg(feature="std")]
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
use std::slice;
|
use std::slice;
|
||||||
@@ -502,6 +503,7 @@ impl<const CAP: usize> fmt::Debug for ArrayString<CAP>
|
|||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { (**self).fmt(f) }
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { (**self).fmt(f) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature="std")]
|
||||||
impl<const CAP: usize> AsRef<Path> for ArrayString<CAP> {
|
impl<const CAP: usize> AsRef<Path> for ArrayString<CAP> {
|
||||||
fn as_ref(&self) -> &Path {
|
fn as_ref(&self) -> &Path {
|
||||||
self.as_str().as_ref()
|
self.as_str().as_ref()
|
||||||
|
|||||||
Reference in New Issue
Block a user