]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #49614 - zackmdavis:the_phantom_menace, r=petrochenkov
authorkennytm <kennytm@gmail.com>
Wed, 11 Apr 2018 11:56:43 +0000 (19:56 +0800)
committerGitHub <noreply@github.com>
Wed, 11 Apr 2018 11:56:43 +0000 (19:56 +0800)
in which the non-shorthand patterns lint keeps its own counsel in macros

In issue #49588, Michael Lamparski pointed out a scenario in which the
non-shorthand-field-patterns lint could be triggered by a macro-expanded
pattern, in a way which was direly unwieldy for the macro author to guard
against and unreasonable to expect the macro user to take into account. We can
avoid this by not linting patterns that come from macro-expansions. Although
this entails accepting "false negatives" where the lint could genuinely improve
macro-templated code, avoiding the reported "true-but-super-annoying positive"
may be worth the trade? (Some precedent for these relative priorities exists as
no. 47775 (5985b0b0).)

Resolves #49588.


Trivial merge