Skip to content

Commit

Permalink
Update dynsized_constraints.md
Browse files Browse the repository at this point in the history
  • Loading branch information
CAD97 authored Jun 22, 2022
1 parent 5b2caa2 commit 17311ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/design_notes/dynsized_constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ Examples of these are respectively `u8`, `dyn Trait`, `ThinCStr`, and `extern ty
`Ref<T>`-like types want "`?Sized + ?MetaSized + ?DynSized`", and
`UnsafeCell<T>`-like types want "`?Sized + MetaSized + DynSized`".

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

## References

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

0 comments on commit 17311ed

Please sign in to comment.