Stream: t-compiler/wg-rls-2.0/chalk

Topic: chalk building on stable chalk#207


nikomatsakis (Mar 13 2019 at 17:35, on Zulip):

Hi @Florian Diebold, I left a review of your PR, but I figured maybe we could discuss here (I find it easier to track comments on Zulip than GH).

The only big concern obviously was the matter of the Debug impl (also cc @scalexm, I'd be curious to get your opinion)

scalexm (Mar 13 2019 at 18:35, on Zulip):

@nikomatsakis well, yeah that's annoying; another option would be to:

nikomatsakis (Mar 13 2019 at 18:36, on Zulip):

Ah, that's...maybe a good idea, yeah.

scalexm (Mar 13 2019 at 18:37, on Zulip):

or maybe a bit simpler, have a non-parametric impl for Zip and Fold, so they would be implemented only for some concrete ParameterKind<...> types

scalexm (Mar 13 2019 at 18:37, on Zulip):

(and leave Debug as a super trait)

scalexm (Mar 13 2019 at 18:38, on Zulip):

that would probably work too

scalexm (Mar 13 2019 at 18:50, on Zulip):

mmh no actually that wouldn't work so easily because of ParameterKind<EnaVariable> being used in another crate and still needing a Debug impl (EnaVariable being local to that crate)

scalexm (Mar 13 2019 at 18:51, on Zulip):

well anyway, I'd be ok for using a new-type around ParameterKind<Ty, Lifetime>

Florian Diebold (Mar 13 2019 at 18:54, on Zulip):

Another (probably bad) idea: add a third type parameter to ParameterKind that just controls what the Debug implementation does

scalexm (Mar 13 2019 at 19:36, on Zulip):

@Florian Diebold yeah that may be nicer indeed

scalexm (Mar 13 2019 at 19:37, on Zulip):

I guess we'd have to try implementing that solution to see if it fits well

Florian Diebold (Mar 13 2019 at 19:47, on Zulip):

I'll try it out

Florian Diebold (Mar 13 2019 at 20:06, on Zulip):

hrm no, it'd require adding a PhantomData to the enum to use the type parameter, and that's a huge disruption :/

Florian Diebold (Mar 13 2019 at 20:17, on Zulip):

The newtype doesn't seem so bad (so far)

Florian Diebold (Mar 13 2019 at 20:36, on Zulip):

Pushed the newtype variant to the PR.

@nikomatsakis I don't think implementing iterate_range as an extension trait would work, because of the impl trait?

nikomatsakis (Mar 13 2019 at 20:58, on Zulip):

nikomatsakis I don't think implementing iterate_range as an extension trait would work, because of the impl trait?

oh, maybe not, yeah, no big deal

Last update: Nov 15 2019 at 10:15UTC