Skip to content

Commit abd9ebf

Browse files
committed
---
yaml --- r: 155245 b: refs/heads/try2 c: 1813b8c h: refs/heads/master i: 155243: 16c2fff v: v3
1 parent 7b9fbf9 commit abd9ebf

Some content is hidden

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

48 files changed

+288
-603
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 0e5cb75766f35bf5b0bef21dfc12cc9bff0a072f
8+
refs/heads/try2: 1813b8cf550772d84c1737a048bccccc79730a5b
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/configure

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,12 @@ fi
477477
step_msg "validating $CFG_SELF args"
478478
validate_opt
479479

480+
# Temporarily support the old windows triples while the bots make the transition
481+
# XXX Remove me
482+
CFG_BUILD=`echo "${CFG_BUILD}" | sed 's/-pc-mingw32/-w64-mingw32/g'`
483+
CFG_HOST=`echo "${CFG_HOST}" | sed 's/-pc-mingw32/-w64-mingw32/g'`
484+
CFG_TARGET=`echo "${CFG_TARGET}" | sed 's/-pc-mingw32/-w64-mingw32/g'`
485+
480486
# Validate the release channel
481487
case "$CFG_RELEASE_CHANNEL" in
482488
(source | nightly | beta | stable)

branches/try2/mk/tests.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass \
194194
check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
195195
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
196196

197+
# NOTE: Remove after reprogramming windows bots
198+
check-fast: check-lite
199+
197200
# Some less critical tests that are not prone to breakage.
198201
# Not run as part of the normal test suite, but tested by bors on checkin.
199202
check-secondary: check-lexer check-pretty

branches/try2/src/jemalloc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit 2dba541881fb8e35246d653bbe2e7c7088777a4a
1+
Subproject commit aae04170ccbfeea620502106b581c3c216cd132a

