commit | 84f95448f7e339b0c93553918647e922869556d5 | [log] [tgz] |
---|---|---|
author | James Farrell <[email protected]> | Tue Dec 03 20:15:30 2024 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Dec 03 20:15:30 2024 +0000 |
tree | a72f02da0693ae0df2205e775b8e7d715f3ce94c | |
parent | cbf193c01a71fa1a39e4da5024ba86e844675fd4 [diff] | |
parent | 4dc2762c1a9f14b15a4a90bf1eecb3c06b4d6756 [diff] |
Migrate 9 newly imported crates to monorepo am: 4dc2762c1a Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/ptr_meta/+/3390019 Change-Id: I4211c5b254d71227bb752b9420b5ba8b159bb482 Signed-off-by: Automerger Merge Worker <[email protected]>
A radioactive stabilization of the ptr_meta
RFC.
Sized types already have Pointee
implemented for them, so most of the time you won't have to worry about them. However, trying to derive Pointee
for a struct that may or may not have a DST as its last field will cause an implementation conflict with the automatic sized implementation.
slice
s and str
sThese core types have implementations built in.
You can derive Pointee
for last-field DSTs:
use ptr_meta::Pointee; #[derive(Pointee)] struct Block<H, T> { header: H, elements: [T], }
You can generate a Pointee
for trait objects:
use ptr_meta::pointee; // Generates Pointee for dyn Stringy #[pointee] trait Stringy { fn as_string(&self) -> String; }