-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Soundness regression with for<'lt> closure having an implied bound from return type #114936
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-highHigh priorityHigh priorityT-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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-highHigh priorityHigh priorityT-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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Completed
Bug originally found by @ast-ral, over Discord, which I've then reduced.
Code
I tried this code:
I expected to see this happen:
Instead, this happened: code compiles successfully
Version it soundly rejected this code:
1.64.0
Version with soundness regression
1.65.0 and onwards
Proof of unsoundness:
@rustbot modify labels: +I-unsound +regression-from-stable-to-stable -regression-untriaged
Observations
This does not occur if the implied-lifetime-bounds array is in closure parameter position; so it looks like a bug w.r.t. not properly checking the closure output type implied bounds?
-Ztrait-solver=nextdoes not help (as of2023-08-16)