commit | e9bdf9489228ba6f7c838f10399e28ce73c547cf | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Wed Nov 20 00:13:29 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Wed Nov 20 00:13:29 2024 +0000 |
tree | b61d95ec9886160da286dc347580a37fa35c0f2b | |
parent | 6a4242137a1369c9eca872cd5a51e51aeb66ccb9 [diff] | |
parent | fabd8fb43539cd036fd9001eaa670acabbd3a7a6 [diff] |
Snap for 12680993 from fabd8fb43539cd036fd9001eaa670acabbd3a7a6 to 25Q1-release Change-Id: I270f635a672ba372cd832aa0010235366bec4f48
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; }