-
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
yet another associated type ICE (probably more missing normalize calls) #65934
Comments
triage: P-high, removing nomination label |
I'm running into an issue which might be related to this, but I can't really tell if it is the same issue or not. Perhaps someone would be willing to help me determine if it is? I'm experiencing ICEs across stable, beta and nightly. The issue is also not entirely reproducible: on some computers, the issue is not triggered for the same code base, however when continuing to develop it will inevitably appear. Similarly, at present, I've just confirmed that compiling in release mode seems to have worked, whereas debug mode did not. I don't see any obvious patterns in what determines which configurations trigger the bug. I don't see right now how I can reduce my code down to a minimal example, but since I'm working against an academic deadline and my code does not reliably compile right now, I'm in a bit of a pickle, and would really appreciate any pointers that could help me either properly report the bug or to resolve the issue. |
@Andlon Can you provide the code? |
@WildCryptoFox: Not publicly, at this point, unfortunately, as it contains algorithms that we need to keep a little under wraps for some time (at least until it's been accepted for publication). But it's intended to be open sourced later on, so I think it won't be a problem to provide the code to select individuals, if that could work for you? |
@WildCryptoFox: I don't think I have a function like that in the code that the compiler actually complains about, but there's a whole lot of generic and associated types used in various ways in general. Actually, I looked at the code again and tried to reduce it a little, and it seems as if the problem is independent of the function signature, but instead has something to do with the interaction between |
@Andlon It might hit the same problem via a different route. Good luck with reducing. I've pinged you in a private gist. I could take a look at the code; though I'm a bit busy right now so no guarantee for when. |
By the way I wrote a recent blog post on generic techniques for reducing compiler bugs in Rust. It might give you ideas. http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/ |
@WildCryptoFox: thanks, appreciate it! @pnkfelix: I skimmed your blog post, and there's some really good advice in there. I'll try to follow your approach and see where it takes me. I observed something strange, btw. I have a workspace consisting of multiple crates, the relevant two are
The following two commands, run independently, do not give me an ICE:
Not sure what to make of that. I'll report back once I (hopefully) manage to reduce stuff down to something more minimal, as per @pnkfelix's suggestions. |
As I started out trying to reduce the code, I realized the following: The ICE occurs for |
You may be able to use |
@lqd: thanks for the tip, that sounds like an excellent idea! So far I've spent hours gradually reducing the test case in the spirit of @pnkfelix's suggestions. That is, I copied the whole git repository, and removed piece by piece while making commits after verifying that the code still exhibits the ICEs when running I have no idea what's going on, and how to go further in debugging this. I would really appreciate some advice for how to proceed. In my mind (knowing nothing about compiler/cargo internals), it seems as if the ICEs are perhaps only triggered under certain conditions related to the state of (cached) dependencies? |
@Andlon Removing the registry or |
@WildCryptoFox: At least Unfortunately, I don't think I'm out of the waters yet - in fact, I expect it to come back, as I had the same issue a few days ago. Then I upgraded from 1.38 to 1.39, and I thought at first that this fixed my problems, but they reappeared later in the day. So unfortunately I expect it to come back again. |
So, here are some good news: I've successfully managed to create a testcase of less than 200 lines (plus a dependency on To illustrate the latter, removing unused dependencies might cause it to go away. At one point, I could not remove a dependency, but by adding the dependencies of this dependency and removing them one-by-one, I could somehow manage to completely remove the original dependency while still being able to reproduce the ICE. I would perhaps guess that doing it this way ends up giving a slightly different After my previous comment, I double checked, and I was accidentally ignoring Even though the code is in a single code file I think at this point, I am not able to get much further in reducing the test case, and so I would be happy if someone with more experience and knowledge about the compiler could pick up the trail. Please let me know if I can be of any assistance, however! For completeness, here's the output of
|
@Andlon Testing with both Try updating your Edit: I tested with
I can confirm the ICE of this issue remains in play. I think you should open a new issue. |
@Andlon Curiously when adding To add to the ICE reducing tips: remove everything the |
@WildCryptoFox: that's great, thanks! As you suggested, I've opened a new issue here: #66768. |
@pnkfelix I just noticed the test you included is the partially reduced variant, not the most reduced variant. Per @eddyb 's post in the previous issue. This smaller variant actually triggers two MIR errors - one more than the variant above. trait Trait {
type Assoc;
}
impl Trait for () {
type Assoc = ();
}
fn unit() -> impl Into<<() as Trait>::Assoc> {}
pub fn ice() {
Into::into(unit());
} |
It looks like this is cauesd by the un-normalized projection I've not entirely certain where the normalization should be taking place. Should |
AFAIK no, |
(Still triggers ICE on latest nightly) |
Triage: This is no longer ICE with the latest nightly, marking as E-needs-test. |
(spawned off of #63154)
This variant of the code from #63154 still causes an ICE on nightly rustc (play):
yields:
The text was updated successfully, but these errors were encountered: