Skip to content

Commit 65715dc

Browse files
committed
---
yaml --- r: 95663 b: refs/heads/dist-snap c: 12308db h: refs/heads/master i: 95661: 1cc96c7 95659: 846d152 95655: f302933 95647: 8d22c94 v: v3
1 parent 3c8beeb commit 65715dc

File tree

168 files changed

+439
-874
lines changed

Some content is hidden

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

168 files changed

+439
-874
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 950add4e49cc2ac5d60abd6da969392123ddcce0
9+
refs/heads/dist-snap: 12308db3d23fe59b7ccfed6c535896ac6fdb5abe
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
branch = master
99
[submodule "src/gyp"]
1010
path = src/gyp
11-
url = https://github.com/brson/gyp.git
11+
url = https://git.chromium.org/external/gyp.git

branches/dist-snap/mk/install.mk

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ else
2323
INSTALL = $(Q)$(call E, install: $(2)/$(3)) && install -m755 $(1)/$(3) $(2)/$(3)
2424
endif
2525

26-
# For MK_INSTALL_DIR
27-
# $(1) is the directory to create
28-
MK_INSTALL_DIR = (umask 022 && mkdir -p $(1))
29-
3026
# For INSTALL_LIB,
3127
# Target-specific $(LIB_SOURCE_DIR) is the source directory
3228
# Target-specific $(LIB_DESTIN_DIR) is the destination directory
@@ -87,7 +83,7 @@ define INSTALL_TARGET_N
8783
install-target-$(1)-host-$(2): LIB_SOURCE_DIR=$$(TL$(1)$(2))
8884
install-target-$(1)-host-$(2): LIB_DESTIN_DIR=$$(PTL$(1)$(2))
8985
install-target-$(1)-host-$(2): $$(TSREQ$$(ISTAGE)_T_$(1)_H_$(2)) $$(SREQ$$(ISTAGE)_T_$(1)_H_$(2))
90-
$$(Q)$$(call MK_INSTALL_DIR,$$(PTL$(1)$(2)))
86+
$$(Q)mkdir -p $$(PTL$(1)$(2))
9187
$$(Q)$$(call INSTALL_LIB,$$(CFG_RUNTIME_$(1)))
9288
$$(Q)$$(call INSTALL_LIB,$$(STDLIB_GLOB_$(1)))
9389
$$(Q)$$(call INSTALL_LIB,$$(EXTRALIB_GLOB_$(1)))
@@ -99,7 +95,7 @@ define INSTALL_HOST_N
9995
install-target-$(1)-host-$(2): LIB_SOURCE_DIR=$$(TL$(1)$(2))
10096
install-target-$(1)-host-$(2): LIB_DESTIN_DIR=$$(PTL$(1)$(2))
10197
install-target-$(1)-host-$(2): $$(CSREQ$$(ISTAGE)_T_$(1)_H_$(2))
102-
$$(Q)$$(call MK_INSTALL_DIR,$$(PTL$(1)$(2)))
98+
$$(Q)mkdir -p $$(PTL$(1)$(2))
10399
$$(Q)$$(call INSTALL_LIB,$$(CFG_RUNTIME_$(1)))
104100
$$(Q)$$(call INSTALL_LIB,$$(CFG_RUSTLLVM_$(1)))
105101
$$(Q)$$(call INSTALL_LIB,$$(STDLIB_GLOB_$(1)))
@@ -135,9 +131,9 @@ PHL = $(PREFIX_LIB)
135131
install-host: LIB_SOURCE_DIR=$(HL)
136132
install-host: LIB_DESTIN_DIR=$(PHL)
137133
install-host: $(CSREQ$(ISTAGE)_T_$(CFG_BUILD_TRIPLE)_H_$(CFG_BUILD_TRIPLE))
138-
$(Q)$(call MK_INSTALL_DIR,$(PREFIX_BIN))
139-
$(Q)$(call MK_INSTALL_DIR,$(PREFIX_LIB))
140-
$(Q)$(call MK_INSTALL_DIR,$(PREFIX_ROOT)/share/man/man1)
134+
$(Q)mkdir -p $(PREFIX_BIN)
135+
$(Q)mkdir -p $(PREFIX_LIB)
136+
$(Q)mkdir -p $(PREFIX_ROOT)/share/man/man1
141137
$(Q)$(call INSTALL,$(HB2),$(PHB),rustc$(X_$(CFG_BUILD_TRIPLE)))
142138
$(Q)$(call INSTALL,$(HB2),$(PHB),rustpkg$(X_$(CFG_BUILD_TRIPLE)))
143139
$(Q)$(call INSTALL,$(HB2),$(PHB),rustdoc$(X_$(CFG_BUILD_TRIPLE)))

