rust/src/test
bors ba6275b6a9 Auto merge of #82608 - Aaron1011:feature/final-preexp-tts, r=petrochenkov
Implement token-based handling of attributes during expansion

This PR modifies the macro expansion infrastructure to handle attributes
in a fully token-based manner. As a result:

* Derives macros no longer lose spans when their input is modified
  by eager cfg-expansion. This is accomplished by performing eager
  cfg-expansion on the token stream that we pass to the derive
  proc-macro
* Inner attributes now preserve spans in all cases, including when we
  have multiple inner attributes in a row.

This is accomplished through the following changes:

* New structs `AttrAnnotatedTokenStream` and `AttrAnnotatedTokenTree` are introduced.
  These are very similar to a normal `TokenTree`, but they also track
  the position of attributes and attribute targets within the stream.
  They are built when we collect tokens during parsing.
  An `AttrAnnotatedTokenStream` is converted to a regular `TokenStream` when
  we invoke a macro.
* Token capturing and `LazyTokenStream` are modified to work with
  `AttrAnnotatedTokenStream`. A new `ReplaceRange` type is introduced, which
  is created during the parsing of a nested AST node to make the 'outer'
  AST node aware of the attributes and attribute target stored deeper in the token stream.
* When we need to perform eager cfg-expansion (either due to `#[derive]` or `#[cfg_eval]`), we tokenize and reparse our target, capturing additional information about the locations of `#[cfg]` and `#[cfg_attr]` attributes at any depth within the target. This is a performance optimization, allowing us to perform less work in the typical case where captured tokens never have eager cfg-expansion run.
2021-04-11 07:36:33 +00:00
..
assembly Auto merge of #83592 - nagisa:nagisa/dso_local, r=davidtwco 2021-04-06 02:09:01 +00:00
auxiliary
codegen Auto merge of #81234 - repnop:fn-alignment, r=lcnr 2021-04-06 04:35:26 +00:00
codegen-units Remove redundant ignore-tidy-linelength annotations 2021-04-03 22:30:20 +02:00
debuginfo Fix closed over variables not available in debuginfo for Windows MSVC 2021-04-08 14:08:56 -04:00
incremental Remove attribute #[link_args] 2021-04-03 21:25:53 +03:00
mir-opt Rollup merge of #83807 - sjakobi:77548-remove-ignore-annotations, r=Mark-Simulacrum 2021-04-05 00:24:31 +02:00
pretty
run-make rustc: Add a new wasm ABI 2021-04-08 08:03:18 -07:00
run-make-fulldeps Update Source Serif to release 4.004 2021-04-05 10:48:08 +02:00
run-pass-valgrind
rustdoc Rollup merge of #83849 - jyn514:intra-doc-cleanup, r=bugadani 2021-04-06 06:24:15 +09:00
rustdoc-gui Add test to ensure search tabs behaviour 2021-04-01 21:55:20 +02:00
rustdoc-js
rustdoc-js-std
rustdoc-json
rustdoc-ui Auto merge of #84030 - jyn514:no-blanket-impls, r=GuillaumeGomez 2021-04-09 13:52:56 +00:00
rustfix
ui Auto merge of #82608 - Aaron1011:feature/final-preexp-tts, r=petrochenkov 2021-04-11 07:36:33 +00:00
ui-fulldeps Fix fulldeps tests. 2021-03-30 23:51:15 +02:00
COMPILER_TESTS.md