Stream: t-compiler/rust-analyzer

Topic: Analysis stats panic


Daniel Mcnab (Apr 07 2021 at 19:57, on Zulip):

Is it expected that cargo run -p rust-analyzer --release -- analysis-stats . --with-deps --parallel panics at https://github.com/rust-analyzer/rust-analyzer/blob/3191a93185b34c6deebca2aad0584d2840ad6d43/crates/hir_ty/src/traits/chalk/mapping.rs#L192 once whilst still pinnning the CPU?

detrumi (Apr 07 2021 at 20:00, on Zulip):

It's not supposed to hit that panic

Daniel Mcnab (Apr 07 2021 at 20:01, on Zulip):

Ah. Well it apparently can :)

detrumi (Apr 07 2021 at 20:02, on Zulip):

Looks like that code was recently added when adding GenericArg

detrumi (Apr 07 2021 at 20:03, on Zulip):

But yeah, Chalk sometimes returns lifetimes, and rust-analyzer should have some way to handle that instead of panicking

Florian Diebold (Apr 07 2021 at 21:01, on Zulip):

I think Jonas mentioned that already in another topic

Florian Diebold (Apr 07 2021 at 21:02, on Zulip):

@detrumi I am actually confused where Chalk would return a lifetime in a substitution without us telling it that it's expected

Florian Diebold (Apr 07 2021 at 21:02, on Zulip):

the mapping code will go away very soon anyway though

Florian Diebold (Apr 07 2021 at 21:24, on Zulip):

o_O it seems like we're actually requesting a goal with a lifetime variable... where does that come from

Florian Diebold (Apr 07 2021 at 21:28, on Zulip):

probably from another solution we got from Chalk...

Florian Diebold (Apr 07 2021 at 21:28, on Zulip):

oh yeah, probably autoderef

Andrew Chin (eminence) (Apr 07 2021 at 21:59, on Zulip):

i was in a bisecting mood -- this panic seems to have been introduced in 590c41635952e19c3caae525a827499dbd360049 https://github.com/rust-analyzer/rust-analyzer/pull/8136

detrumi (Apr 08 2021 at 08:09, on Zulip):

Interesting, I was assuming it started when the unimplemented! line was added, but according to your bisect it was in before that?

detrumi (Apr 08 2021 at 08:10, on Zulip):

That PR changed Dyn types, so maybe that's the source of the lifetime?

Florian Diebold (Apr 08 2021 at 10:37, on Zulip):

are you sure that's not another crash? I think I fixed one introduced by that PR

Florian Diebold (Apr 08 2021 at 10:38, on Zulip):

I'm pretty sure I know what's going on with this one, but I think it will probably be fixed or need a different fix with the Chalk move, so I'm leaving it

Andrew Chin (eminence) (Apr 08 2021 at 12:33, on Zulip):

yeah, it's 100% possible that my bisect found an unrelated crash

Florian Diebold (Apr 08 2021 at 12:41, on Zulip):

it crashes differently with the Chalk move now :grimacing:

Andrew Chin (eminence) (Apr 08 2021 at 13:00, on Zulip):

progress, perhaps :)

Florian Diebold (Apr 09 2021 at 09:18, on Zulip):

rust-analyzer/rust-analyzer#8440 fixes it

Last update: Jul 27 2021 at 22:30UTC