branches/dist-snap/src/libextra/comm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub fn rendezvous<T: Send>() -> (SyncPort<T>, SyncChan<T>) {
136136
#[cfg(test)]
137137
mod test {
138138
use comm::{DuplexStream, rendezvous};
139-
use std::rt::test::run_in_uv_task;
139+
use std::rt::test::run_in_newsched_task;
140140
use std::task::spawn_unlinked;
141141

142142

@@ -165,7 +165,7 @@ mod test {
165165
#[test]
166166
fn recv_a_lot() {
167167
// Rendezvous streams should be able to handle any number of messages being sent
168-
do run_in_uv_task {
168+
do run_in_newsched_task {
169169
let (port, chan) = rendezvous();
170170
do spawn {
171171
do 1000000.times { chan.send(()) }

branches/dist-snap/src/librustc/middle/borrowck/gather_loans/mod.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,12 @@ fn gather_loans_in_expr(this: &mut GatherLoanCtxt,
230230

231231
// make sure that the thing we are pointing out stays valid
232232
// for the lifetime `scope_r` of the resulting ptr:
233-
let expr_ty = ty::expr_ty(tcx, ex);
234-
if !ty::type_is_bot(expr_ty) {
235-
let scope_r = ty_region(tcx, ex.span, expr_ty);
236-
this.guarantee_valid(ex.id,
237-
ex.span,
238-
base_cmt,
239-
LoanMutability::from_ast_mutability(mutbl),
240-
scope_r);
241-
}
233+
let scope_r = ty_region(tcx, ex.span, ty::expr_ty(tcx, ex));
234+
this.guarantee_valid(ex.id,
235+
ex.span,
236+
base_cmt,
237+
LoanMutability::from_ast_mutability(mutbl),
238+
scope_r);
242239
visit::walk_expr(this, ex, ());
243240
}
244241

@@ -730,7 +727,7 @@ impl<'self> GatherLoanCtxt<'self> {
730727
loan_mutability,
731728
scope_r);
732729
}
733-
ast::BindInfer => {
730+
ast::BindByValue(_) => {
734731
// No borrows here, but there may be moves
735732
if self.bccx.is_move(pat.id) {
736733
gather_moves::gather_move_from_pat(

branches/dist-snap/src/librustc/middle/check_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ fn check_legality_of_move_bindings(cx: &MatchCheckCtxt,
884884
BindByRef(_) => {
885885
by_ref_span = Some(span);
886886
}
887-
BindInfer => {
887+
BindByValue(_) => {
888888
if cx.moves_map.contains(&id) {
889889
any_by_move = true;
890890
}

branches/dist-snap/src/librustc/middle/kind.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -432,14 +432,12 @@ fn is_nullary_variant(cx: &Context, ex: @Expr) -> bool {
432432

433433
fn check_imm_free_var(cx: &Context, def: Def, sp: Span) {
434434
match def {
435-
DefLocal(_, is_mutbl) => {
436-
if is_mutbl {
437-
cx.tcx.sess.span_err(
438-
sp,
439-
"mutable variables cannot be implicitly captured");
440-
}
435+
DefLocal(_, BindByValue(MutMutable)) => {
436+
cx.tcx.sess.span_err(
437+
sp,
438+
"mutable variables cannot be implicitly captured");
441439
}
442-
DefArg(*) => { /* ok */ }
440+
DefLocal(*) | DefArg(*) => { /* ok */ }
443441
DefUpvar(_, def1, _, _) => { check_imm_free_var(cx, *def1, sp); }
444442
DefBinding(*) | DefSelf(*) => { /*ok*/ }
445443
_ => {

branches/dist-snap/src/librustc/middle/lint.rs

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -813,28 +813,32 @@ fn check_unused_unsafe(cx: &Context, e: &ast::Expr) {
813813
}
814814

815815
fn check_unused_mut_pat(cx: &Context, p: @ast::Pat) {
816-
let mut used = false;
817-
let mut bindings = 0;
818-
do pat_util::pat_bindings(cx.tcx.def_map, p) |_, id, _, _| {
819-
used = used || cx.tcx.used_mut_nodes.contains(&id);
820-
bindings += 1;
821-
}
822-
if !used {
823-
let msg = if bindings == 1 {
824-
"variable does not need to be mutable"
825-
} else {
826-
"variables do not need to be mutable"
827-
};
828-
cx.span_lint(unused_mut, p.span, msg);
829-
}
830-
}
831-
832-
fn check_unused_mut_fn_decl(cx: &Context, fd: &ast::fn_decl) {
833-
for arg in fd.inputs.iter() {
834-
if arg.is_mutbl {
835-
check_unused_mut_pat(cx, arg.pat);
816+
fn check_unused_mut_pat_inner(cx: &Context, p: @ast::Pat) {
817+
let mut used = false;
818+
let mut bindings = 0;
819+
do pat_util::pat_bindings(cx.tcx.def_map, p) |_, id, _, _| {
820+
used = used || cx.tcx.used_mut_nodes.contains(&id);
821+
bindings += 1;
822+
}
823+
if !used {
824+
let msg = if bindings == 1 {
825+
"variable does not need to be mutable"
826+
} else {
827+
"variables do not need to be mutable"
828+
};
829+
cx.span_lint(unused_mut, p.span, msg);
836830
}
837831
}
832+
do ast_util::walk_pat(p) |pat| {
833+
match pat.node {
834+
ast::PatIdent(ast::BindByValue(ast::MutMutable), _, _) => {
835+
check_unused_mut_pat_inner(cx, pat);
836+
}
837+
_ => {}
838+
}
839+
840+
true
841+
};
838842
}
839843

840844
fn check_unnecessary_allocation(cx: &Context, e: &ast::Expr) {
@@ -1075,6 +1079,8 @@ impl Visitor<()> for Context {
10751079

10761080
fn visit_pat(&mut self, p: @ast::Pat, _: ()) {
10771081
check_pat_non_uppercase_statics(self, p);
1082+
check_unused_mut_pat(self, p);
1083+
10781084
visit::walk_pat(self, p, ());
10791085
}
10801086

@@ -1095,30 +1101,9 @@ impl Visitor<()> for Context {
10951101
visit::walk_stmt(self, s, ());
10961102
}
10971103

1098-
fn visit_ty_method(&mut self, tm: &ast::TypeMethod, _: ()) {
1099-
check_unused_mut_fn_decl(self, &tm.decl);
1100-
visit::walk_ty_method(self, tm, ());
1101-
}
1102-
1103-
fn visit_trait_method(&mut self, tm: &ast::trait_method, _: ()) {
1104-
match *tm {
1105-
ast::required(ref m) => check_unused_mut_fn_decl(self, &m.decl),
1106-
ast::provided(ref m) => check_unused_mut_fn_decl(self, &m.decl)
1107-
}
1108-
visit::walk_trait_method(self, tm, ());
1109-
}
1110-
1111-
fn visit_local(&mut self, l: @ast::Local, _: ()) {
1112-
if l.is_mutbl {
1113-
check_unused_mut_pat(self, l.pat);
1114-
}
1115-
visit::walk_local(self, l, ());
1116-
}
1117-
11181104
fn visit_fn(&mut self, fk: &visit::fn_kind, decl: &ast::fn_decl,
11191105
body: &ast::Block, span: Span, id: ast::NodeId, _: ()) {
11201106
let recurse = |this: &mut Context| {
1121-
check_unused_mut_fn_decl(this, decl);
11221107
visit::walk_fn(this, fk, decl, body, span, id, ());
11231108
};
11241109

branches/dist-snap/src/librustc/middle/liveness.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,18 +429,22 @@ fn visit_fn(v: &mut LivenessVisitor,
429429

430430
fn visit_local(v: &mut LivenessVisitor, local: @Local, this: @mut IrMaps) {
431431
let def_map = this.tcx.def_map;
432-
do pat_util::pat_bindings(def_map, local.pat) |_bm, p_id, sp, path| {
432+
do pat_util::pat_bindings(def_map, local.pat) |bm, p_id, sp, path| {
433433
debug!("adding local variable {}", p_id);
434434
let name = ast_util::path_to_ident(path);
435435
this.add_live_node_for_node(p_id, VarDefNode(sp));
436436
let kind = match local.init {
437437
Some(_) => FromLetWithInitializer,
438438
None => FromLetNoInitializer
439439
};
440+
let mutbl = match bm {
441+
BindByValue(MutMutable) => true,
442+
_ => false
443+
};
440444
this.add_variable(Local(LocalInfo {
441445
id: p_id,
442446
ident: name,
443-
is_mutbl: local.is_mutbl,
447+
is_mutbl: mutbl,
444448
kind: kind
445449
}));
446450
}
@@ -454,11 +458,15 @@ fn visit_arm(v: &mut LivenessVisitor, arm: &Arm, this: @mut IrMaps) {
454458
debug!("adding local variable {} from match with bm {:?}",
455459
p_id, bm);
456460
let name = ast_util::path_to_ident(path);
461+
let mutbl = match bm {
462+
BindByValue(MutMutable) => true,
463+
_ => false
464+
};
457465
this.add_live_node_for_node(p_id, VarDefNode(sp));
458466
this.add_variable(Local(LocalInfo {
459467
id: p_id,
460468
ident: name,
461-
is_mutbl: false,
469+
is_mutbl: mutbl,
462470
kind: FromMatch(bm)
463471
}));
464472
}

branches/dist-snap/src/librustc/middle/mem_categorization.rs

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -473,12 +473,15 @@ impl mem_categorization_ctxt {
473473
}
474474
}
475475

476-
ast::DefArg(vid, mutbl) => {
476+
ast::DefArg(vid, binding_mode) => {
477477
// Idea: make this could be rewritten to model by-ref
478478
// stuff as `&const` and `&mut`?
479479

480480
// m: mutability of the argument
481-
let m = if mutbl {McDeclared} else {McImmutable};
481+
let m = match binding_mode {
482+
ast::BindByValue(ast::MutMutable) => McDeclared,
483+
_ => McImmutable
484+
};
482485
@cmt_ {
483486
id: id,
484487
span: span,
@@ -548,25 +551,20 @@ impl mem_categorization_ctxt {
548551
}
549552
}
550553

551-
ast::DefLocal(vid, mutbl) => {
552-
let m = if mutbl {McDeclared} else {McImmutable};
553-
@cmt_ {
554-
id:id,
555-
span:span,
556-
cat:cat_local(vid),
557-
mutbl:m,
558-
ty:expr_ty
559-
}
560-
}
561-
562-
ast::DefBinding(vid, _) => {
554+
ast::DefLocal(vid, binding_mode) |
555+
ast::DefBinding(vid, binding_mode) => {
563556
// by-value/by-ref bindings are local variables
557+
let m = match binding_mode {
558+
ast::BindByValue(ast::MutMutable) => McDeclared,
559+
_ => McImmutable
560+
};
561+
564562
@cmt_ {
565-
id:id,
566-
span:span,
567-
cat:cat_local(vid),
568-
mutbl:McImmutable,
569-
ty:expr_ty
563+
id: id,
564+
span: span,
565+
cat: cat_local(vid),
566+
mutbl: m,
567+
ty: expr_ty
570568
}
571569
}
572570
}

branches/dist-snap/src/librustc/middle/moves.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ impl VisitContext {
618618
do pat_bindings(self.tcx.def_map, pat) |bm, id, _span, path| {
619619
let binding_moves = match bm {
620620
BindByRef(_) => false,
621-
BindInfer => {
621+
BindByValue(_) => {
622622
let pat_ty = ty::node_id_to_type(self.tcx, id);
623623
debug!("pattern {:?} {} type is {}",
624624
id,

0 commit comments

Comments
 (0)