Releases: sagebind/castaway
Releases · sagebind/castaway
v0.2.4
0.2.3
Added
- Enable certain implementations of
LifetimeFreeforno_stdwhenallocis available based onallocfeature. @dragazo in #13 - Implement
LifetimeFreefor tuples. @sagebind in #17
Fixed
- More robust
type_eq_non_staticimplementation. @dtolnay in #14 - Fix macos CI builds. @sagebind in #15
- Fix miscompilation in
transmute_uncheckedintroduced by bug in LLVM. @zheland in #25
Full Changelog: 0.2.2...0.2.3
Fix tests requiring std to be conditional
Implement LifetimeFree for NonZeroUsize
Added
- Implement
LifetimeFreeforNonZeroUsizeto allow casting toNonZeroUsizefrom non-'staticsources which was missing in the prior release. (#7)
Non-static casts for limited lifetime-free types
Breaking changes
- A new
stdcrate feature has been added which is enabled by default. To compilecastawayinno_stdcontexts this feature must be enabled usingdefault-features = false.
Added
- You can now cast to certain types known to be lifetime-free (such as primitive types,
String, common wrapper types, etc) in certain contexts, even if the source value is generic without a'staticbound. It is possible to cast this way to any type implementing the newly-introducedLifetimeFreetrait. (#5, #6)
Allow casting slices
Added
- Allow for casting slices and mutable slices of static item types. (#2)
Result name resolution fix
Fixed
- Fix
Resultnot being imported properly in macros, which could result in compilation errors whenResultcurrently refers to another type in the scope invoked.
Initial release
This is the first release of Castaway. This has the following changes from Castaway's predecessor Transmogrify:
- Casting is performed with a macro instead of a trait. This improves ergonomics by removing the need to always use a turbofish, allows for more intelligent casting of references, and shrinks the public API to allow for taking advantage of future Rust features to allow for more types of casts without breaking changes.
- The
match_typemacro now has a slightly different syntax, and match arms must now use irrefutable patterns.