Stream: t-compiler/wg-rls-2.0

Topic: chalk dyn and impl Trait


Laurențiu Nicola (Oct 17 2019 at 16:48, on Zulip):

Hi! I made a sketch for integrating the dyn and impl Trait support and filed it as https://github.com/rust-analyzer/rust-analyzer/pull/2026. It compiles, but I've no idea if it's doing anything sane. Maybe someone can take a look or even continue with the implementation?

matklad (Oct 17 2019 at 16:49, on Zulip):

I guess adding a test could help with trying out the sketch!

Laurențiu Nicola (Oct 17 2019 at 16:51, on Zulip):

There's already some tests that fail (:

Florian Diebold (Oct 17 2019 at 17:28, on Zulip):

I've actually also already a branch, but it doesn't work yet because the Chalk support isn't quite working yet :)

Florian Diebold (Oct 17 2019 at 17:28, on Zulip):

I considered making a draft PR, but thought I'd leave it for now because it may still take some time...

Florian Diebold (Oct 17 2019 at 17:31, on Zulip):

i.e. I'm pretty sure that this won't work until there's some more work done in Chalk

Florian Diebold (Oct 17 2019 at 17:34, on Zulip):

my commit is here https://github.com/flodiebold/rust-analyzer/commit/293bf2c6b810346d6994d76a697e6913a25c8d6c, it's pretty similar :)

Laurențiu Nicola (Oct 17 2019 at 17:42, on Zulip):

oh, yeah, it's basically the same thing

Laurențiu Nicola (Oct 17 2019 at 17:44, on Zulip):

so do you also get the "cannot unify things with binders (other than types)" panic?

Florian Diebold (Oct 17 2019 at 17:44, on Zulip):

yes, that's the thing where I'm pretty sure it's a problem in Chalk

Laurențiu Nicola (Oct 17 2019 at 17:45, on Zulip):

ah, I assumed that passing 1 there was bogus

Florian Diebold (Oct 17 2019 at 17:45, on Zulip):

because Niko wrote in the corresponding topic in the traits wg

a sample test (which fails) is on this branch -- it panics in unification because we need to write a routine for unifying QuantifiedWhereClauses

Florian Diebold (Oct 17 2019 at 17:47, on Zulip):

no, 1 should be always correct for the number of binders on dyn/impl as far as I understand it -- the one binder is the existential "self" parameter (e.g. dyn Trait is basically exists<T> where T: Trait)

Laurențiu Nicola (Oct 17 2019 at 17:47, on Zulip):

ah, okay

Laurențiu Nicola (Oct 17 2019 at 17:48, on Zulip):

I didn't see that wg-traits discussion, I wasn't subscribed :-D

nikomatsakis (Oct 21 2019 at 14:33, on Zulip):

so do you also get the "cannot unify things with binders (other than types)" panic?

I can confirm this is a bug in chalk

nikomatsakis (Oct 21 2019 at 14:33, on Zulip):

I was going to provide some feedback over in #wg-traits to help overcome it right now, in fact

Laurențiu Nicola (Nov 14 2019 at 17:52, on Zulip):

This might be fixed now, but there were some chalk API changes and updating didn't seem trivial

Florian Diebold (Nov 14 2019 at 18:22, on Zulip):

Yeah, I'm working on them

Florian Diebold (Nov 15 2019 at 20:26, on Zulip):

it's looking good :)

matklad (Nov 15 2019 at 20:27, on Zulip):

@Florian Diebold I've wished for better completions on various impl DB at least ten times today :D

Last update: Nov 19 2019 at 18:45UTC