rust/src/test
bors 0d1754e8bf Auto merge of #90583 - willcrichton:example-analyzer, r=jyn514
Fix ICE when rustdoc is scraping examples inside of a proc macro

This PR provides a clearer semantics for how --scrape-examples interacts with macros. If an expression's span AND it's enclosing item's span both are not `from_expansion`, then the example will be scraped. The added test case `rustdoc-scrape-examples-macros` shows a variety of situations.

* A macro-rules macro that takes a function call as input: good
* A macro-rules macro that generates a function call as output: bad
* A proc-macro that generates a function call as output: bad
* An attribute macro that generates a function call as output: bad
* An attribute macro that takes a function call as input: good, if the proc macro is designed to propagate the input spans

I ran this updated rustdoc on pyo3 and confirmed that it successfully scrapes examples from inside a proc macro, eg

<img width="1013" alt="Screen Shot 2021-11-04 at 1 11 28 PM" src="https://user-images.githubusercontent.com/663326/140412691-81a3bb6b-a448-4a1b-a293-f7a795553634.png">

(cc `@mejrs)`

Additionally, this PR fixes an ordering bug in the highlighting logic.

Fixes https://github.com/rust-lang/rust/issues/90567.

r? `@jyn514`
2021-11-05 19:05:36 +00:00
..
assembly Update the minimum external LLVM to 12 2021-10-22 10:50:07 -07:00
auxiliary
codegen Auto merge of #89652 - rcvalle:rust-cfi, r=nagisa 2021-10-27 09:19:42 +00:00
codegen-units Collect panic/panic_bounds_check during monomorphization 2021-10-30 18:21:44 +01:00
debuginfo Fix function-names test for GDB 10.1 2021-10-11 17:20:45 +02:00
incremental Rollup merge of #89895 - camsteffen:for-loop-head-span, r=davidtwco 2021-10-22 19:42:45 +09:00
mir-opt Ignore wasm32 in test. 2021-10-17 16:35:04 +02:00
pretty Use ZST for fmt unsafety 2021-09-21 10:04:44 -05:00
run-make Move rustdoc-scrape-examples-macros test to run-make-fulldeps 2021-11-04 18:52:59 -07:00
run-make-fulldeps Fix rustdoc-scrape-examples-macros test not being cross-platform 2021-11-05 09:32:04 -07:00
run-pass-valgrind
rustdoc Split doc_cfg and doc_auto_cfg features 2021-11-02 16:55:50 +01:00
rustdoc-gui Fix missing bottom border for headings in sidebar 2021-11-04 20:07:24 +01:00
rustdoc-js Fix invalid handling of generics 2021-10-29 20:54:15 +02:00
rustdoc-js-std Fix linkcheck issues 2021-09-12 02:30:24 +00:00
rustdoc-json Add regression test for #89852 2021-10-14 02:12:18 +02:00
rustdoc-ui Rollup merge of #90183 - GuillaumeGomez:recurse-deref, r=jyn514 2021-10-30 20:30:26 +02:00
ui Rollup merge of #90554 - ehuss:unstable-options-cleanup, r=joshtriplett 2021-11-05 10:32:45 +09:00
ui-fulldeps Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
COMPILER_TESTS.md