commit | 0b6dd64f89898f06d1c0bdf294d51df68b33977a | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Wed Dec 04 00:12:56 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Wed Dec 04 00:12:56 2024 +0000 |
tree | a72f02da0693ae0df2205e775b8e7d715f3ce94c | |
parent | e9bdf9489228ba6f7c838f10399e28ce73c547cf [diff] | |
parent | cab10406ac0bf318dbe127f268adcce517e8ac83 [diff] |
Snap for 12742097 from cab10406ac0bf318dbe127f268adcce517e8ac83 to 25Q1-release Change-Id: Iee68de03fea12f616fdab1aa8ee395d7b20bf31c
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; }