-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #92086 - petrochenkov:modchild, r=jackh726
rustc_metadata: Optimize and document module children decoding The first commit limits the item in the `item_children`/`each_child_of_item` query to modules (in name resolution sense) and adds a corresponding assertion. The `associated_item_def_ids` query collecting children of traits and impls specifically now uses a simplified implementation not decoding unnecessary data instead of `each_child_of_item`, this gives a nice performance improvement. The second commit does some renaming that clarifies the terminology used for all items in a module vs `use` items only.
- Loading branch information
Showing
27 changed files
with
137 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use crate::ty; | ||
|
||
use rustc_hir::def::Res; | ||
use rustc_macros::HashStable; | ||
use rustc_span::symbol::Ident; | ||
use rustc_span::Span; | ||
|
||
/// This structure is supposed to keep enough data to re-create `NameBinding`s for other crates | ||
/// during name resolution. Right now the bindings are not recreated entirely precisely so we may | ||
/// need to add more data in the future to correctly support macros 2.0, for example. | ||
/// Module child can be either a proper item or a reexport (including private imports). | ||
/// In case of reexport all the fields describe the reexport item itself, not what it refers to. | ||
#[derive(Copy, Clone, Debug, TyEncodable, TyDecodable, HashStable)] | ||
pub struct ModChild { | ||
/// Name of the item. | ||
pub ident: Ident, | ||
/// Resolution result corresponding to the item. | ||
/// Local variables cannot be exported, so this `Res` doesn't need the ID parameter. | ||
pub res: Res<!>, | ||
/// Visibility of the item. | ||
pub vis: ty::Visibility, | ||
/// Span of the item. | ||
pub span: Span, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.