-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
cargo check fails only in incremental mode #58291
Comments
Here are full steps to reproduce:
|
I continue to see this problem, so it is not a completely random thing. |
Yes, I've experienced this as well in rust-analyzer. It might be related to salsa using a procedural macro? Deleting the incremental folder also fixes the build, btw. |
Happens on beta (rustc 1.33.0-beta.6 (b203178 2019-02-05)) as well. |
Still happening on 1.33.0 |
Can reproduce on nightly too.
|
Is this a regression? Can we bisect it down to a specific PR using cargo-bisect-rustc, or at least a specific nightly? |
Did a little investigation, looks like two events are the most likely causes of this issue: salsa's upgrade to the proc-macro version: rust-lang/rust-analyzer@a2ca03d It's not super easy to bisect between the two, because salsa at the time of upgrade required 1.32 |
I spent a (quite a) while narrowing this down to a single crate test case with no dependencies. https://gist.github.com/pnkfelix/5a27ed7f789f90f3c6256aef39a73c82 I wasn't able to get it down to a single file; manually inlining each of the But its less than 300 lines of code and it is indeed enough to reproduce the problem on its own via calls to
Here's a sample run to demo how to use the files there:
|
(Oh! And of course the obvious next step is to figure out if my reduced test case show that this is a regression.) |
Holy cow, it is an injection (i.e. regression)! With some modifications to deal with the slightly older build, I was able to observe the same bug occurring on nightly-2018-04-28 (version info: "rustc 1.27.0-nightly (686d0ae 2018-04-27)"). It does not occur on nightly-2018-04-27 (version info: "rustc 1.27.0-nightly (7f3444e 2018-04-26)")
|
Here's another potentially interesting fact: some small modifications to the test input reveal differing behavior (in terms of whether the I.e. this may be a (very old) regression with respect to trait resolution that is independent of incremental compilation (but may be more easily exposed via incremental compilation.) And the regression in that latter case is exposed even when I inline the https://gist.github.com/8a153e8b9ca82eaf748684e38f33f6e5 I'm going to file this new test case as a separate bug (#60010), since I want to make sure that I treat the incremental compilation bug as a distinct problem, at least until we've seen more evidence that a fix for the pure trait-resolution bug would actually fix the incremental compilation problem. |
Unfortunately, that `: RefUnwindSafe` bound gives rustc a hard time, so let's remove it for know. See * #1283 * rust-lang/rust#60444 * rust-lang/rust#58291 closes #1283
This was resolved between rustc 1.36.0-nightly (a9ec99f 2019-05-13) and rustc 1.36.0-nightly (372be4f 2019-05-14). (The resolution is that neither variant of the code should have been accepted by the compiler; the fact that it was accepted was due to a bug in the way that we mixed inductive and co-inductive reasoning when resolving trait constraints.) The difference between the above two nightlies is these three bors commits:
based on my knowledge of this bug, its pretty certain that this was fixed by PR #60444, which was part of rollup #60834. Closing as fixed. |
I think I see a behavior where incremental compilation introduce a spurious compiler error.
The code is rust-lang/rust-analyzer@9798463.
I run
cargo check
andenv CARGO_INCREMENTAL=0 cargo check
incrates/ra_ide_api
directory.The first (incremental) fails with
[E0599]
The second (non-incremental) exists successfully.
The text was updated successfully, but these errors were encountered: