commit | b61a5e8dfb8559fc902e029a0dbcf2cb3c8a79ac | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Wed Dec 11 00:09:17 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Wed Dec 11 00:09:17 2024 +0000 |
tree | a72f02da0693ae0df2205e775b8e7d715f3ce94c | |
parent | c32c63e6c845861da532df639ae33a27d8e35ee2 [diff] | |
parent | 84f95448f7e339b0c93553918647e922869556d5 [diff] |
Snap for 12779445 from 84f95448f7e339b0c93553918647e922869556d5 to sdk-release Change-Id: Idd4b356b41c99307e655e995a2a40fda885f3233
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; }