-
Notifications
You must be signed in to change notification settings - Fork 61
Validity of wide pointer metadata #166
Copy link
Copy link
Closed
Labels
A-validityTopic: Related to validity invariantsTopic: Related to validity invariantsS-pending-designStatus: Resolving this issue requires addressing some open design questionsStatus: Resolving this issue requires addressing some open design questionsmeeting-proposedProposed to be discussed at a future t-opsem meetingProposed to be discussed at a future t-opsem meeting
Metadata
Metadata
Assignees
Labels
A-validityTopic: Related to validity invariantsTopic: Related to validity invariantsS-pending-designStatus: Resolving this issue requires addressing some open design questionsStatus: Resolving this issue requires addressing some open design questionsmeeting-proposedProposed to be discussed at a future t-opsem meetingProposed to be discussed at a future t-opsem meeting
Type
Fields
Give feedbackNo fields configured for issues without a type.
The discussions at #76 and #77 are about the validity invariant that all references have to maintain in general; this issue here is specifically about the validity invariant of the metadata component of any fat pointer -- which do not have to be references!
Rc<[u8]>is also a fat pointer. The expected metadata depends on the type of the "unsized tail".For slices, it seems clear that the invariant will be the same as that for
usize. But fordyn Traitpointers, what should we require about the vtable? My guess would have been at least as much as an&[usize; 3](a vtable has at least 3 slots: size, alignment and drop function, not necessarily in that order). But in this forum thread, the valid question came up whyWeak::newdoes not work fordyn Trait, and indeed it could if we could "fake" the fat pointer component (though doing that generically seems hard).And then there is the question how this interacts with eventual custom/user-defined DSTs.