Stream: t-compiler/help

Topic: parsing to ParamKindOrd

Camelid (Jun 01 2020 at 01:49, on Zulip):

How do you parse a string to a ParamKindOrd? E.g.: "lifetime" to ParamKindOrd::Lifetime

Camelid (Jun 01 2020 at 01:54, on Zulip):

Specific situation: I'm working on librustc_typeck/ and specifically on the generic_arg_mismatch_err function, and I need to sort by ParamKindOrd, but one of the inputs to the function is just a &static str

Camelid (Jun 01 2020 at 18:04, on Zulip):

It seems like the solution is just a pattern-match on the string

lcnr (Jun 01 2020 at 18:07, on Zulip):

Depending on the exact circumstances, it might also be possible to change it to pass a ParamKindOrd/GenericArg and convert it to a
string in the method itself

Camelid (Jun 01 2020 at 18:38, on Zulip):

I would prefer that, but it would require a lot of changes

Last update: Sep 28 2020 at 15:45UTC