Commit Graph

300 Commits

Author SHA1 Message Date
Lokathor
d75942c484 (cargo-release) version 1.11.0 2022-07-23 21:15:23 -06:00
Lokathor
5ed7a7fc52
Update changelog.md 2022-07-23 21:12:15 -06:00
Waffle Maybe
0fe2b2c568
Add {wrap,peel}_box functions to TransparentWrapperAlloc (#119)
* Add `{wrap,peel}_box` functions to `TransparentWrapperAlloc`

* Add tests for `{wrap,peel}_box`
2022-07-23 21:09:32 -06:00
Lokathor
a053f1d887 derive version bump. 2022-07-18 19:27:55 -06:00
Lokathor
89bbdb1620 spelling 2022-07-18 19:25:57 -06:00
Edward
2864b52591
Fix/syn broken semver (#116)
* fix(derive): syn backwards compatibility

* fix: bump minimum syn version more after tests
2022-07-18 19:25:00 -06:00
piwicode
9d90497f7c
Replace LICENCES-* symlinks with a licence copy. (#118)
Fixes the licences content in bytemuck_derive.

Archives on crates.io does not contain a licence copy, but
just a file containing the symlink relative path instead.

https://static.crates.io/crates/bytemuck_derive/bytemuck_derive-1.1.0.crate
2022-07-13 06:53:17 -06:00
daxpedda
237d7d3730
Avoid clippy::missing_const_for_fn (#115) 2022-07-08 17:16:25 -06:00
Gray Olson
e612031c1f
Add try_zeroed_vec and zeroed_vec (#117)
* add `try_zeroed_vec` and `zeroed_vec`, adjust impl of `try_zeroed_slice_box`

* go back to returning an error rather than calling handle_alloc_error

* use boxed slice .into_vec instead :)
2022-07-07 08:54:34 -06:00
Lokathor
bf68430b59 (cargo-release) version 1.10.0 2022-07-02 18:14:46 -06:00
Lokathor
919c69cc4e changelog 2022-07-02 15:46:07 -06:00
Lokathor
6beb5382ec move this little guy where he goes 2022-07-02 15:30:08 -06:00
Lokathor
fda9e9f852 improve docs 2022-07-02 15:29:48 -06:00
Lokathor
1f265a9e0d Move the FooInOption traits into their own files for easier organization. 2022-07-02 15:21:11 -06:00
Edward
abe55e525e
feat: add TransparentWrapperAlloc trait (#111)
* feat: add TransparentWrapperAlloc trait

* implements wrap_vec and peel_vec

* fix: review comments

* remote asserts as they don't do anything
* avoid issue with stacked borrows
2022-06-28 17:55:31 -06:00
Edward
e8cd71df54
feat: ZeroableInOption and PodInOption traits (#114)
* same as Zeroable and Pod but for types which are Zeroable and Pod when
  wrapped in Option
* allows downstream users to implement Zeroable and Pod for their own
  Option<T> types without running into orphan rules
2022-06-28 17:54:56 -06:00
nils
e9eb13e0e7
Use `-Zmiri-tag-raw-pointers in CI (#113)
Normal Miri does not provide sufficient safety guarantees. Using the flag `-Zmiri-tag-raw-pointers` also checks usage of pointers in a more strict way.
2022-06-26 10:22:38 -06:00
John
d691aa6a14
implement NoUninit for NonZero* (#107) 2022-06-06 13:20:34 -06:00
HeroicKatora
21e2ac55d7
Note on shared references to Pod-like types (#106)
* Note on shared references to Pod-like types

* Expand explanation of no-interior-mutability
2022-05-19 11:47:54 -06:00
Nicholas Bishop
96f2e549b3
Fix docstring typo (#104) 2022-05-13 14:51:43 -06:00
mystise
d8b67687f3
Add cast_slice_box and try_cast_slice_box, changed try_cast_vec to adjust length and capacity when valid. (#100)
* Added try_cast_slice_box and cast_slice_box

* Modified try_cast_slice_box and try_cast_vec to recalculate the length if the change in size between the two types is valid.

* Ran cargo format
2022-04-19 11:50:28 -06:00
Lokathor
b75005c4d0 (cargo-release) version 1.9.1 2022-04-01 23:49:36 -06:00
Lokathor
f7963d6281 update changelog. 2022-04-01 23:49:13 -06:00
Justin Starry
26e1495d61
Bump bytemuck_derive dependency to required version (#97) 2022-04-01 11:55:28 -06:00
Lokathor
73ae1ee89e (cargo-release) version 1.1.0 2022-03-29 23:15:56 -06:00
Lokathor
4459b9295c changelog for the derives. 2022-03-29 23:15:32 -06:00
Lokathor
73eaaaf9b8 (cargo-release) version 1.9.0 2022-03-29 23:14:16 -06:00
Lokathor
950ae43012 back to the correct derive dependency line 2022-03-29 23:13:34 -06:00
Lokathor
d8215fb95a
Update changelog.md (#96)
* Update changelog.md

* Update changelog.md

* Use the `5` instead of an `s`, because we're l33t
2022-03-29 23:10:43 -06:00
Gray Olson
1fb245c926
rename NoPadding to NoUninit and clarify docs (#95) 2022-03-29 21:25:51 -06:00
Gray Olson
1652a2dcd2
Support unions in derive macros (#94)
* allow deriving traits on unions in some cases

* basic union tests for nopadding and anybitpattern

* implement derives for unions for more traits

* remove Pod and AnyBitPattern derives for unions due to possible unsoundness
2022-03-29 20:01:48 -06:00
Gray Olson
b472189ff8
Add NoPadding, AnyBitPattern, and CheckedBitPattern traits (#91)
* add MaybePod and NoPadding traits

* MaybePod and NoPadding derive macros

* fix doctest

* fmt

* fix bad doc link

* move new casting functions into separate modules

* fmt

* fix doctest and derive test

* remove relaxed module, add anybitpattern

* rename MaybePod to CheckedCastFromPod

* rename checked casting functions

* rework CheckedCastFromPod into CheckedBitPattern

* add anybitpattern derive, fix up other derives

* fix doctest

* fix derive trait of bits type

* export AnyBitPattern derive

* export anybitpattern from traits

* actually export derive macro for AnyBitPattern

* make bits struct pub because of type leaking rules

* allow clippy lint in derive

* add copy bound to CheckedBitPattern

* - replace Pod bounds with NoPadding+AnyBitPattern
- add try and panic versions of checked cast functions
- slightly update docs

* fix derive tests

* - adapt the allocation module cast functions as well
- as part of that, make AnyBitPattern a subtrait of Zeroable
- AnyBitPattern derive also derives Zeroable

* @JakobDegen and @zakarumych nits

* superset -> subset on CheckedBitPattern and NoPadding docs

* derive Debug on generated `Bits` structs, which can be useful for debugging failures

* don't derive debug on spirv target arch

* make it work on 1.34

* merge conflicts

* fix erroneous behavior in doctest
2022-03-29 17:01:02 -06:00
Lokathor
4569a30c9f (cargo-release) version 1.8.0 2022-03-01 18:12:36 -07:00
Lokathor
bd6bb87225 changelog 2022-03-01 18:11:07 -07:00
Lokathor
7fa51a420d
pod_read_unaligned and try_pod_read_unaligned (#92)
* pod_read_unaligned and try_pod_read_unaligned

* only do all-features on nightly.

* I forgot we can't use .cast on 1.34
2022-03-01 18:09:49 -07:00
Christopher Serr
6029639753
Implement Pod and Zeroable for AArch64 NEON Vectors (#80)
* Implement `Pod` and `Zeroable` for AArch64 NEON Vectors

The NEON intrinsics will be stabilized in Rust 1.59.

* Compile all-features only on nightly
2021-12-21 19:01:47 -07:00
Lokathor
e32f013a06 (cargo-release) version 1.7.3 2021-12-15 23:20:30 -07:00
Lokathor
87e78fefd7 update changelog. 2021-12-15 23:19:43 -07:00
Lokathor
c8ffbd19dd Merge branch 'main' of https://github.com/Lokathor/bytemuck into main 2021-12-15 23:16:42 -07:00
Lokathor
dd01ccae42 nightly_portable_simd 2021-12-15 23:16:38 -07:00
Alphyr
3923766b67
Impls for PhantomPinned and more PhantomData (#79) 2021-12-08 18:59:22 -07:00
Lokathor
a64046f3b8 Create FUNDING.yml 2021-12-08 00:38:14 -07:00
Lokathor
f9edfed1d5
Update README.md
Closes https://github.com/Lokathor/bytemuck/issues/77
2021-11-15 12:25:59 -07:00
Christopher Serr
944c90ca3f
Support WASM SIMD's v128 type (#73)
Due to the MSRV it is behind a feature gate.
2021-10-15 13:46:52 -06:00
Gauthier Segay
9ea604addb
minor doc patch to help users adjust their Cargo.toml for usage of the allocation module. (#76)
* just pointer to how to set the crate feature

helps the Cargo newbies to enable the feature easily while reading the documentation.

* Update allocation.rs
2021-10-15 13:45:16 -06:00
Lokathor
e01c6b3a2d (cargo-release) start next development iteration 1.7.3-alpha.0 2021-07-22 23:30:18 -06:00
Lokathor
be16fe2958 (cargo-release) version 1.7.2 2021-07-22 23:29:59 -06:00
Lokathor
77b8b39e40 changelog. 2021-07-22 23:29:45 -06:00
Lokathor
d8b26f4eef Merge branch 'main' of https://github.com/Lokathor/bytemuck into main 2021-07-22 23:27:12 -06:00
Lokathor
8ea087185e (cargo-release) start next development iteration 1.7.2-alpha.0 2021-07-22 23:26:51 -06:00