Skip to content

Commit 1efc265

Browse files
committed
Pull uses out of modules
1 parent 31d40fc commit 1efc265

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

compiler/rustc_ast/src/visitors.rs

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1-
pub mod visit {
1+
use std::ops::DerefMut;
2+
use std::panic;
3+
4+
use rustc_data_structures::flat_map_in_place::FlatMapInPlace;
5+
use rustc_data_structures::stack::ensure_sufficient_stack;
6+
use rustc_data_structures::sync::Lrc;
7+
use rustc_span::Span;
8+
use rustc_span::source_map::Spanned;
9+
use rustc_span::symbol::Ident;
10+
use smallvec::{Array, SmallVec, smallvec};
11+
use thin_vec::ThinVec;
12+
13+
use crate::ast::*;
14+
use crate::ptr::P;
15+
use crate::token::{self, Token};
16+
use crate::tokenstream::*;
217

18+
pub mod visit {
319
//! AST walker. Each overridden visit method has full control over what
420
//! happens with its node, it can do its own traversal of the node's children,
521
//! call `visit::walk_*` to apply the default traversal algorithm, or prevent
@@ -17,11 +33,8 @@ pub mod visit {
1733
1834
pub use rustc_ast_ir::visit::VisitorResult;
1935
pub use rustc_ast_ir::{try_visit, visit_opt, walk_list, walk_visitable_list};
20-
use rustc_span::Span;
21-
use rustc_span::symbol::Ident;
2236

23-
use crate::ast::*;
24-
use crate::ptr::P;
37+
use super::*;
2538

2639
#[derive(Copy, Clone, Debug, PartialEq)]
2740
pub enum AssocCtxt {
@@ -1281,22 +1294,7 @@ pub mod mut_visit {
12811294
//! a `MutVisitor` renaming item names in a module will miss all of those
12821295
//! that are created by the expansion of a macro.
12831296
1284-
use std::ops::DerefMut;
1285-
use std::panic;
1286-
1287-
use rustc_data_structures::flat_map_in_place::FlatMapInPlace;
1288-
use rustc_data_structures::stack::ensure_sufficient_stack;
1289-
use rustc_data_structures::sync::Lrc;
1290-
use rustc_span::Span;
1291-
use rustc_span::source_map::Spanned;
1292-
use rustc_span::symbol::Ident;
1293-
use smallvec::{Array, SmallVec, smallvec};
1294-
use thin_vec::ThinVec;
1295-
1296-
use crate::ast::*;
1297-
use crate::ptr::P;
1298-
use crate::token::{self, Token};
1299-
use crate::tokenstream::*;
1297+
use super::*;
13001298
use crate::visit::{AssocCtxt, BoundKind};
13011299

13021300
pub trait ExpectOne<A: Array> {

0 commit comments

Comments
 (0)