branches/try2/src/librustc/lint/builtin.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -954,8 +954,7 @@ impl LintPass for NonSnakeCase {
954954
match &p.node {
955955
&ast::PatIdent(_, ref path1, _) => {
956956
match cx.tcx.def_map.borrow().find(&p.id) {
957-
Some(&def::DefLocal(_, _)) | Some(&def::DefBinding(_, _)) |
958-
Some(&def::DefArg(_, _)) => {
957+
Some(&def::DefLocal(_, _)) => {
959958
self.check_snake_case(cx, "variable", path1.node, p.span);
960959
}
961960
_ => {}

branches/try2/src/librustc/middle/astencode.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,6 @@ impl tr for def::Def {
462462
def::DefMod(did) => { def::DefMod(did.tr(dcx)) }
463463
def::DefForeignMod(did) => { def::DefForeignMod(did.tr(dcx)) }
464464
def::DefStatic(did, m) => { def::DefStatic(did.tr(dcx), m) }
465-
def::DefArg(nid, b) => { def::DefArg(dcx.tr_id(nid), b) }
466465
def::DefLocal(nid, b) => { def::DefLocal(dcx.tr_id(nid), b) }
467466
def::DefVariant(e_did, v_did, is_s) => {
468467
def::DefVariant(e_did.tr(dcx), v_did.tr(dcx), is_s)
@@ -472,7 +471,6 @@ impl tr for def::Def {
472471
def::DefAssociatedTy(did) => def::DefAssociatedTy(did.tr(dcx)),
473472
def::DefPrimTy(p) => def::DefPrimTy(p),
474473
def::DefTyParam(s, did, v) => def::DefTyParam(s, did.tr(dcx), v),
475-
def::DefBinding(nid, bm) => def::DefBinding(dcx.tr_id(nid), bm),
476474
def::DefUse(did) => def::DefUse(did.tr(dcx)),
477475
def::DefUpvar(nid1, def, nid2, nid3) => {
478476
def::DefUpvar(dcx.tr_id(nid1),

branches/try2/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,9 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
514514
true
515515
}
516516

517-
pub fn is_local_variable_or_arg(&self, cmt: mc::cmt) -> bool {
517+
fn is_local_variable_or_arg(&self, cmt: mc::cmt) -> bool {
518518
match cmt.cat {
519-
mc::cat_local(_) | mc::cat_arg(_) => true,
519+
mc::cat_local(_) => true,
520520
_ => false
521521
}
522522
}
@@ -775,7 +775,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
775775
debug!("mark_variable_as_used_mut(cmt={})", cmt.repr(this.tcx()));
776776
match cmt.cat.clone() {
777777
mc::cat_copied_upvar(mc::CopiedUpvar { upvar_id: id, .. }) |
778-
mc::cat_local(id) | mc::cat_arg(id) => {
778+
mc::cat_local(id) => {
779779
this.tcx().used_mut_nodes.borrow_mut().insert(id);
780780
return;
781781
}

branches/try2/src/librustc/middle/borrowck/gather_loans/gather_moves.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ fn check_and_get_illegal_move_origin(bccx: &BorrowckCtxt,
147147
}
148148

149149
mc::cat_rvalue(..) |
150-
mc::cat_local(..) |
151-
mc::cat_arg(..) => {
150+
mc::cat_local(..) => {
152151
None
153152
}
154153

branches/try2/src/librustc/middle/borrowck/gather_loans/lifetime.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ impl<'a, 'tcx> GuaranteeLifetimeContext<'a, 'tcx> {
6969
mc::cat_rvalue(..) |
7070
mc::cat_copied_upvar(..) | // L-Local
7171
mc::cat_local(..) | // L-Local
72-
mc::cat_arg(..) | // L-Local
7372
mc::cat_upvar(..) |
7473
mc::cat_deref(_, _, mc::BorrowedPtr(..)) | // L-Deref-Borrowed
7574
mc::cat_deref(_, _, mc::Implicit(..)) |
@@ -174,8 +173,7 @@ impl<'a, 'tcx> GuaranteeLifetimeContext<'a, 'tcx> {
174173
mc::cat_static_item => {
175174
ty::ReStatic
176175
}
177-
mc::cat_local(local_id) |
178-
mc::cat_arg(local_id) => {
176+
mc::cat_local(local_id) => {
179177
ty::ReScope(self.bccx.tcx.region_maps.var_scope(local_id))
180178
}
181179
mc::cat_deref(_, _, mc::UnsafePtr(..)) => {

branches/try2/src/librustc/middle/borrowck/gather_loans/restrictions.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ impl<'a, 'tcx> RestrictionsContext<'a, 'tcx> {
6666
Safe
6767
}
6868

69-
mc::cat_local(local_id) |
70-
mc::cat_arg(local_id) => {
69+
mc::cat_local(local_id) => {
7170
// R-Variable, locally declared
7271
let lp = Rc::new(LpVar(local_id));
7372
SafeIf(lp.clone(), vec![lp])

branches/try2/src/librustc/middle/borrowck/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ pub fn opt_loan_path(cmt: &mc::cmt) -> Option<Rc<LoanPath>> {
321321
None
322322
}
323323

324-
mc::cat_local(id) |
325-
mc::cat_arg(id) => {
324+
mc::cat_local(id) => {
326325
Some(Rc::new(LpVar(id)))
327326
}
328327

branches/try2/src/librustc/middle/def.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ pub enum Def {
2222
DefMod(ast::DefId),
2323
DefForeignMod(ast::DefId),
2424
DefStatic(ast::DefId, bool /* is_mutbl */),
25-
DefArg(ast::NodeId, ast::BindingMode),
2625
DefLocal(ast::NodeId, ast::BindingMode),
2726
DefVariant(ast::DefId /* enum */, ast::DefId /* variant */, bool /* is_structure */),
2827
DefTy(ast::DefId, bool /* is_enum */),
2928
DefAssociatedTy(ast::DefId),
3029
DefTrait(ast::DefId),
3130
DefPrimTy(ast::PrimTy),
3231
DefTyParam(ParamSpace, ast::DefId, uint),
33-
DefBinding(ast::NodeId, ast::BindingMode),
3432
DefUse(ast::DefId),
3533
DefUpvar(ast::NodeId, // id of closed over var
3634
Gc<Def>, // closed over def
@@ -68,11 +66,9 @@ impl Def {
6866
DefMethod(id, _) => {
6967
id
7068
}
71-
DefArg(id, _) |
7269
DefLocal(id, _) |
7370
DefSelfTy(id) |
7471
DefUpvar(id, _, _, _) |
75-
DefBinding(id, _) |
7672
DefRegion(id) |
7773
DefTyParamBinder(id) |
7874
DefLabel(id) => {

branches/try2/src/librustc/middle/liveness.rs

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -437,24 +437,15 @@ fn visit_arm(ir: &mut IrMaps, arm: &Arm) {
437437
visit::walk_arm(ir, arm);
438438
}
439439

440-
fn moved_variable_node_id_from_def(def: Def) -> Option<NodeId> {
441-
match def {
442-
DefBinding(nid, _) |
443-
DefArg(nid, _) |
444-
DefLocal(nid, _) => Some(nid),
445-
446-
_ => None
447-
}
448-
}
449-
450440
fn visit_expr(ir: &mut IrMaps, expr: &Expr) {
451441
match expr.node {
452442
// live nodes required for uses or definitions of variables:
453443
ExprPath(_) => {
454444
let def = ir.tcx.def_map.borrow().get_copy(&expr.id);
455445
debug!("expr {}: path that leads to {:?}", expr.id, def);
456-
if moved_variable_node_id_from_def(def).is_some() {
457-
ir.add_live_node_for_node(expr.id, ExprNode(expr.span));
446+
match def {
447+
DefLocal(..) => ir.add_live_node_for_node(expr.id, ExprNode(expr.span)),
448+
_ => {}
458449
}
459450
visit::walk_expr(ir, expr);
460451
}
@@ -470,13 +461,13 @@ fn visit_expr(ir: &mut IrMaps, expr: &Expr) {
470461
let mut call_caps = Vec::new();
471462
freevars::with_freevars(ir.tcx, expr.id, |freevars| {
472463
for fv in freevars.iter() {
473-
match moved_variable_node_id_from_def(fv.def) {
474-
Some(rv) => {
464+
match fv.def {
465+
DefLocal(rv, _) => {
475466
let fv_ln = ir.add_live_node(FreeVarNode(fv.span));
476467
call_caps.push(CaptureInfo {ln: fv_ln,
477468
var_nid: rv});
478469
}
479-
None => {}
470+
_ => {}
480471
}
481472
}
482473
});
@@ -1296,9 +1287,8 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
12961287

12971288
fn access_path(&mut self, expr: &Expr, succ: LiveNode, acc: uint)
12981289
-> LiveNode {
1299-
let def = self.ir.tcx.def_map.borrow().get_copy(&expr.id);
1300-
match moved_variable_node_id_from_def(def) {
1301-
Some(nid) => {
1290+
match self.ir.tcx.def_map.borrow().get_copy(&expr.id) {
1291+
DefLocal(nid, _) => {
13021292
let ln = self.live_node(expr.id, expr.span);
13031293
if acc != 0u {
13041294
self.init_from_succ(ln, succ);
@@ -1307,7 +1297,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
13071297
}
13081298
ln
13091299
}
1310-
None => succ
1300+
_ => succ
13111301
}
13121302
}
13131303

@@ -1546,16 +1536,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
15461536
let var = self.variable(nid, expr.span);
15471537
self.warn_about_dead_assign(expr.span, expr.id, ln, var);
15481538
}
1549-
def => {
1550-
match moved_variable_node_id_from_def(def) {
1551-
Some(nid) => {
1552-
let ln = self.live_node(expr.id, expr.span);
1553-
let var = self.variable(nid, expr.span);
1554-
self.warn_about_dead_assign(expr.span, expr.id, ln, var);
1555-
}
1556-
None => {}
1557-
}
1558-
}
1539+
_ => {}
15591540
}
15601541
}
15611542

branches/try2/src/librustc/middle/mem_categorization.rs

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ use util::ppaux::{ty_to_string, Repr};
7171

7272
use syntax::ast::{MutImmutable, MutMutable};
7373
use syntax::ast;
74+
use syntax::ast_map;
7475
use syntax::codemap::Span;
7576
use syntax::print::pprust;
7677
use syntax::parse::token;
@@ -85,7 +86,6 @@ pub enum categorization {
8586
cat_copied_upvar(CopiedUpvar), // upvar copied into proc env
8687
cat_upvar(ty::UpvarId, ty::UpvarBorrow), // by ref upvar from stack closure
8788
cat_local(ast::NodeId), // local variable
88-
cat_arg(ast::NodeId), // formal argument
8989
cat_deref(cmt, uint, PointerKind), // deref of a ptr
9090
cat_interior(cmt, InteriorKind), // something interior: field, tuple, etc
9191
cat_downcast(cmt), // selects a particular enum variant (*1)
@@ -326,8 +326,6 @@ impl MutabilityCategory {
326326
def::DefStatic(_, false) => McImmutable,
327327
def::DefStatic(_, true) => McDeclared,
328328

329-
def::DefArg(_, binding_mode) |
330-
def::DefBinding(_, binding_mode) |
331329
def::DefLocal(_, binding_mode) => match binding_mode {
332330
ast::BindByValue(ast::MutMutable) => McDeclared,
333331
_ => McImmutable
@@ -556,19 +554,6 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
556554
}))
557555
}
558556

559-
def::DefArg(vid, _) => {
560-
// Idea: make this could be rewritten to model by-ref
561-
// stuff as `&const` and `&mut`?
562-
563-
Ok(Rc::new(cmt_ {
564-
id: id,
565-
span: span,
566-
cat: cat_arg(vid),
567-
mutbl: MutabilityCategory::from_def(&def),
568-
ty:expr_ty
569-
}))
570-
}
571-
572557
def::DefUpvar(var_id, _, fn_node_id, _) => {
573558
let ty = if_ok!(self.node_ty(fn_node_id));
574559
match ty::get(ty).sty {
@@ -634,9 +619,7 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
634619
}
635620
}
636621

637-
def::DefLocal(vid, _) |
638-
def::DefBinding(vid, _) => {
639-
// by-value/by-ref bindings are local variables
622+
def::DefLocal(vid, _) => {
640623
Ok(Rc::new(cmt_ {
641624
id: id,
642625
span: span,
@@ -1196,11 +1179,13 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
11961179
cat_rvalue(..) => {
11971180
"non-lvalue".to_string()
11981181
}
1199-
cat_local(_) => {
1200-
"local variable".to_string()
1201-
}
1202-
cat_arg(..) => {
1203-
"argument".to_string()
1182+
cat_local(vid) => {
1183+
match self.tcx().map.find(vid) {
1184+
Some(ast_map::NodeArg(_)) => {
1185+
"argument".to_string()
1186+
}
1187+
_ => "local variable".to_string()
1188+
}
12041189
}
12051190
cat_deref(ref base, _, pk) => {
12061191
match base.cat {
@@ -1267,7 +1252,6 @@ impl cmt_ {
12671252
cat_static_item |
12681253
cat_copied_upvar(..) |
12691254
cat_local(..) |
1270-
cat_arg(..) |
12711255
cat_deref(_, _, UnsafePtr(..)) |
12721256
cat_deref(_, _, GcPtr(..)) |
12731257
cat_deref(_, _, BorrowedPtr(..)) |
@@ -1311,7 +1295,6 @@ impl cmt_ {
13111295
cat_rvalue(..) |
13121296
cat_local(..) |
13131297
cat_upvar(..) |
1314-
cat_arg(_) |
13151298
cat_deref(_, _, UnsafePtr(..)) => { // yes, it's aliasable, but...
13161299
None
13171300
}
@@ -1363,8 +1346,7 @@ impl Repr for categorization {
13631346
cat_rvalue(..) |
13641347
cat_copied_upvar(..) |
13651348
cat_local(..) |
1366-
cat_upvar(..) |
1367-
cat_arg(..) => {
1349+
cat_upvar(..) => {
13681350
format!("{:?}", *self)
13691351
}
13701352
cat_deref(ref cmt, derefs, ptr) => {

0 commit comments

Comments
 (0)