Skip to content

Commit 17311ed

Browse files
authored
Update dynsized_constraints.md
1 parent 5b2caa2 commit 17311ed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/design_notes/dynsized_constraints.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ Examples of these are respectively `u8`, `dyn Trait`, `ThinCStr`, and `extern ty
129129
`Ref<T>`-like types want "`?Sized + ?MetaSized + ?DynSized`", and
130130
`UnsafeCell<T>`-like types want "`?Sized + MetaSized + DynSized`".
131131

132+
Additionally, it could be useful to restrict `MetaSized` to only know the pointee metadata and not the data pointer;
133+
this would allow things like `[T] where T: ?Sized + MetaSized` using both slice and `T` metadata for an extra-fat pointer
134+
(e.g. `[[T]]` for 2D slices doing the obvious thing (without stride)).
135+
132136
## References
133137

134138
- \[1] https://internals.rust-lang.org/t/erfc-minimal-custom-dsts-via-extern-type-dynsized/16591?u=cad97

0 commit comments

Comments
 (0)