0

Tracking Issue for relaxed struct unsizing rules · Issue #81793 · rust-lang/rust...

 2 years ago
source link: https://github.com/rust-lang/rust/issues/81793
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Copy link

Contributor

lcnr commented on Feb 5

The feature gate for the issue is #![feature(relaxed_struct_unsize)].

This features changes the when a struct implements Unsize which
is required for unsize coercion.

A generic struct previously implemented Unsize if and only if:

  • the tail field depends on at least one type or const parameter
  • all type and const parameters used in the last field must only be used in the last field
  • the target struct can be created from the source by replacing only the parameters found in the last struct field
  • the tail field implements Unsize from source to target

With this feature gate the requirements are changed to:

  • the tail field depends on at least one type or const parameter not used in any other field
  • the target struct can be created from the source by replacing only the parameters only found in the last struct field
  • the tail field implements Unsize from source to target

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Steps

Implementation history

This feature has been implemented in #80726


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK