rust/src/test/ui/resolve
bors 6331023708 Auto merge of #79294 - petrochenkov:determ, r=varkor
resolve: Do not put macros into `module.unexpanded_invocations` unless necessary

Macro invocations in modules <sup>(*)</sup> need to be tracked because they can produce named items when expanded.
We cannot give definite answer to queries like "does this module declare name `n`?" until all macro calls in that module are expanded.

Previously we marked too many macros as potentially producing named items.
E.g. in this example
```rust
mod m {
    const C: u32 = line!();
}
```
`line!()` cannot emit any items into module `m`, but it was still marked.
This PR fixes that and marks macro calls as "unexpanded in module" only if they can actually emit named items into that module.

Diagnostics in UI test outputs have different order now because this change affects macro expansion order.

<sup>*</sup> Any containers for named items are called modules in resolve (that includes blocks, traits and enums in addition to `mod` items).
2020-11-24 09:17:33 +00:00
..
auxiliary Moved issue tests to subdirs and normalised names. 2019-03-14 01:00:49 +00:00
associated-fn-called-as-fn.rs Suggest calling associated fn inside traits 2020-10-26 16:31:11 -07:00
associated-fn-called-as-fn.stderr Suggest calling associated fn inside traits 2020-10-26 16:31:11 -07:00
block-with-trait-parent.rs resolve: Adjust hygienic_lexical_parent to account for enum and trait modules 2019-09-07 17:42:24 +03:00
enums-are-namespaced-xc.rs Point at local similarly named element and tweak references to variants 2019-10-27 11:50:43 -07:00
enums-are-namespaced-xc.stderr reword "possible candidate" import suggestion 2020-05-07 00:33:25 -04:00
impl-items-vis-unresolved.rs Appease tidy 2020-01-12 15:37:50 +00:00
impl-items-vis-unresolved.stderr Update output-default.json and rustdoc test 2020-01-12 15:37:50 +00:00
issue-2356.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-2356.stderr Suggest calling associated fn inside traits 2020-10-26 16:31:11 -07:00
issue-3907-2.rs Update ui test suite to use dyn 2019-05-29 00:57:31 -04:00
issue-3907-2.stderr review comments 2020-10-20 09:26:15 -07:00
issue-3907.rs Update ui test suite to use dyn 2019-05-29 00:57:31 -04:00
issue-3907.stderr reword "possible candidate" import suggestion 2020-05-07 00:33:25 -04:00
issue-5035-2.rs Update ui test suite to use dyn 2019-05-29 00:57:31 -04:00
issue-5035-2.stderr Add unsized_fn_params feature 2020-10-27 14:45:02 -03:00
issue-5035.rs Update ui test suite to use dyn 2019-05-29 00:57:31 -04:00
issue-5035.stderr Tweak some suggestions in rustc_resolve 2020-04-26 11:43:43 -07:00
issue-6702.rs Point at local similarly named element and tweak references to variants 2019-10-27 11:50:43 -07:00
issue-6702.stderr Suggest struct pat on incorrect unit or tuple pat 2020-07-14 10:41:44 -07:00
issue-14254.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-14254.stderr Suggest calling associated fn inside traits 2020-10-26 16:31:11 -07:00
issue-16058.rs Ignore SGX on a few ui tests 2020-05-05 19:19:39 -07:00
issue-16058.stderr reword "possible candidate" import suggestion 2020-05-07 00:33:25 -04:00
issue-17518.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-17518.stderr reword "possible candidate" import suggestion 2020-05-07 00:33:25 -04:00
issue-18252.rs Point at local similarly named element and tweak references to variants 2019-10-27 11:50:43 -07:00
issue-18252.stderr Suggest struct pat on incorrect unit or tuple pat 2020-07-14 10:41:44 -07:00
issue-19452.rs Moved issue tests to subdirs and normalised names. 2019-03-14 01:00:49 +00:00
issue-19452.stderr Point at item definition in foreign crates 2020-08-10 12:04:10 -07:00
issue-21221-1.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-21221-1.stderr Prefer accessible paths in 'use' suggestions 2020-06-21 18:49:39 +03:00
issue-21221-2.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-21221-2.stderr Add re-exports to use suggestions 2020-06-23 13:37:50 +03:00
issue-21221-3.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-21221-3.stderr reword "possible candidate" import suggestion 2020-05-07 00:33:25 -04:00
issue-21221-4.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-21221-4.stderr reword "possible candidate" import suggestion 2020-05-07 00:33:25 -04:00
issue-22692.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-22692.stderr Deduplicate code for path suggestion 2019-03-24 19:43:02 -07:00
issue-23305.rs Update ui test suite to use dyn 2019-05-29 00:57:31 -04:00
issue-23305.stderr Add descriptions for all queries 2020-05-31 20:15:32 +01:00
issue-24968.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-24968.stderr Remove licenses 2018-12-25 21:08:33 -07:00
issue-33876.rs Update ui test suite to use dyn 2019-05-29 00:57:31 -04:00
issue-33876.stderr Update ui test suite to use dyn 2019-05-29 00:57:31 -04:00
issue-39226.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-39226.stderr Tweak ordering of suggestions 2020-08-10 12:04:10 -07:00
issue-54379.rs Do not complain about unmentioned fields in recovered patterns 2019-03-14 18:28:24 -07:00
issue-54379.stderr Fix span for incorrect pattern field and add label 2020-10-02 00:44:16 -07:00
issue-57523.rs Use check-pass in ui tests where appropriate 2019-11-04 16:03:46 +01:00
issue-65025-extern-static-parent-generics.rs resolve: prohibit foreign statics w/ generics 2019-10-08 18:46:24 +01:00
issue-65025-extern-static-parent-generics.stderr resolve: prohibit foreign statics w/ generics 2019-10-08 18:46:24 +01:00
issue-65035-static-with-parent-generics.rs adjust tests 2020-05-09 14:40:17 +02:00
issue-65035-static-with-parent-generics.stderr Suggest minimal subset features in incomplete_features lint 2020-10-17 02:01:08 +09:00
issue-69401-trait-fn-no-body-ty-local.rs late resolve, visit_fn: bail early if there's no body. 2020-02-28 07:58:37 +01:00
issue-69401-trait-fn-no-body-ty-local.stderr late resolve, visit_fn: bail early if there's no body. 2020-02-28 07:58:37 +01:00
issue-70736-async-fn-no-body-def-collector.rs def_collector, visit_fn: account for no body 2020-04-03 17:01:21 +02:00
issue-70736-async-fn-no-body-def-collector.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
levenshtein.rs tests: remove ignore directives from tests that mention core/alloc/std spans. 2020-04-02 11:48:34 +03:00
levenshtein.stderr mv std libs to library/ 2020-07-27 19:51:13 -05:00
macro-determinacy-non-module.rs resolve: Do not put macros into module.unexpanded_invocations unless necessary 2020-11-22 14:42:29 +03:00
name-clash-nullary.rs Remove licenses 2018-12-25 21:08:33 -07:00
name-clash-nullary.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
privacy-enum-ctor.rs Remove licenses 2018-12-25 21:08:33 -07:00
privacy-enum-ctor.stderr resolve: suggest variants with placeholders 2020-10-15 17:57:57 +01:00
privacy-struct-ctor.rs resolve: fix error title regarding private constructors 2019-10-11 18:09:23 +03:00
privacy-struct-ctor.stderr Suggest struct pat on incorrect unit or tuple pat 2020-07-14 10:41:44 -07:00
raw-ident-in-path.rs resolve: Fix regression in resolution of raw keywords in paths 2020-03-14 19:21:38 +03:00
raw-ident-in-path.stderr resolve: Fix regression in resolution of raw keywords in paths 2020-03-14 19:21:38 +03:00
resolve-assoc-suggestions.rs Point at local similarly named element and tweak references to variants 2019-10-27 11:50:43 -07:00
resolve-assoc-suggestions.stderr Suggest calling associated fn inside traits 2020-10-26 16:31:11 -07:00
resolve-bad-import-prefix.rs Remove licenses 2018-12-25 21:08:33 -07:00
resolve-bad-import-prefix.stderr Update tests 2019-03-11 23:10:26 +03:00
resolve-bad-visibility.rs resolve: Move late resolution into a separate visitor 2019-08-10 13:15:15 +03:00
resolve-bad-visibility.stderr Update ui tests 2019-10-30 14:49:53 +01:00
resolve-conflict-extern-crate-vs-extern-crate.rs Remove lint annotations in specific crates that are already enforced by rustbuild 2019-07-28 18:46:24 +03:00
resolve-conflict-extern-crate-vs-extern-crate.stderr Remove lint annotations in specific crates that are already enforced by rustbuild 2019-07-28 18:46:24 +03:00
resolve-conflict-import-vs-extern-crate.rs Remove licenses 2018-12-25 21:08:33 -07:00
resolve-conflict-import-vs-extern-crate.stderr Update tests 2019-03-11 23:10:26 +03:00
resolve-conflict-import-vs-import.fixed Audit uses of tool_only_span_suggestion 2020-07-02 15:18:33 +09:00
resolve-conflict-import-vs-import.rs Audit uses of tool_only_span_suggestion 2020-07-02 15:18:33 +09:00
resolve-conflict-import-vs-import.stderr Audit uses of tool_only_span_suggestion 2020-07-02 15:18:33 +09:00
resolve-conflict-item-vs-extern-crate.rs Remove licenses 2018-12-25 21:08:33 -07:00
resolve-conflict-item-vs-extern-crate.stderr Update tests 2019-03-11 23:10:26 +03:00
resolve-conflict-item-vs-import.rs Remove licenses 2018-12-25 21:08:33 -07:00
resolve-conflict-item-vs-import.stderr Remove licenses 2018-12-25 21:08:33 -07:00
resolve-conflict-type-vs-import.rs Remove licenses 2018-12-25 21:08:33 -07:00
resolve-conflict-type-vs-import.stderr Remove licenses 2018-12-25 21:08:33 -07:00
resolve-hint-macro.rs Remove licenses 2018-12-25 21:08:33 -07:00
resolve-hint-macro.stderr Add missing primary label 2020-08-10 12:04:10 -07:00
resolve-inconsistent-binding-mode.rs resolve, inconsistent binding mode: tweak wording. 2020-03-04 03:58:52 +01:00
resolve-inconsistent-binding-mode.stderr resolve, inconsistent binding mode: tweak wording. 2020-03-04 03:58:52 +01:00
resolve-inconsistent-names.rs resolve, inconsistent binding mode: tweak wording. 2020-03-04 03:58:52 +01:00
resolve-inconsistent-names.stderr resolve, inconsistent binding mode: tweak wording. 2020-03-04 03:58:52 +01:00
resolve-label.rs resolve: disallow label use through closure/async 2020-07-02 13:48:32 +01:00
resolve-label.stderr resolve: disallow label use through closure/async 2020-07-02 13:48:32 +01:00
resolve-primitive-fallback.rs On mismatched argument count point at arguments 2020-02-11 12:42:00 -08:00
resolve-primitive-fallback.stderr reword "possible candidate" import suggestion 2020-05-07 00:33:25 -04:00
resolve-self-in-impl-2.rs Remove licenses 2018-12-25 21:08:33 -07:00
resolve-self-in-impl-2.stderr hide --explain hint if error has no extended info 2019-04-18 13:29:28 -04:00
resolve-self-in-impl.rs Remove licenses 2018-12-25 21:08:33 -07:00
resolve-self-in-impl.stderr Add descriptions for all queries 2020-05-31 20:15:32 +01:00
resolve-speculative-adjustment.rs Remove licenses 2018-12-25 21:08:33 -07:00
resolve-speculative-adjustment.stderr Suggest calling associated fn inside traits 2020-10-26 16:31:11 -07:00
resolve-type-param-in-item-in-trait.rs Make name resolution handle consts in GenericParamsFromOuterFunction properly 2019-02-07 15:03:20 +01:00
resolve-type-param-in-item-in-trait.stderr Resolve inconsistency in error messages between "parameter" and "variable". 2019-04-17 13:25:07 +03:00
resolve-unknown-trait.rs Remove licenses 2018-12-25 21:08:33 -07:00
resolve-unknown-trait.stderr Remove licenses 2018-12-25 21:08:33 -07:00
resolve-variant-assoc-item.rs clarify what the item is in "not a module" error 2019-04-10 12:55:21 -04:00
resolve-variant-assoc-item.stderr clarify what the item is in "not a module" error 2019-04-10 12:55:21 -04:00
suggest-path-instead-of-mod-dot-item.rs Remove licenses 2018-12-25 21:08:33 -07:00
suggest-path-instead-of-mod-dot-item.stderr Tweak ordering of suggestions 2020-08-10 12:04:10 -07:00
token-error-correct-2.rs tweak wording of mismatched delimiter errors 2020-01-03 08:40:15 -05:00
token-error-correct-2.stderr tweak wording of mismatched delimiter errors 2020-01-03 08:40:15 -05:00
token-error-correct-3.rs Drop support for cloudabi targets 2020-11-22 17:11:41 -05:00
token-error-correct-3.stderr Drop support for cloudabi targets 2020-11-22 17:11:41 -05:00
token-error-correct-4.fixed Audit uses of span_suggestion_short 2020-07-02 15:18:33 +09:00
token-error-correct-4.rs Audit uses of span_suggestion_short 2020-07-02 15:18:33 +09:00
token-error-correct-4.stderr Audit uses of span_suggestion_short 2020-07-02 15:18:33 +09:00
token-error-correct.rs tweak wording of mismatched delimiter errors 2020-01-03 08:40:15 -05:00
token-error-correct.stderr tweak wording of mismatched delimiter errors 2020-01-03 08:40:15 -05:00
tuple-struct-alias.rs Point at local similarly named element and tweak references to variants 2019-10-27 11:50:43 -07:00
tuple-struct-alias.stderr Point at local similarly named element and tweak references to variants 2019-10-27 11:50:43 -07:00
typo-suggestion-named-underscore.rs Do not suggest things named underscore 2020-02-02 04:55:37 +09:00
typo-suggestion-named-underscore.stderr Do not suggest things named underscore 2020-02-02 04:55:37 +09:00
unboxed-closure-sugar-nonexistent-trait.rs Remove licenses 2018-12-25 21:08:33 -07:00
unboxed-closure-sugar-nonexistent-trait.stderr Tweak some suggestions in rustc_resolve 2020-04-26 11:43:43 -07:00
unresolved_static_type_field.rs Remove licenses 2018-12-25 21:08:33 -07:00
unresolved_static_type_field.stderr review comments: change wording 2019-04-18 18:39:56 -07:00
use_suggestion.rs Improve E0433, so that it suggests missing imports 2020-06-02 20:41:25 +02:00
use_suggestion.stderr Clarify message about unresolved use 2020-09-01 18:38:14 +01:00
use_suggestion_placement.rs Drop support for cloudabi targets 2020-11-22 17:11:41 -05:00
use_suggestion_placement.stderr Drop support for cloudabi targets 2020-11-22 17:11:41 -05:00
visibility-indeterminate.rs resolve: Remove ! from "cannot find" diagnostics for macros 2019-09-15 13:22:07 +03:00
visibility-indeterminate.stderr update ui tests 2019-10-31 14:27:16 +01:00