Tracking Issue for relaxed struct unsizing rules #81793
Closed
Description
opened on Feb 5, 2021
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
- Adjust documentation (see instructions on rustc-dev-guide)
- Stabilization PR (see instructions on rustc-dev-guide)
Implementation history
This feature has been implemented in #80726
Metadata
Assignees
Labels
Area: Dynamically-sized types (DSTs)Category: An issue tracking the progress of sth. like the implementation of an RFC`#![feature(relaxed_struct_unsize)]`Relevant to the language team, which will review and decide on the PR/issue.This issue / PR is in PFCP or FCP with a disposition to merge it.The final comment period is finished for this PR / Issue.
Activity