-
Notifications
You must be signed in to change notification settings - Fork 13.3k
NLL: dropck_vec_cycle_checked.rs very slow to compile #49998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It seems the problem, at least in this case, is this line of code if cause < **old_cause { After some inspection with Anyway, from what I can tell this code is just trying to reduce the cause to something simpler, but maybe once we are looking at two instances of So some experiments to try:
|
Based on some rough
Another reasonable theory is that the reason that it speeds things up to always return false when comparing two |
A variation on outright skipping comparison when given two |
…ating of cause map. This seems to avoid poor scaling on src/test/ui/span/dropck_vec_cycle_checked.rs
…imal-causes` flag This commit only applies the flag to the one test case, ui/span/dropck_vec_cycle_checked.rs, that absolutely needs it. Without the flag, that test takes an unknown amount of time (greater than 1 minute) to compile. But its possible that other tests would also benefit from the flag, and we may want to make it the default (after evaluating its impact on other tests). In terms of its known impact on other tests, I have only evaluated the ui tests, and the *only* ui test I have found that the flag impacts (running under NLL mode, of course), is src/test/ui/nll/issue-31567.rs In particular: ``` % ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/nll/issue-31567.rs error[E0597]: `*v.0` does not live long enough --> ../src/test/ui/nll/issue-31567.rs:22:26 | 22 | let s_inner: &'a S = &*v.0; //~ ERROR `*v.0` does not live long enough | ^^^^^ borrowed value does not live long enough 23 | &s_inner.0 24 | } | - borrowed value only lives until here | note: borrowed value must be valid for the lifetime 'a as defined on the function body at 21:1... --> ../src/test/ui/nll/issue-31567.rs:21:1 | 21 | fn get_dangling<'a>(v: VecWrapper<'a>) -> &'a u32 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0597`. % ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/nll/issue-31567.rs -Z nll-subminimal-causes error[E0597]: `*v.0` does not live long enough --> ../src/test/ui/nll/issue-31567.rs:22:26 | 22 | let s_inner: &'a S = &*v.0; //~ ERROR `*v.0` does not live long enough | ^^^^^ borrowed value does not live long enough 23 | &s_inner.0 24 | } | - | | | borrowed value only lives until here | borrow later used here, when `v` is dropped error: aborting due to previous error For more information about this error, try `rustc --explain E0597`. % ```
Please revisit the status of this issue, as the PartialOrd bug is fixed. |
Testing with nightly now, I see no difference at all between them. |
As noted on #49900 (comment) it appears that dropck_vec_cycle_checked.rs under
-Znll
requires more than an hour to compile (not yet clear how much time is actually required.)Here is a reduced version of that test case that exhibits a 50x slowdown under
-Znll
. (Namely, it takes 0.163s to compile without-Znll
, and takes 8.424s to compile with-Znll
The text was updated successfully, but these errors were encountered: