Skip to content

Commit 76eaed4

Browse files
committed
syntax: move ast_map to librustc.
1 parent 7b0f2af commit 76eaed4

File tree

45 files changed

+75
-63
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+75
-63
lines changed

src/libsyntax/ast_map/blocks.rs renamed to src/librustc/ast_map/blocks.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@
2323
2424
pub use self::Code::*;
2525

26-
use abi;
27-
use ast::{Block, FnDecl, NodeId};
28-
use ast;
29-
use ast_map::Node;
30-
use ast_map;
31-
use codemap::Span;
32-
use visit;
26+
use ast_map::{self, Node};
27+
use syntax::abi;
28+
use syntax::ast::{Block, FnDecl, NodeId};
29+
use syntax::ast;
30+
use syntax::codemap::Span;
31+
use syntax::visit;
3332

3433
/// An FnLikeNode is a Node that is like a fn, in that it has a decl
3534
/// and a body (as well as a NodeId, a span, etc).

src/libsyntax/ast_map/mod.rs renamed to src/librustc/ast_map/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ pub use self::Node::*;
1212
pub use self::PathElem::*;
1313
use self::MapEntry::*;
1414

15-
use abi;
16-
use ast::*;
17-
use ast_util;
18-
use codemap::{DUMMY_SP, Span, Spanned};
19-
use fold::Folder;
20-
use parse::token;
21-
use print::pprust;
22-
use visit::{self, Visitor};
15+
use syntax::abi;
16+
use syntax::ast::*;
17+
use syntax::ast_util;
18+
use syntax::codemap::{DUMMY_SP, Span, Spanned};
19+
use syntax::fold::Folder;
20+
use syntax::parse::token;
21+
use syntax::print::pprust;
22+
use syntax::visit::{self, Visitor};
2323

2424
use arena::TypedArena;
2525
use std::cell::RefCell;

src/librustc/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ pub mod back {
9292
pub use rustc_back::x86_64;
9393
}
9494

95+
pub mod ast_map;
96+
9597
pub mod middle {
9698
pub mod astconv_util;
9799
pub mod astencode;

src/librustc/metadata/csearch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// Searching for information from the cstore
1212

13+
use ast_map;
1314
use metadata::common::*;
1415
use metadata::cstore;
1516
use metadata::decoder;
@@ -20,7 +21,6 @@ use rbml;
2021
use rbml::reader;
2122
use std::rc::Rc;
2223
use syntax::ast;
23-
use syntax::ast_map;
2424
use syntax::attr;
2525
use syntax::attr::AttrMetaMethods;
2626
use syntax::diagnostic::expect;

src/librustc/metadata/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
pub use self::DefLike::*;
1616
use self::Family::*;
1717

18+
use ast_map;
1819
use back::svh::Svh;
1920
use metadata::cstore::crate_metadata;
2021
use metadata::common::*;
@@ -44,7 +45,6 @@ use std::str;
4445
use rbml::reader;
4546
use rbml;
4647
use serialize::Decodable;
47-
use syntax::ast_map;
4848
use syntax::attr;
4949
use syntax::parse::token::{IdentInterner, special_idents};
5050
use syntax::parse::token;

src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
pub use self::InlinedItemRef::*;
1717

18+
use ast_map::{self, LinkedPath, PathElem, PathElems};
1819
use back::svh::Svh;
1920
use session::config;
2021
use metadata::common::*;
@@ -34,7 +35,6 @@ use std::io::prelude::*;
3435
use std::io::{Cursor, SeekFrom};
3536
use syntax::abi;
3637
use syntax::ast::{self, DefId, NodeId};
37-
use syntax::ast_map::{self, LinkedPath, PathElem, PathElems};
3838
use syntax::ast_util::*;
3939
use syntax::ast_util;
4040
use syntax::attr;

src/librustc/middle/astencode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// FIXME: remove this after snapshot, and Results are handled
1313
#![allow(unused_must_use)]
1414

15+
use ast_map;
1516
use metadata::common as c;
1617
use metadata::cstore as cstore;
1718
use session::Session;
@@ -32,7 +33,7 @@ use middle::subst::VecPerParamSpace;
3233
use middle::ty::{self, Ty, MethodCall, MethodCallee, MethodOrigin};
3334
use util::ppaux::ty_to_string;
3435

35-
use syntax::{ast, ast_map, ast_util, codemap, fold};
36+
use syntax::{ast, ast_util, codemap, fold};
3637
use syntax::codemap::Span;
3738
use syntax::fold::Folder;
3839
use syntax::parse::token;

src/librustc/middle/cfg/graphviz.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use std::borrow::IntoCow;
1717
use graphviz as dot;
1818

1919
use syntax::ast;
20-
use syntax::ast_map;
2120

21+
use ast_map;
2222
use middle::cfg;
2323

2424
pub type Node<'a> = (cfg::CFGIndex, &'a cfg::CFGNode);

src/librustc/middle/check_static_recursion.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
// This compiler pass detects static items that refer to themselves
1212
// recursively.
1313

14+
use ast_map;
1415
use session::Session;
1516
use middle::def::{DefStatic, DefConst, DefAssociatedConst, DefMap};
1617

17-
use syntax::ast;
18-
use syntax::{ast_util, ast_map};
18+
use syntax::{ast, ast_util};
1919
use syntax::codemap::Span;
2020
use syntax::visit::Visitor;
2121
use syntax::visit;

src/librustc/middle/const_eval.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ pub use self::const_val::*;
1515

1616
use self::ErrKind::*;
1717

18+
use ast_map;
19+
use ast_map::blocks::FnLikeNode;
1820
use metadata::csearch;
1921
use middle::{astencode, def, infer, subst, traits};
2022
use middle::pat_util::def_to_path;
@@ -24,13 +26,12 @@ use util::num::ToPrimitive;
2426
use util::ppaux::Repr;
2527

2628
use syntax::ast::{self, Expr};
27-
use syntax::ast_map::blocks::FnLikeNode;
2829
use syntax::ast_util;
2930
use syntax::codemap::Span;
3031
use syntax::feature_gate;
3132
use syntax::parse::token::InternedString;
3233
use syntax::ptr::P;
33-
use syntax::{ast_map, codemap, visit};
34+
use syntax::{codemap, visit};
3435

3536
use std::borrow::{Cow, IntoCow};
3637
use std::num::wrapping::OverflowingOps;

0 commit comments

Comments
 (0)