Skip to content

Commit 1034951

Browse files
committed
---
yaml --- r: 163689 b: refs/heads/snap-stage3 c: d8f57c3 h: refs/heads/master i: 163687: 002bcf6 v: v3
1 parent b8fa599 commit 1034951

File tree

8 files changed

+25
-27
lines changed

8 files changed

+25
-27
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: fb1d6f24fc2a657cae180d6e4c572557bf20070a
4+
refs/heads/snap-stage3: d8f57c3804c083a24d1f6713cc8d64ea29b3a51e
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/librustc/middle/check_static_recursion.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
// recursively.
1313

1414
use session::Session;
15-
use middle::resolve;
16-
use middle::def::{DefStatic, DefConst};
15+
use middle::def::{DefStatic, DefConst, DefMap};
1716

1817
use syntax::ast;
1918
use syntax::{ast_util, ast_map};
@@ -22,7 +21,7 @@ use syntax::visit;
2221

2322
struct CheckCrateVisitor<'a, 'ast: 'a> {
2423
sess: &'a Session,
25-
def_map: &'a resolve::DefMap,
24+
def_map: &'a DefMap,
2625
ast_map: &'a ast_map::Map<'ast>
2726
}
2827

@@ -34,7 +33,7 @@ impl<'v, 'a, 'ast> Visitor<'v> for CheckCrateVisitor<'a, 'ast> {
3433

3534
pub fn check_crate<'ast>(sess: &Session,
3635
krate: &ast::Crate,
37-
def_map: &resolve::DefMap,
36+
def_map: &DefMap,
3837
ast_map: &ast_map::Map<'ast>) {
3938
let mut visitor = CheckCrateVisitor {
4039
sess: sess,
@@ -60,15 +59,15 @@ struct CheckItemRecursionVisitor<'a, 'ast: 'a> {
6059
root_it: &'a ast::Item,
6160
sess: &'a Session,
6261
ast_map: &'a ast_map::Map<'ast>,
63-
def_map: &'a resolve::DefMap,
62+
def_map: &'a DefMap,
6463
idstack: Vec<ast::NodeId>
6564
}
6665

6766
// Make sure a const item doesn't recursively refer to itself
6867
// FIXME: Should use the dependency graph when it's available (#1356)
6968
pub fn check_item_recursion<'a>(sess: &'a Session,
7069
ast_map: &'a ast_map::Map,
71-
def_map: &'a resolve::DefMap,
70+
def_map: &'a DefMap,
7271
it: &'a ast::Item) {
7372

7473
let mut visitor = CheckItemRecursionVisitor {

branches/snap-stage3/src/librustc/middle/def.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ pub use self::Def::*;
1212
pub use self::MethodProvenance::*;
1313

1414
use middle::subst::ParamSpace;
15+
use util::nodemap::NodeMap;
1516
use syntax::ast;
1617
use syntax::ast_util::local_def;
1718

19+
use std::cell::RefCell;
20+
1821
#[deriving(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
1922
pub enum Def {
2023
DefFn(ast::DefId, bool /* is_ctor */),
@@ -56,6 +59,9 @@ pub enum Def {
5659
DefMethod(ast::DefId /* method */, Option<ast::DefId> /* trait */, MethodProvenance),
5760
}
5861

62+
// Definition mapping
63+
pub type DefMap = RefCell<NodeMap<Def>>;
64+
5965
#[deriving(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
6066
pub enum MethodProvenance {
6167
FromTrait(ast::DefId),

branches/snap-stage3/src/librustc/middle/pat_util.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
use middle::def::*;
12-
use middle::resolve;
1312
use middle::ty;
1413
use util::nodemap::FnvHashMap;
1514

@@ -21,15 +20,15 @@ pub type PatIdMap = FnvHashMap<ast::Ident, ast::NodeId>;
2120

2221
// This is used because same-named variables in alternative patterns need to
2322
// use the NodeId of their namesake in the first pattern.
24-
pub fn pat_id_map(dm: &resolve::DefMap, pat: &ast::Pat) -> PatIdMap {
23+
pub fn pat_id_map(dm: &DefMap, pat: &ast::Pat) -> PatIdMap {
2524
let mut map = FnvHashMap::new();
2625
pat_bindings(dm, pat, |_bm, p_id, _s, path1| {
2726
map.insert(path1.node, p_id);
2827
});
2928
map
3029
}
3130

32-
pub fn pat_is_refutable(dm: &resolve::DefMap, pat: &ast::Pat) -> bool {
31+
pub fn pat_is_refutable(dm: &DefMap, pat: &ast::Pat) -> bool {
3332
match pat.node {
3433
ast::PatLit(_) | ast::PatRange(_, _) => true,
3534
ast::PatEnum(_, _) |
@@ -45,7 +44,7 @@ pub fn pat_is_refutable(dm: &resolve::DefMap, pat: &ast::Pat) -> bool {
4544
}
4645
}
4746

48-
pub fn pat_is_variant_or_struct(dm: &resolve::DefMap, pat: &ast::Pat) -> bool {
47+
pub fn pat_is_variant_or_struct(dm: &DefMap, pat: &ast::Pat) -> bool {
4948
match pat.node {
5049
ast::PatEnum(_, _) |
5150
ast::PatIdent(_, _, None) |
@@ -59,7 +58,7 @@ pub fn pat_is_variant_or_struct(dm: &resolve::DefMap, pat: &ast::Pat) -> bool {
5958
}
6059
}
6160

62-
pub fn pat_is_const(dm: &resolve::DefMap, pat: &ast::Pat) -> bool {
61+
pub fn pat_is_const(dm: &DefMap, pat: &ast::Pat) -> bool {
6362
match pat.node {
6463
ast::PatIdent(_, _, None) | ast::PatEnum(..) => {
6564
match dm.borrow().get(&pat.id) {
@@ -71,7 +70,7 @@ pub fn pat_is_const(dm: &resolve::DefMap, pat: &ast::Pat) -> bool {
7170
}
7271
}
7372

74-
pub fn pat_is_binding(dm: &resolve::DefMap, pat: &ast::Pat) -> bool {
73+
pub fn pat_is_binding(dm: &DefMap, pat: &ast::Pat) -> bool {
7574
match pat.node {
7675
ast::PatIdent(..) => {
7776
!pat_is_variant_or_struct(dm, pat) &&
@@ -81,7 +80,7 @@ pub fn pat_is_binding(dm: &resolve::DefMap, pat: &ast::Pat) -> bool {
8180
}
8281
}
8382

84-
pub fn pat_is_binding_or_wild(dm: &resolve::DefMap, pat: &ast::Pat) -> bool {
83+
pub fn pat_is_binding_or_wild(dm: &DefMap, pat: &ast::Pat) -> bool {
8584
match pat.node {
8685
ast::PatIdent(..) => pat_is_binding(dm, pat),
8786
ast::PatWild(_) => true,
@@ -91,7 +90,7 @@ pub fn pat_is_binding_or_wild(dm: &resolve::DefMap, pat: &ast::Pat) -> bool {
9190

9291
/// Call `it` on every "binding" in a pattern, e.g., on `a` in
9392
/// `match foo() { Some(a) => (), None => () }`
94-
pub fn pat_bindings<I>(dm: &resolve::DefMap, pat: &ast::Pat, mut it: I) where
93+
pub fn pat_bindings<I>(dm: &DefMap, pat: &ast::Pat, mut it: I) where
9594
I: FnMut(ast::BindingMode, ast::NodeId, Span, &ast::SpannedIdent),
9695
{
9796
walk_pat(pat, |p| {
@@ -107,7 +106,7 @@ pub fn pat_bindings<I>(dm: &resolve::DefMap, pat: &ast::Pat, mut it: I) where
107106

108107
/// Checks if the pattern contains any patterns that bind something to
109108
/// an ident, e.g. `foo`, or `Foo(foo)` or `foo @ Bar(..)`.
110-
pub fn pat_contains_bindings(dm: &resolve::DefMap, pat: &ast::Pat) -> bool {
109+
pub fn pat_contains_bindings(dm: &DefMap, pat: &ast::Pat) -> bool {
111110
let mut contains_bindings = false;
112111
walk_pat(pat, |p| {
113112
if pat_is_binding(dm, p) {

branches/snap-stage3/src/librustc/middle/resolve.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ use std::mem::replace;
8484
use std::rc::{Rc, Weak};
8585
use std::uint;
8686

87-
// Definition mapping
88-
pub type DefMap = RefCell<NodeMap<Def>>;
89-
9087
#[deriving(Copy)]
9188
struct BindingInfo {
9289
span: Span,

branches/snap-stage3/src/librustc/middle/resolve_lifetime.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ pub use self::DefRegion::*;
1919
use self::ScopeChain::*;
2020

2121
use session::Session;
22-
use middle::def;
22+
use middle::def::{mod, DefMap};
2323
use middle::region;
24-
use middle::resolve::DefMap;
2524
use middle::subst;
2625
use middle::ty;
2726
use std::fmt;

branches/snap-stage3/src/librustc/middle/ty.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,12 @@ use lint;
4646
use metadata::csearch;
4747
use middle;
4848
use middle::const_eval;
49-
use middle::def;
49+
use middle::def::{mod, DefMap};
5050
use middle::dependency_format;
5151
use middle::lang_items::{FnTraitLangItem, FnMutTraitLangItem};
5252
use middle::lang_items::{FnOnceTraitLangItem, TyDescStructLangItem};
5353
use middle::mem_categorization as mc;
5454
use middle::region;
55-
use middle::resolve;
5655
use middle::resolve_lifetime;
5756
use middle::infer;
5857
use middle::stability;
@@ -615,7 +614,7 @@ pub struct ctxt<'tcx> {
615614
// queried from a HashSet.
616615
interner: RefCell<FnvHashMap<InternedTy<'tcx>, Ty<'tcx>>>,
617616
pub sess: Session,
618-
pub def_map: resolve::DefMap,
617+
pub def_map: DefMap,
619618

620619
pub named_region_map: resolve_lifetime::NamedRegionMap,
621620

@@ -1967,7 +1966,7 @@ impl UnboxedClosureKind {
19671966

19681967
pub fn mk_ctxt<'tcx>(s: Session,
19691968
type_arena: &'tcx TypedArena<TyS<'tcx>>,
1970-
dm: resolve::DefMap,
1969+
dm: DefMap,
19711970
named_region_map: resolve_lifetime::NamedRegionMap,
19721971
map: ast_map::Map<'tcx>,
19731972
freevars: RefCell<FreevarMap>,

branches/snap-stage3/src/librustc_trans/trans/_match.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,11 @@ use llvm::{ValueRef, BasicBlockRef};
193193
use middle::check_match::StaticInliner;
194194
use middle::check_match;
195195
use middle::const_eval;
196-
use middle::def;
196+
use middle::def::{mod, DefMap};
197197
use middle::expr_use_visitor as euv;
198198
use middle::lang_items::StrEqFnLangItem;
199199
use middle::mem_categorization as mc;
200200
use middle::pat_util::*;
201-
use middle::resolve::DefMap;
202201
use trans::adt;
203202
use trans::base::*;
204203
use trans::build::{AddCase, And, BitCast, Br, CondBr, GEPi, InBoundsGEP, Load};

0 commit comments

Comments
 (0)