1
Fork 0

ast: Keep expansion status for out-of-line module items

Also remove `ast::Mod` which is mostly redundant now
This commit is contained in:
Vadim Petrochenkov 2021-02-17 00:56:07 +03:00
parent eb65f15c78
commit 4a88165124
14 changed files with 147 additions and 125 deletions

View file

@ -1023,7 +1023,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
});
}
ItemKind::Mod(_) | ItemKind::ForeignMod(_) => {
ItemKind::Mod(..) | ItemKind::ForeignMod(_) => {
self.with_scope(item.id, |this| {
visit::walk_item(this, item);
});

View file

@ -29,7 +29,7 @@ use rustc_ast::unwrap_or;
use rustc_ast::visit::{self, Visitor};
use rustc_ast::{self as ast, NodeId};
use rustc_ast::{Crate, CRATE_NODE_ID};
use rustc_ast::{ItemKind, Path};
use rustc_ast::{ItemKind, ModKind, Path};
use rustc_ast_lowering::ResolverAstLowering;
use rustc_ast_pretty::pprust;
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
@ -339,8 +339,8 @@ impl UsePlacementFinder {
impl<'tcx> Visitor<'tcx> for UsePlacementFinder {
fn visit_item(&mut self, item: &'tcx ast::Item) {
if let ItemKind::Mod(module) = &item.kind {
if let ControlFlow::Break(..) = self.check_mod(&module.items, item.id) {
if let ItemKind::Mod(_, ModKind::Loaded(items, ..)) = &item.kind {
if let ControlFlow::Break(..) = self.check_mod(items, item.id) {
return;
}
}