Releases: sagebind/castaway
Releases · sagebind/castaway
0.2.3
Added
- Enable certain implementations of
LifetimeFree
forno_std
whenalloc
is available based onalloc
feature. @dragazo in #13 - Implement
LifetimeFree
for tuples. @sagebind in #17
Fixed
- More robust
type_eq_non_static
implementation. @dtolnay in #14 - Fix macos CI builds. @sagebind in #15
- Fix miscompilation in
transmute_unchecked
introduced 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
LifetimeFree
forNonZeroUsize
to allow casting toNonZeroUsize
from non-'static
sources which was missing in the prior release. (#7)
Non-static casts for limited lifetime-free types
Breaking changes
- A new
std
crate feature has been added which is enabled by default. To compilecastaway
inno_std
contexts 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'static
bound. It is possible to cast this way to any type implementing the newly-introducedLifetimeFree
trait. (#5, #6)
Allow casting slices
Added
- Allow for casting slices and mutable slices of static item types. (#2)
Result name resolution fix
Fixed
- Fix
Result
not being imported properly in macros, which could result in compilation errors whenResult
currently 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_type
macro now has a slightly different syntax, and match arms must now use irrefutable patterns.