Skip to content

Commit 6f43224

Browse files
committed
---
yaml --- r: 231687 b: refs/heads/auto c: 7c8c72d h: refs/heads/master i: 231685: 4491f91 231683: 70487af 231679: 12dac55 v: v3
1 parent 39d4ad7 commit 6f43224

File tree

165 files changed

+4457
-13923
lines changed

Some content is hidden

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

165 files changed

+4457
-13923
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: cd138dc4475fa90b007969d0a4e00f230be777cf
11+
refs/heads/auto: 7c8c72d3b0d12b6d595c7316c3e68a205acdeaf8
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/mk/crates.mk

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ TARGET_CRATES := libc std flate arena term \
5656
alloc_system
5757
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
59-
rustc_data_structures rustc_front rustc_platform_intrinsics
59+
rustc_data_structures rustc_platform_intrinsics
6060
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
6161
TOOLS := compiletest rustdoc rustc rustbook error-index-generator
6262

@@ -71,24 +71,23 @@ DEPS_graphviz := std
7171
DEPS_syntax := std term serialize log fmt_macros arena libc rustc_bitflags
7272
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
7373
rustc_typeck rustc_resolve log syntax serialize rustc_llvm \
74-
rustc_trans rustc_privacy rustc_lint rustc_front
74+
rustc_trans rustc_privacy rustc_lint
7575

7676
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
77-
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics
78-
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics
79-
DEPS_rustc_borrowck := rustc rustc_front log graphviz syntax
80-
DEPS_rustc_resolve := rustc rustc_front log syntax
81-
DEPS_rustc_privacy := rustc rustc_front log syntax
77+
log syntax serialize rustc_llvm rustc_platform_intrinsics
78+
DEPS_rustc_typeck := rustc syntax rustc_platform_intrinsics
79+
DEPS_rustc_borrowck := rustc log graphviz syntax
80+
DEPS_rustc_resolve := rustc log syntax
81+
DEPS_rustc_privacy := rustc log syntax
8282
DEPS_rustc_lint := rustc log syntax
8383
DEPS_rustc := syntax flate arena serialize getopts rbml \
8484
log graphviz rustc_llvm rustc_back rustc_data_structures
8585
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
8686
DEPS_rustc_platform_intrinsics := rustc rustc_llvm
87-
DEPS_rustc_back := std syntax rustc_llvm rustc_front flate log libc
88-
DEPS_rustc_front := std syntax log serialize
87+
DEPS_rustc_back := std syntax rustc_llvm flate log libc
8988
DEPS_rustc_data_structures := std log serialize
9089
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
91-
test rustc_lint rustc_front
90+
test rustc_lint
9291
DEPS_rustc_bitflags := core
9392
DEPS_flate := std native:miniz
9493
DEPS_arena := std

branches/auto/mk/docs.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ ifdef CFG_DISABLE_DOCS
191191
endif
192192

193193
docs: $(DOC_TARGETS)
194+
doc: docs
194195
compiler-docs: $(COMPILER_DOC_TARGETS)
195196

196197
trpl: doc/book/index.html

