Stream: t-compiler

Topic: ..= lint suggestion (#51043)


Zack M. Davis (Nov 08 2018 at 15:52, on Zulip):

@varkor I'm fine with having it taken it off my hands, but I think it might be slightly less trivial than changing the suggestion applicability, although we _might_ be able to get away with it being that simple given that cargo fix will invoke rustc multiple times

varkor (Nov 08 2018 at 15:53, on Zulip):

because it needs to apply two suggestions, rather than just one?

Zack M. Davis (Nov 08 2018 at 15:54, on Zulip):

yes, where our known bug was that applying the lint suggestion resulted in a different error (which _was_ blocked on pattern_parentheses, but now may itself be cargo fix-able); if this "recursive" fix isn't good enough (either because I've misremembered how cargo fix works, or it's slow or something), we would want to lint suggestion to directly include the parentheses itself when applicable

Zack M. Davis (Nov 08 2018 at 15:54, on Zulip):

which is probably easy

Zack M. Davis (Nov 08 2018 at 15:55, on Zulip):

but like, order of 1 hour easy (rather than 2 minutes easy for s/MachineApplicable/MaybeIncorrect)

varkor (Nov 08 2018 at 15:56, on Zulip):

okay, I'll look into that :+1:

varkor (Nov 08 2018 at 15:56, on Zulip):

thanks for the extra context!

Zack M. Davis (Nov 08 2018 at 15:57, on Zulip):

thanks (do you work on rustc full-time? I regret that my dayjob and other interests limit my availability)

varkor (Nov 08 2018 at 15:59, on Zulip):

if only :grinning_face_with_smiling_eyes:

varkor (Nov 08 2018 at 15:59, on Zulip):

no, I just have some spare time this evening, so I thought I should be able to address this one quite quickly

Zack M. Davis (Nov 08 2018 at 16:02, on Zulip):

looks like the recursive fix won't work (unless we reverse our earlier judgement call on the applicability of the ambiguous-range-interpretation error suggestion): https://github.com/rust-lang/rust/blob/653da4fd006c97625247acd7e076d0782cdc149b/src/libsyntax/parse/parser.rs#L4303-L4304

varkor (Nov 08 2018 at 16:08, on Zulip):

it's probably simplest to specifically check for the pattern &a..=b and special-case it

varkor (Nov 08 2018 at 23:52, on Zulip):

it turns out to be a little more troublesome, because the recursive check_pat means if we check for PatKind::Ref, we end up throwing two errors

Last update: Nov 22 2019 at 05:15UTC