rust/src/test/rustdoc-ui
Matthias Krüger 1f90f4fb85
Rollup merge of #93721 - jyn514:less-macro-special-casing, r=petrochenkov
rustdoc: Special-case macro lookups less

Previously, rustdoc had 3 fallbacks it used:
1. `resolve_macro_path`
2. `all_macros`
3. `resolve_str_path_error`

Ideally, it would only use `resolve_str_path_error`, to be consistent with other namespaces.
Unfortunately, that doesn't consider macros that aren't defined at module scope;
consider for instance
```rust
{
    struct S;

    macro_rules! mac { () => {} }
    // `mac`'s scope starts here

    /// `mac` <- `resolve_str_path_error` won't see this
   struct Z;

    //`mac`'s scope ends here
}
```

This changes it to only use `all_macros` and `resolve_str_path_error`, and gives
`resolve_str_path_error` precedence over `all_macros` in case there are two macros with the same
name in the same module.

This is a smaller version of https://github.com/rust-lang/rust/pull/91427.

r? `@petrochenkov`
2022-02-08 06:47:37 +01:00
..
auxiliary Use try_normalize_erasing_regions instead of a custom infer context 2021-12-01 19:22:24 +00:00
coverage Create rustdoc_internals feature gate 2021-11-24 21:57:18 +01:00
error-in-impl-trait Make all tests use type_alias_impl_trait feature instead of min 2021-07-27 12:33:02 -03:00
intra-doc rustdoc: Special-case macro lookups less 2022-02-06 19:29:31 -06:00
suggestions Use multipart suggestion for code wrapping 2022-02-01 23:27:07 -07:00
ambiguous-inherent-assoc-ty.rs Remove FIXME since there is nothing to be fixed. 2021-10-16 22:15:06 +02:00
ambiguous-inherent-assoc-ty.stderr rustdoc: Don't panic on ambiguous inherent associated types 2021-09-01 15:04:50 -07:00
assoc-item-not-in-scope.rs Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
assoc-item-not-in-scope.stderr Update rustdoc-ui tests for intra-doc links errors 2021-07-29 17:36:11 +02:00
bare-urls.fixed Run rustfix for bare-urls test 2021-04-10 18:39:05 -07:00
bare-urls.rs Run rustfix for bare-urls test 2021-04-10 18:39:05 -07:00
bare-urls.stderr Add explanatory note to bare_urls lint 2021-04-12 20:25:20 -07:00
block-doc-comment.rs Add test for block doc comments horizontal trim 2022-02-07 17:07:53 +01:00
block-doc-comment.stdout Add test for block doc comments horizontal trim 2022-02-07 17:07:53 +01:00
bounded-hr-lifetime.rs rustdoc: Higher-ranked lifetimes can't have bounds 2021-09-02 14:28:10 -07:00
bounded-hr-lifetime.stderr rustdoc: Higher-ranked lifetimes can't have bounds 2021-09-02 14:28:10 -07:00
cfg-test.rs libtest: Print the total time taken to execute a test suite 2020-11-27 17:53:59 +01:00
cfg-test.stdout remove mode for run and ignore tests 2021-05-16 22:33:41 +02:00
check-attr-test.rs remove allow_fail test flag 2022-01-28 18:31:49 +08:00
check-attr-test.stderr remove allow_fail test flag 2022-01-28 18:31:49 +08:00
check-attr.rs remove allow_fail test flag 2022-01-28 18:31:49 +08:00
check-attr.stderr remove allow_fail test flag 2022-01-28 18:31:49 +08:00
check-doc-alias-attr-location.rs Update tests for extern block linting 2021-01-13 07:49:16 -05:00
check-doc-alias-attr-location.stderr Clean up rustdoc tests by removing unnecessary features 2020-11-25 14:27:51 +01:00
check-doc-alias-attr.rs Update doc alias ui tests 2021-03-11 22:33:40 +01:00
check-doc-alias-attr.stderr Update char::escape_debug_ext to handle different escapes in strings vs. chars 2021-03-26 11:23:51 +03:00
check-fail.rs Rename rustdoc to rustdoc::all 2021-03-05 15:26:55 -05:00
check-fail.stderr Rename rustdoc to rustdoc::all 2021-03-05 15:26:55 -05:00
check.rs rustdoc: link to stable/beta docs consistently in documentation 2021-06-04 14:18:21 -04:00
check.stderr rustdoc: link to stable/beta docs consistently in documentation 2021-06-04 14:18:21 -04:00
commandline-argfile-badutf8.args rustdoc: Support argument files 2021-02-19 02:32:45 +01:00
commandline-argfile-badutf8.rs rustdoc: Support argument files 2021-02-19 02:32:45 +01:00
commandline-argfile-badutf8.stderr rustdoc: Support argument files 2021-02-19 02:32:45 +01:00
commandline-argfile-missing.rs Remove redundant ignore-tidy-linelength annotations 2021-04-03 22:30:20 +02:00
commandline-argfile-missing.stderr rustdoc: Support argument files 2021-02-19 02:32:45 +01:00
commandline-argfile.args rustdoc: Support argument files 2021-02-19 02:32:45 +01:00
commandline-argfile.rs rustdoc: Support argument files 2021-02-19 02:32:45 +01:00
deny-intra-link-resolution-failure.rs Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
deny-intra-link-resolution-failure.stderr Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
deny-missing-docs-crate.rs Removed more copyright notices. 2019-01-13 19:47:02 +00:00
deny-missing-docs-crate.stderr fix one more test 2020-03-22 17:18:30 -05:00
deny-missing-docs-macro.rs Removed more copyright notices. 2019-01-13 19:47:02 +00:00
deny-missing-docs-macro.stderr Update tests 2021-08-28 00:24:39 -07:00
deprecated-attrs.rs rustdoc: remove --passes and --no-defaults 2021-12-15 21:29:04 -07:00
deprecated-attrs.stderr rustdoc: remove --passes and --no-defaults 2021-12-15 21:29:04 -07:00
deref-generic.rs Balance sidebar Deref cycle check with main content 2021-01-30 14:23:50 +00:00
display-output.rs Do not warn in rustdoc test. 2021-12-05 10:15:44 +01:00
display-output.stdout Do not warn in rustdoc test. 2021-12-05 10:15:44 +01:00
doc-alias-assoc-const.rs Clean up rustdoc tests by removing unnecessary features 2020-11-25 14:27:51 +01:00
doc-alias-assoc-const.stderr Clean up rustdoc tests by removing unnecessary features 2020-11-25 14:27:51 +01:00
doc-alias-crate-level.rs Remove useless doc_alias feature 2021-01-05 16:20:46 +01:00
doc-alias-crate-level.stderr Add hyphen to "crate level" 2021-03-13 16:29:49 -08:00
doc-alias-same-name.rs Add tests for new doc alias check 2021-01-04 16:30:53 +01:00
doc-alias-same-name.stderr Add tests for new doc alias check 2021-01-04 16:30:53 +01:00
doc-attr.rs Tweak diagnostics 2021-03-14 14:00:02 -07:00
doc-attr.stderr Tweak diagnostics 2021-03-14 14:00:02 -07:00
doc-cfg.rs Simplify AttributesExt::cfg function and remove error emissions since they are not useful 2021-10-06 21:22:56 +02:00
doc-cfg.stderr Simplify AttributesExt::cfg function and remove error emissions since they are not useful 2021-10-06 21:22:56 +02:00
doc-include-suggestion.rs Remove doc(include) 2021-06-04 08:05:54 -04:00
doc-include-suggestion.stderr Remove doc(include) 2021-06-04 08:05:54 -04:00
doc-spotlight.fixed Fix deny(invalid_doc_attributes) 2021-06-04 15:20:26 -04:00
doc-spotlight.rs Fix deny(invalid_doc_attributes) 2021-06-04 15:20:26 -04:00
doc-spotlight.stderr Fix deny(invalid_doc_attributes) 2021-06-04 15:20:26 -04:00
doc-test-attr-pass.rs Move working checks into separate test files 2021-08-16 23:17:27 +02:00
doc-test-attr.rs Move working checks into separate test files 2021-08-16 23:17:27 +02:00
doc-test-attr.stderr Add UI tests for doc(test(...)) attribute checks 2021-08-16 23:17:27 +02:00
doc-test-doctest-feature.rs libtest: Print the total time taken to execute a test suite 2020-11-27 17:53:59 +01:00
doc-test-doctest-feature.stdout remove mode for run and ignore tests 2021-05-16 22:33:41 +02:00
doc-test-rustdoc-feature.rs libtest: Print the total time taken to execute a test suite 2020-11-27 17:53:59 +01:00
doc-test-rustdoc-feature.stdout remove mode for run and ignore tests 2021-05-16 22:33:41 +02:00
doc-without-codeblock.rs Add test to ensure that the missing_doc_code_examples is not triggered on foreign trait implementations 2021-10-20 16:52:56 +02:00
doc-without-codeblock.stderr Add test to ensure that the missing_doc_code_examples is not triggered on foreign trait implementations 2021-10-20 16:52:56 +02:00
doctest-edition.rs Use the correct edition when syntax highlighting doctests 2021-09-26 16:36:33 +00:00
doctest-edition.stderr Use the correct edition when syntax highlighting doctests 2021-09-26 16:36:33 +00:00
doctest-output.rs libtest: Print the total time taken to execute a test suite 2020-11-27 17:53:59 +01:00
doctest-output.stdout remove mode for run and ignore tests 2021-05-16 22:33:41 +02:00
failed-doctest-compile-fail.rs libtest: Print the total time taken to execute a test suite 2020-11-27 17:53:59 +01:00
failed-doctest-compile-fail.stdout change based on review 2021-05-03 20:17:15 +02:00
failed-doctest-extra-semicolon-on-item.rs rustdoc doctest: detect fn main after an unexpected semicolon 2021-11-18 16:23:18 -07:00
failed-doctest-extra-semicolon-on-item.stdout rustdoc doctest: detect fn main after an unexpected semicolon 2021-11-18 16:23:18 -07:00
failed-doctest-missing-codes.rs libtest: Print the total time taken to execute a test suite 2020-11-27 17:53:59 +01:00
failed-doctest-missing-codes.stdout change based on review 2021-05-03 20:17:15 +02:00
failed-doctest-output.rs libtest: Print the total time taken to execute a test suite 2020-11-27 17:53:59 +01:00
failed-doctest-output.stdout remove mode for run and ignore tests 2021-05-16 22:33:41 +02:00
failed-doctest-should-panic.rs libtest: Print the total time taken to execute a test suite 2020-11-27 17:53:59 +01:00
failed-doctest-should-panic.stdout remove mode for run and ignore tests 2021-05-16 22:33:41 +02:00
feature-gate-doc_cfg_hide.rs Add test case for doc_cfg_hide feature gate 2021-10-05 18:15:30 +02:00
feature-gate-doc_cfg_hide.stderr Add test case for doc_cfg_hide feature gate 2021-10-05 18:15:30 +02:00
generate-link-to-definition-opt-unstable.rs Ensure that --generate-link-to-definition is only used with HTML output and is unstable 2021-08-05 23:08:28 +02:00
generate-link-to-definition-opt-unstable.stderr Ensure that --generate-link-to-definition is only used with HTML output and is unstable 2021-08-05 23:08:28 +02:00
generate-link-to-definition-opt.rs Ensure that --generate-link-to-definition is only used with HTML output and is unstable 2021-08-05 23:08:28 +02:00
generate-link-to-definition-opt.stderr Ensure that --generate-link-to-definition is only used with HTML output and is unstable 2021-08-05 23:08:28 +02:00
generate-link-to-definition-opt2.rs Ensure that --generate-link-to-definition is only used with HTML output and is unstable 2021-08-05 23:08:28 +02:00
generate-link-to-definition-opt2.stderr Ensure that --generate-link-to-definition is only used with HTML output and is unstable 2021-08-05 23:08:28 +02:00
ignore-block-help.rs Add back missing help for ignore blocks 2021-05-17 21:31:03 -04:00
ignore-block-help.stderr Rename INVALID_RUST_CODEBLOCK{,S} 2021-05-17 21:31:04 -04:00
impl-fn-nesting.rs Catch errors for any new item, not just trait implementations 2020-07-15 10:54:06 -04:00
impl-fn-nesting.stderr Catch errors for any new item, not just trait implementations 2020-07-15 10:54:06 -04:00
infinite-recursive-type-impl-trait-return.rs Move from {{closure}}#0 syntax to {closure#0} for (def) path components 2020-09-25 22:46:14 +01:00
infinite-recursive-type-impl-trait-return.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
infinite-recursive-type-impl-trait.rs EXTREMELY hacky fix 2020-08-07 21:26:12 -04:00
infinite-recursive-type-impl-trait.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
infinite-recursive-type.rs Don't ICE on infinitely recursive types 2020-07-15 10:54:05 -04:00
infinite-recursive-type.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
invalid-cfg.rs Unify rustc and rustdoc parsing of cfg() 2021-05-03 12:49:43 -04:00
invalid-cfg.stderr Unify rustc and rustdoc parsing of cfg() 2021-05-03 12:49:43 -04:00
invalid-doc-attr.rs Error on conflicting #[doc(inline)]/#[doc(no_inline)] attributes 2021-05-08 17:22:26 +02:00
invalid-doc-attr.stderr Unify titles in rustdoc book doc attributes chapter 2021-10-29 21:27:44 +02:00
invalid-html-tags.rs Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
invalid-html-tags.stderr Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
invalid-keyword.rs Create rustdoc_internals feature gate 2021-11-24 21:57:18 +01:00
invalid-keyword.stderr Add tests for doc_keyword feature extension 2020-11-27 17:54:28 +01:00
invalid-syntax.rs Add back missing help for ignore blocks 2021-05-17 21:31:03 -04:00
invalid-syntax.stderr Use smaller spans for some structured suggestions 2021-08-12 09:52:38 +00:00
invalid-theme-name.rs Give a better error when --theme is not a CSS file 2021-03-31 14:55:53 -04:00
invalid-theme-name.stderr Give a better error when --theme is not a CSS file 2021-03-31 14:55:53 -04:00
issue-58473-2.rs Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
issue-58473.rs Moving all rustdoc-ui tests to check-pass 2020-04-19 16:40:53 -07:00
issue-61592-2.rs Rustdoc render public underscore_imports as Re-exports 2020-12-31 09:07:51 +00:00
issue-61592-2.stderr Rustdoc render public underscore_imports as Re-exports 2020-12-31 09:07:51 +00:00
issue-61592.rs Rustdoc render public underscore_imports as Re-exports 2020-12-31 09:07:51 +00:00
issue-61592.stderr Rustdoc render public underscore_imports as Re-exports 2020-12-31 09:07:51 +00:00
issue-61732.rs resolve: Fix regression in resolution of raw keywords in paths 2020-03-14 19:21:38 +03:00
issue-61732.stderr resolve: Fix regression in resolution of raw keywords in paths 2020-03-14 19:21:38 +03:00
issue-74134.private.stderr Update rustdoc-ui tests for intra-doc links errors 2021-07-29 17:36:11 +02:00
issue-74134.public.stderr Update rustdoc-ui tests for intra-doc links errors 2021-07-29 17:36:11 +02:00
issue-74134.rs rustdoc: Always warn when linking from public to private items 2020-07-22 21:36:30 +02:00
issue-80992.rs Add a test 2021-01-16 06:55:29 +03:00
issue-80992.stdout change based on review 2021-05-03 20:17:15 +02:00
issue-81662-shortness.rs Add a test for the shortness format in rustdoc 2021-02-04 18:59:42 +01:00
issue-81662-shortness.stdout remove mode for run and ignore tests 2021-05-16 22:33:41 +02:00
issue-83883-describe-lints.rs Add listing of lints (eg via -W help) to rustdoc 2021-04-06 09:54:56 +01:00
issue-83883-describe-lints.stdout Add listing of lints (eg via -W help) to rustdoc 2021-04-06 09:54:56 +01:00
issue-91134.rs fix(doctest): detect extern crate items in statement doctests 2021-11-22 19:47:58 -07:00
issue-91134.stdout Update issue-91134.stdout 2021-11-22 21:00:42 -07:00
issue-91713.rs rustdoc: remove --passes and --no-defaults 2021-12-15 21:29:04 -07:00
issue-91713.stderr rustdoc: remove --passes and --no-defaults 2021-12-15 21:29:04 -07:00
issue-91713.stdout Add test for deprecation warning for --passes 2021-12-09 23:46:13 +05:30
lint-group.rs Rename rustdoc to rustdoc::all 2021-03-05 15:26:55 -05:00
lint-group.stderr Rename rustdoc to rustdoc::all 2021-03-05 15:26:55 -05:00
lint-missing-doc-code-example.rs Don't lint about missing code examples in derived traits 2021-09-17 00:39:15 +02:00
lint-missing-doc-code-example.stderr Update missing code example test 2021-03-04 21:22:43 +01:00
no-crate-level-doc-lint.rs rustdoc: link to stable/beta docs consistently in documentation 2021-06-04 14:18:21 -04:00
no-crate-level-doc-lint.stderr rustdoc: link to stable/beta docs consistently in documentation 2021-06-04 14:18:21 -04:00
no-run-flag-error.rs Apply suggestions from code review 2021-05-01 11:54:57 +02:00
no-run-flag-error.stderr Apply suggestions from code review 2021-05-01 11:54:57 +02:00
no-run-flag.rs fix failing tidy check 2021-04-07 20:48:12 +02:00
no-run-flag.stdout remove mode for run and ignore tests 2021-05-16 22:33:41 +02:00
nocapture-fail.rs Add invalid rust code for test 2021-07-18 12:07:51 +02:00
nocapture-fail.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
nocapture-fail.stdout Add invalid rust code for test 2021-07-18 12:07:51 +02:00
nocapture.rs Add test for rustdoc --nocapture option 2021-07-18 11:54:39 +02:00
nocapture.stderr Add test for rustdoc --nocapture option 2021-07-18 11:54:39 +02:00
nocapture.stdout Add test for rustdoc --nocapture option 2021-07-18 11:54:39 +02:00
normalize-cycle.rs Use try_normalize_erasing_regions instead of a custom infer context 2021-12-01 19:22:24 +00:00
normalize-overflow.rs Use try_normalize_erasing_regions instead of a custom infer context 2021-12-01 19:22:24 +00:00
output-format-html-stable.rs Fix handling of --output-format json flag 2021-04-06 18:41:17 -04:00
private-doc-test.rs Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
private-item-doc-test.rs Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
private-item-doc-test.stderr Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
private-public-item-doc-test.rs Improve rustdoc::private_doc_tests tests 2021-12-29 00:55:22 +11:00
private-public-item-doc-test.stderr Improve rustdoc::private_doc_tests tests 2021-12-29 00:55:22 +11:00
pub-export-lint.rs Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
pub-export-lint.stderr Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
public-reexported-item-doc-test.rs Improve rustdoc::private_doc_tests tests 2021-12-29 00:55:22 +11:00
range-pattern.rs Get rid of custom pretty-printing in rustdoc 2021-01-07 17:44:59 -05:00
recursive-deref-ice.rs Add tests for recursive deref 2021-10-29 14:25:15 +02:00
reference-link-reports-error-once.rs Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
reference-link-reports-error-once.stderr Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
reference-links.rs Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
reference-links.stderr Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
renamed-lint-still-applies.rs Warn when rustdoc:: group is omitted from lint names 2021-07-03 15:32:09 -04:00
renamed-lint-still-applies.stderr Warn when rustdoc:: group is omitted from lint names 2021-07-03 15:32:09 -04:00
run-directory.correct.stdout remove mode for run and ignore tests 2021-05-16 22:33:41 +02:00
run-directory.incorrect.stdout remove mode for run and ignore tests 2021-05-16 22:33:41 +02:00
run-directory.rs Don't pass -Z unstable-options by default for UI tests 2021-06-06 00:44:54 -04:00
rustc-check-passes.rs Add test for rustdoc new check pass 2021-02-28 00:48:43 +01:00
rustc-check-passes.stderr Add test for rustdoc new check pass 2021-02-28 00:48:43 +01:00
scrape-examples-ice.rs Change output path to {{build-base}} 2021-11-28 23:42:47 +08:00
scrape-examples-wrong-options-1.rs Revert def_id addition from clean::Function, add test for 2021-10-22 12:46:45 -07:00
scrape-examples-wrong-options-1.stderr Revert def_id addition from clean::Function, add test for 2021-10-22 12:46:45 -07:00
scrape-examples-wrong-options-2.rs Revert def_id addition from clean::Function, add test for 2021-10-22 12:46:45 -07:00
scrape-examples-wrong-options-2.stderr Revert def_id addition from clean::Function, add test for 2021-10-22 12:46:45 -07:00
search-index-generics-recursion-bug-issue-59502.rs Add regression test for #59502 2021-12-28 14:09:20 -08:00
test-compile-fail1.rs rustdoc: Fix handling of compile errors when running rustdoc --test 2020-01-18 23:51:06 +00:00
test-compile-fail1.stderr rustdoc: Fix handling of compile errors when running rustdoc --test 2020-01-18 23:51:06 +00:00
test-compile-fail2.rs rustdoc: Fix handling of compile errors when running rustdoc --test 2020-01-18 23:51:06 +00:00
test-compile-fail2.stderr rustdoc: Fix handling of compile errors when running rustdoc --test 2020-01-18 23:51:06 +00:00
test-compile-fail3.rs rustdoc: Fix handling of compile errors when running rustdoc --test 2020-01-18 23:51:06 +00:00
test-compile-fail3.stderr Update UI tests 2020-06-21 16:40:36 +02:00
test-no_std.rs libtest: Print the total time taken to execute a test suite 2020-11-27 17:53:59 +01:00
test-no_std.stdout remove mode for run and ignore tests 2021-05-16 22:33:41 +02:00
test-type.rs proof of concept add test type on prints 2021-05-03 15:22:19 +02:00
test-type.stdout remove mode for run and ignore tests 2021-05-16 22:33:41 +02:00
unknown-renamed-lints.rs Warn when rustdoc:: group is omitted from lint names 2021-07-03 15:32:09 -04:00
unknown-renamed-lints.stderr Auto merge of #84959 - camsteffen:lint-suggest-group, r=estebank 2021-07-20 02:11:55 +00:00
unparseable-doc-test.rs libtest: Print the total time taken to execute a test suite 2020-11-27 17:53:59 +01:00
unparseable-doc-test.stdout remove mode for run and ignore tests 2021-05-16 22:33:41 +02:00
unused-braces-lint.rs Add rustdoc regression test for the unused_braces lint 2020-04-24 19:15:07 +02:00
unused-extern-crate.rs Revert "Revert "Don't load all extern crates unconditionally"" 2021-08-22 15:25:42 +00:00
unused.rs Moving all rustdoc-ui tests to check-pass 2020-04-19 16:40:53 -07:00
use_both_out_dir_and_output_options.rs Add --out-dir flag for rustdoc 2021-11-30 10:01:14 +08:00
use_both_out_dir_and_output_options.stderr Add --out-dir flag for rustdoc 2021-11-30 10:01:14 +08:00
wasm-safe.rs std: Stabilize wasm simd intrinsics 2021-06-10 19:42:05 -07:00