branches/auto/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
268268
// FIXME (#9639): This needs to handle non-utf8 paths
269269
let mut args = vec!("-".to_owned(),
270270
"-Zunstable-options".to_owned(),
271-
"--unpretty".to_owned(),
271+
"--pretty".to_owned(),
272272
pretty_type,
273273
format!("--target={}", config.target),
274274
"-L".to_owned(),

branches/auto/src/doc/trpl/lifetimes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ If we wanted an `&mut` reference, we’d do this:
108108

109109
If you compare `&mut i32` to `&'a mut i32`, they’re the same, it’s just that
110110
the lifetime `'a` has snuck in between the `&` and the `mut i32`. We read `&mut
111-
i32` as ‘a mutable reference to an `i32`’ and `&'a mut i32` as ‘a mutable
111+
i32` as ‘a mutable reference to an i32’ and `&'a mut i32` as ‘a mutable
112112
reference to an `i32` with the lifetime `'a`’.
113113

114114
# In `struct`s

branches/auto/src/librustc/front/map/blocks.rs renamed to branches/auto/src/librustc/ast_map/blocks.rs

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

26-
use front::map::{self, Node};
26+
use ast_map::{self, Node};
2727
use syntax::abi;
28-
use rustc_front::hir::{Block, FnDecl};
29-
use syntax::ast::{NodeId, Ident};
30-
use rustc_front::hir as ast;
28+
use syntax::ast::{Block, FnDecl, NodeId};
29+
use syntax::ast;
3130
use syntax::codemap::Span;
32-
use rustc_front::visit::FnKind;
31+
use syntax::visit::FnKind;
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).
@@ -41,7 +40,7 @@ use rustc_front::visit::FnKind;
4140
///
4241
/// To construct one, use the `Code::from_node` function.
4342
#[derive(Copy, Clone)]
44-
pub struct FnLikeNode<'a> { node: map::Node<'a> }
43+
pub struct FnLikeNode<'a> { node: ast_map::Node<'a> }
4544

4645
/// MaybeFnLike wraps a method that indicates if an object
4746
/// corresponds to some FnLikeNode.
@@ -87,7 +86,7 @@ pub enum Code<'a> {
8786
}
8887

