I’m hitting this assertion with left=1 and right=2 (in a moderately complex codebase, of course, that is not yet public). Any ideas on how to proceed?
The first thing to do would be to summon @Florian Diebold :P
rust-analyzer analysis-stats . (batch analysis) to check if it reproduces the problem reliably
if it does, the next thing to do would be to minize the test case
ah, so how do I run rust-analyzer again? (now on Linux … )
yeah, that. if analysis-stats crashes, you should be able to see the last function it was analyzing, and then you can run it with
-o that_function to only analyze one function, which should be much faster and still crash
you should be able to run it from wherever VSCode downloaded it (someone who knows about VSCode can probably tell us the path)
hmm, looking …
Don't we rename it to
there is no
~/.config/Code … I’m running this via Code server remote
you could also just download the binary from github and put it anywhere though
(downloaded the binary because I couldn’t find it on that host)
Database loaded, 251 roots, 376.796722ms Crates in this dir: 1 Total modules found: 33 Total declarations: 478 Total functions: 319 Item Collection: 14.546484276s, 0b allocated 0b resident 50/319 15% processing: util::flow::distinctthread 'main' panicked at 'assertion failed: `(left == right)` left: `1`, right: `2`', crates/ra_hir_ty/src/lib.rs:524:9
so I guess that points me to the
distinct method I happen to have on my
Flow in the
flow module, right?
-o util::flow::distinct should also crash
the thing is I have multiple
distinct methods on different types in that module
hmm yeah that's not ideal, you could try giving them unique names? unless it changes the name resolution inside the function it should probably still reproduce the crash
yes, that crashes as well; I have several errors (am in the middle of a refactoring), will see if fixing the errors removes this crash
@Florian Diebold So I have a trait
Flow<'a, T> and I added another type parameter to it. Several methods needed updated type signatures, and after I’d done those the crash went away.
now I still have many errors related to this change in other modules, but those don’t crash the analyzer
hm yeah it's probably not as straightforward as having a trait and using it with the wrong number of type parameters
not sure whether you are being ironic
of course I need to fix my type errors, but the analyzer crashing makes that experience quite a bit more annoying; the primary reason to use rust-analyzer is that it so awesomely supports refactorings
I'm not being ironic, I'm pretty sure this has to be a bit more complicated
yeah, this is a bug we need to fix, doesn't matter whether there are type errors or not
or, maybe not complicated, but some edge case...
Ah, yes, makes sense (I don’t know you well enough yet, so had to ask). I’m making such changes often and this was the first one to crash; perhaps the lifetime parameter plays into it.
I’ll try to minimize later, now I need to finish that one feature (as always)