about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2019-03-27 14:43:29 +0100
committerFelix S. Klock II <pnkfelix@pnkfx.org>2019-03-27 14:43:29 +0100
commit6046f4a673abc39cec5405f51a17e614d5839f26 (patch)
tree3a3c6dd596a0de01ff949388ab625c79586aa1c6 /src/test/incremental/thinlto
parent267fb90b55736dc2362e8621a247f54da5fd8d40 (diff)
downloadrust-6046f4a673abc39cec5405f51a17e614d5839f26.tar.gz
rust-6046f4a673abc39cec5405f51a17e614d5839f26.zip
Do not lint `dyn` tokens under macros.
The existing `KeywordIdents` lint blindly scans the token stream for a
macro or macro definition. It does not attempt to parse the input,
which means it cannot distinguish between occurrences of `dyn` that
are truly instances of it as an identifier (e.g. `let dyn = 3;`)
versus occurrences that follow its usage as a contextual keyword (e.g.
the type `Box<dyn Trait>`).

In an ideal world the lint would parse the token stream in order to
distinguish such occurrences; but in general we cannot do this,
because a macro_rules definition does not specify what parsing
contexts the macro being defined is allowed to be used within.

So rather than put a lot of work into attempting to come up with a
more precise but still incomplete solution, I am just taking the short
cut of not linting any instance of `dyn` under a macro. This prevents
`rustfix` from injecting bugs into legal 2015 edition code.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions