commit | dd18921148681def463532cdbdbcde3890531a3d | [log] [tgz] |
---|---|---|
author | Frank Piva <pivaf@google.com> | Sat Nov 16 17:07:48 2024 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Sat Nov 16 17:07:48 2024 +0000 |
tree | e3716c104122c3d29575070ad0d924ac9d572e9d | |
parent | c83e70be36108dfe8c1d680cd094caafecdf1423 [diff] | |
parent | 61a465c3335c310ded5917ca720c576941dd1671 [diff] |
Merge remote-tracking branch 'origin/upstream' am: 61a465c333 Original change: undetermined Change-Id: I8dfd1a72f9cfb179b94378bdf1844827e5d95250 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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; }