about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-04-10 19:07:57 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-04-12 15:22:03 +0300
commit5989400e2e068aec0ecc12e53dddc1d8b0c0e585 (patch)
tree8379aa79f72bcc0936dee52bc38cdb752aa7fcba
parent6b95029f176e5cdaa88de8ca7f5f59fd15a6d850 (diff)
downloadrust-5989400e2e068aec0ecc12e53dddc1d8b0c0e585.tar.gz
rust-5989400e2e068aec0ecc12e53dddc1d8b0c0e585.zip
resolve: Pre-compute non-reexport module children
Instead of repeating the same logic by walking HIR during metadata encoding.

The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list.
They can be encoded separately if this need ever arises.

`module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead.
-rw-r--r--tests/ui/macro_use_imports.fixed2
-rw-r--r--tests/ui/macro_use_imports.stderr2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/ui/macro_use_imports.fixed b/tests/ui/macro_use_imports.fixed
index 15f7a099a7d..a395e4f5653 100644
--- a/tests/ui/macro_use_imports.fixed
+++ b/tests/ui/macro_use_imports.fixed
@@ -16,7 +16,7 @@ extern crate macro_use_helper as mac;
 extern crate proc_macro_derive as mini_mac;
 
 mod a {
-    use mac::{pub_macro, function_macro, ty_macro, inner_mod_macro, pub_in_private_macro};
+    use mac::{pub_macro, inner_mod_macro, function_macro, ty_macro, pub_in_private_macro};
     use mac;
     use mini_mac::ClippyMiniMacroTest;
     use mini_mac;
diff --git a/tests/ui/macro_use_imports.stderr b/tests/ui/macro_use_imports.stderr
index 68d558dede0..6fd338cef86 100644
--- a/tests/ui/macro_use_imports.stderr
+++ b/tests/ui/macro_use_imports.stderr
@@ -22,7 +22,7 @@ error: `macro_use` attributes are no longer needed in the Rust 2018 edition
   --> $DIR/macro_use_imports.rs:19:5
    |
 LL |     #[macro_use]
-   |     ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::{pub_macro, function_macro, ty_macro, inner_mod_macro, pub_in_private_macro};`
+   |     ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::{pub_macro, inner_mod_macro, function_macro, ty_macro, pub_in_private_macro};`
 
 error: aborting due to 4 previous errors