-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
lifetime order breaks member constraints #104639
Copy link
Copy link
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerC-bugCategory: This is a bug.Category: This is a bug.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerC-bugCategory: This is a bug.Category: This is a bug.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The following code should pass regardless of the declaration order of lifetimes: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=88e227f9f7a5b516bffe21e09b18cd5e
This is related to #63033 but it's different in that we do have a lower bound region,
'c, but we fail to recognize that because the algorithm here, which is responsible for calculatingmin_choicefromchoice_regions = ['static, 'a, 'b, 'c], assumes that the outlive relation is a total order, which is not true.Here is the graph of
self.universal_region_relations:So we need an efficient algorithm that works for partial order relations, but the one that comes to mind is
O(n^2). The perf may not be really important here but I'm curious to see the alternatives.@rustbot label C-bug T-compiler A-borrow-checker E-mentor E-help-wanted