-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
stop adding dropck outlives requirements for [T; 0] #110288
Copy link
Copy link
Labels
T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Metadata
Metadata
Assignees
Labels
T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
[T; 0]currently doesn't need drop glue by itself but still adds liveness requirements forTwhen used in a more complex value which already needs drop.This behavior is identitical to
PhantomData, which also does not need drop glue by itself but adds liveness requirements when used in values who do. I do not propose to change anything aboutPhantomDatawith this issue.Example
playground
This behavior is confusing. I propose that we don't add any dropck outlives requirements for arrays of length zero. This allows strictly more code to compile, it may however result in unsoundness if people rely on this behavior to guarantee errors.