8988
impl<'a> Code<'a> {
90-
pub fn id(&self) -> NodeId {
89+
pub fn id(&self) -> ast::NodeId {
9190
match *self {
9291
FnLikeCode(node) => node.id(),
9392
BlockCode(block) => block.id,
@@ -96,7 +95,7 @@ impl<'a> Code<'a> {
9695

9796
/// Attempts to construct a Code from presumed FnLike or Block node input.
9897
pub fn from_node(node: Node) -> Option<Code> {
99-
if let map::NodeBlock(block) = node {
98+
if let ast_map::NodeBlock(block) = node {
10099
Some(BlockCode(block))
101100
} else {
102101
FnLikeNode::from_node(node).map(|fn_like| FnLikeCode(fn_like))
@@ -107,15 +106,15 @@ impl<'a> Code<'a> {
107106
/// These are all the components one can extract from a fn item for
108107
/// use when implementing FnLikeNode operations.
109108
struct ItemFnParts<'a> {
110-
ident: Ident,
109+
ident: ast::Ident,
111110
decl: &'a ast::FnDecl,
112111
unsafety: ast::Unsafety,
113112
constness: ast::Constness,
114113
abi: abi::Abi,
115114
vis: ast::Visibility,
116115
generics: &'a ast::Generics,
117116
body: &'a Block,
118-
id: NodeId,
117+
id: ast::NodeId,
119118
span: Span
120119
}
121120

@@ -138,10 +137,10 @@ impl<'a> FnLikeNode<'a> {
138137
/// Attempts to construct a FnLikeNode from presumed FnLike node input.
139138
pub fn from_node(node: Node) -> Option<FnLikeNode> {
140139
let fn_like = match node {
141-
map::NodeItem(item) => item.is_fn_like(),
142-
map::NodeTraitItem(tm) => tm.is_fn_like(),
143-
map::NodeImplItem(_) => true,
144-
map::NodeExpr(e) => e.is_fn_like(),
140+
ast_map::NodeItem(item) => item.is_fn_like(),
141+
ast_map::NodeTraitItem(tm) => tm.is_fn_like(),
142+
ast_map::NodeImplItem(_) => true,
143+
ast_map::NodeExpr(e) => e.is_fn_like(),
145144
_ => false
146145
};
147146
if fn_like {
@@ -203,7 +202,7 @@ impl<'a> FnLikeNode<'a> {
203202
fn handle<A, I, M, C>(self, item_fn: I, method: M, closure: C) -> A where
204203
I: FnOnce(ItemFnParts<'a>) -> A,
205204
M: FnOnce(NodeId,
206-
Ident,
205+
ast::Ident,
207206
&'a ast::MethodSig,
208207
Option<ast::Visibility>,
209208
&'a ast::Block,
@@ -212,7 +211,7 @@ impl<'a> FnLikeNode<'a> {
212211
C: FnOnce(ClosureParts<'a>) -> A,
213212
{
214213
match self.node {
215-
map::NodeItem(i) => match i.node {
214+
ast_map::NodeItem(i) => match i.node {
216215
ast::ItemFn(ref decl, unsafety, constness, abi, ref generics, ref block) =>
217216
item_fn(ItemFnParts {
218217
id: i.id,
@@ -228,13 +227,13 @@ impl<'a> FnLikeNode<'a> {
228227
}),
229228
_ => panic!("item FnLikeNode that is not fn-like"),
230229
},
231-
map::NodeTraitItem(ti) => match ti.node {
230+
ast_map::NodeTraitItem(ti) => match ti.node {
232231
ast::MethodTraitItem(ref sig, Some(ref body)) => {
233232
method(ti.id, ti.ident, sig, None, body, ti.span)
234233
}
235234
_ => panic!("trait method FnLikeNode that is not fn-like"),
236235
},
237-
map::NodeImplItem(ii) => {
236+
ast_map::NodeImplItem(ii) => {
238237
match ii.node {
239238
ast::MethodImplItem(ref sig, ref body) => {
240239
method(ii.id, ii.ident, sig, Some(ii.vis), body, ii.span)
@@ -244,7 +243,7 @@ impl<'a> FnLikeNode<'a> {
244243
}
245244
}
246245
}
247-
map::NodeExpr(e) => match e.node {
246+
ast_map::NodeExpr(e) => match e.node {
248247
ast::ExprClosure(_, ref decl, ref block) =>
249248
closure(ClosureParts::new(&**decl, &**block, e.id, e.span)),
250249
_ => panic!("expr FnLikeNode that is not fn-like"),

branches/auto/src/librustc/front/map/mod.rs renamed to branches/auto/src/librustc/ast_map/mod.rs

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -15,17 +15,14 @@ use self::MapEntry::*;
1515
use metadata::inline::InlinedItem;
1616
use metadata::inline::InlinedItem as II;
1717
use middle::def_id::DefId;
18-
1918
use syntax::abi;
20-
use syntax::ast::{Name, NodeId, Ident, CRATE_NODE_ID, DUMMY_NODE_ID};
21-
use syntax::codemap::{Span, Spanned};
19+
use syntax::ast::*;
20+
use syntax::ast_util;
21+
use syntax::codemap::{DUMMY_SP, Span, Spanned};
22+
use syntax::fold::Folder;
2223
use syntax::parse::token;
23-
24-
use rustc_front::hir::*;
25-
use rustc_front::fold::Folder;
26-
use rustc_front::visit::{self, Visitor};
27-
use rustc_front::util;
28-
use rustc_front::print::pprust;
24+
use syntax::print::pprust;
25+
use syntax::visit::{self, Visitor};
2926

3027
use arena::TypedArena;
3128
use std::cell::RefCell;
@@ -162,7 +159,7 @@ impl<'ast> Clone for MapEntry<'ast> {
162159
}
163160

164161
#[derive(Debug)]
165-
pub struct InlinedParent {
162+
struct InlinedParent {
166163
path: Vec<PathElem>,
167164
ii: InlinedItem
168165
}
@@ -230,7 +227,7 @@ impl<'ast> MapEntry<'ast> {
230227

231228
/// Stores a crate and any number of inlined items from other crates.
232229
pub struct Forest {
233-
pub krate: Crate,
230+
krate: Crate,
234231
inlined_items: TypedArena<InlinedParent>
235232
}
236233

@@ -249,10 +246,9 @@ impl Forest {
249246

250247
/// Represents a mapping from Node IDs to AST elements and their parent
251248
/// Node IDs
252-
#[derive(Clone)]
253249
pub struct Map<'ast> {
254250
/// The backing storage for all the AST nodes.
255-
pub forest: &'ast Forest,
251+
forest: &'ast Forest,
256252

257253
/// NodeIds are sequential integers from 0, so we can be
258254
/// super-compact by storing them in a vector. Not everything with
@@ -874,7 +870,7 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> {
874870
}
875871

876872
fn visit_stmt(&mut self, stmt: &'ast Stmt) {
877-
let id = util::stmt_id(stmt);
873+
let id = ast_util::stmt_id(stmt);
878874
self.insert(id, NodeStmt(stmt));
879875
let parent_node = self.parent_node;
880876
self.parent_node = id;
@@ -921,7 +917,20 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> {
921917
}
922918
}
923919

924-
pub fn map_crate<'ast>(forest: &'ast mut Forest) -> Map<'ast> {
920+
pub fn map_crate<'ast, F: FoldOps>(forest: &'ast mut Forest, fold_ops: F) -> Map<'ast> {
921+
// Replace the crate with an empty one to take it out.
922+
let krate = mem::replace(&mut forest.krate, Crate {
923+
module: Mod {
924+
inner: DUMMY_SP,
925+
items: vec![],
926+
},
927+
attrs: vec![],
928+
config: vec![],
929+
exported_macros: vec![],
930+
span: DUMMY_SP
931+
});
932+
forest.krate = IdAndSpanUpdater { fold_ops: fold_ops }.fold_crate(krate);
933+
925934
let mut collector = NodeCollector {
926935
map: vec![],
927936
parent_node: CRATE_NODE_ID,
@@ -965,11 +974,11 @@ pub fn map_decoded_item<'ast, F: FoldOps>(map: &Map<'ast>,
965974
II::Item(i) => II::Item(fld.fold_item(i).expect_one("expected one item")),
966975
II::TraitItem(d, ti) => {
967976
II::TraitItem(fld.fold_ops.new_def_id(d),
968-
fld.fold_trait_item(ti).expect_one("expected one trait item"))
977+
fld.fold_trait_item(ti).expect_one("expected one trait item"))
969978
}
970979
II::ImplItem(d, ii) => {
971980
II::ImplItem(fld.fold_ops.new_def_id(d),
972-
fld.fold_impl_item(ii).expect_one("expected one impl item"))
981+
fld.fold_impl_item(ii).expect_one("expected one impl item"))
973982
}
974983
II::Foreign(i) => II::Foreign(fld.fold_foreign_item(i))
975984
};
@@ -1055,6 +1064,7 @@ fn node_id_to_string(map: &Map, id: NodeId, include_id: bool) -> String {
10551064
ItemTrait(..) => "trait",
10561065
ItemImpl(..) => "impl",
10571066
ItemDefaultImpl(..) => "default impl",
1067+
ItemMac(..) => "macro"
10581068
};
10591069
format!("{} {}{}", item_str, path_str, id_str)
10601070
}
@@ -1081,6 +1091,10 @@ fn node_id_to_string(map: &Map, id: NodeId, include_id: bool) -> String {
10811091
map.path_to_string(id),
10821092
id_str)
10831093
}
1094+
MacImplItem(ref mac) => {
1095+
format!("method macro {}{}",
1096+
pprust::mac_to_string(mac), id_str)
1097+
}
10841098
}
10851099
}
10861100
Some(NodeTraitItem(ti)) => {

branches/auto/src/librustc/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ extern crate graphviz;
7373
extern crate libc;
7474
extern crate rustc_llvm;
7575
extern crate rustc_back;
76-
extern crate rustc_front;
7776
extern crate rustc_data_structures;
7877
extern crate serialize;
7978
extern crate rbml;
@@ -102,9 +101,7 @@ pub mod back {
102101
pub use rustc_back::svh;
103102
}
104103

105-
pub mod front {
106-
pub mod map;
107-
}
104+
pub mod ast_map;
108105

109106
pub mod middle {
110107
pub mod astconv_util;

0 commit comments

Comments
 (0)