Skip to content

Commit

Permalink
Add conversion traits for unified type casts:
Browse files Browse the repository at this point in the history
* `Reinterpret`
* `TryReinterpret`
* `ReinterpretInner`
* `TryReinterpretInner`
  • Loading branch information
Jarcho committed Apr 7, 2023
1 parent 8391afa commit 7908e64
Show file tree
Hide file tree
Showing 76 changed files with 6,979 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ jobs:
- run: cargo miri test --verbose --all-features
- run: cd derive && rm -fr target && cargo miri test --verbose --all-features

ui-test:
name: Test compiler errors
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: stable
- uses: actions/checkout@v3
- run: cargo test -p uitest

sanitizer-test:
name: Test with -Zsanitizer=${{ matrix.sanitizer }}
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Cargo.lock

/derive/target/
/derive/.vscode/
/uitest/wip/
15 changes: 13 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ edition = "2018"
license = "Zlib OR Apache-2.0 OR MIT"
exclude = ["/pedantic.bat"]

[workspace]
members = ["uitest", "derive"]

[features]
# In v2 we'll fix these names to be more "normal".
derive = ["bytemuck_derive"]
Expand All @@ -19,8 +22,12 @@ extern_crate_std = ["extern_crate_alloc"]
zeroable_maybe_uninit = []
zeroable_atomics = []
min_const_generics = []
wasm_simd = [] # Until >= 1.54.0 is MSRV this is an off-by-default feature.
aarch64_simd = [] # Until >= 1.59.0 is MSRV this is an off-by-default feature.

# Off-by-default until bytemuck's MSRV is raised.
wasm_simd = [] # Requires MSRV >= 1.54.0.
unified_cast = [] # Requires MSRV >= 1.57.0.
aarch64_simd = [] # Requires MSRV >= 1.59.0.
non_null_slice_cast = [] # Requires MSRV >= 1.63.0.

# Do not use if you can avoid it, because this is unsound.
unsound_ptr_pod_impl = []
Expand All @@ -42,6 +49,8 @@ features = [
"zeroable_atomics",
"min_const_generics",
"wasm_simd",
"unified_cast",
"non_null_slice_cast",
]

[package.metadata.playground]
Expand All @@ -54,4 +63,6 @@ features = [
"zeroable_atomics",
"min_const_generics",
"wasm_simd",
"unified_cast",
"non_null_slice_cast",
]
Loading

0 comments on commit 7908e64

Please sign in to comment.