[Polonius] Timeout while compiling handcrafted example #140454
Labels
C-bug
Category: This is a bug.
I-compiletime
Issue: Problems and improvements with respect to compile times.
NLL-polonius
Issues related for using Polonius in the borrow checker
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
(Lower priority: Trying to break compiler after reading polonius algorithm)
I tried this code.
N
Pointers pointing withN
loans. Cyclic swap content of pointers in a for loop. Following is an example forN = 3
.(generator script)
N = 10
: https://godbolt.org/z/6Garo4jh9 takes <1sN = 100
: https://godbolt.org/z/Gnrr6rqrr takes about 27s with-Zpolononius
, 14s with-Zpolonius=next
.N = 200
: https://godbolt.org/z/Gnrr6rqrr takes about 156s with-Zpolononius
, 131s with-Zpolonius=next
.N = 1000
takes >20 minNote that all the above examples compile in <1 s without
-Zpolonius
. Example: https://godbolt.org/z/GTMGdf1hrIIUC, the algorithm would converge when all the
N
region/origin variables would contain (require
) all theN
loans!I feel the owners must be aware about this already. The fixed point iteration looks
O(R * L)
whereR
is the number of region variables andL
is the number of loans/borrow expressions.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: