Skip to content

Commit 34b8088

Browse files
committed
---
yaml --- r: 95067 b: refs/heads/dist-snap c: f6df7ab h: refs/heads/master i: 95065: 29ae59f 95063: d5039a7 v: v3
1 parent fdb9a7e commit 34b8088

37 files changed

+368
-295
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: 350b5438cd0b2a9ed33c0cdb1b36d7e4cbe1ab2b
9+
refs/heads/dist-snap: f6df7ab839fef099af163463ae99b9541d3d12c5
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/mk/tests.mk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,15 @@ tidy:
261261
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
262262
$(Q)echo $(ALL_HS) \
263263
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
264+
$(Q)find $(S)src -type f -perm +111 \
265+
-not -name '*.rs' -and -not -name '*.py' \
266+
-and -not -name '*.sh' \
267+
| grep '^$(S)src/llvm' -v \
268+
| grep '^$(S)src/libuv' -v \
269+
| grep '^$(S)src/gyp' -v \
270+
| grep '^$(S)src/etc' -v \
271+
| grep '^$(S)src/rt/jemalloc' -v \
272+
| xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
264273

265274
endif
266275

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
# file at the top-level directory of this distribution and at
3+
# http://rust-lang.org/COPYRIGHT.
4+
#
5+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
# option. This file may not be copied, modified, or distributed
9+
# except according to those terms.
10+
11+
import sys
12+
13+
offenders = sys.argv[1:]
14+
if len(offenders) > 0:
15+
print("Binaries checked into src:")
16+
for offender in offenders:
17+
print(offender)
18+
sys.exit(1)

branches/dist-snap/src/librustc/metadata/encoder.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ fn encode_crate_deps(ecx: &EncodeContext,
15741574
fn encode_lang_items(ecx: &EncodeContext, ebml_w: &mut writer::Encoder) {
15751575
ebml_w.start_tag(tag_lang_items);
15761576

1577-
do ecx.tcx.lang_items.each_item |def_id, i| {
1577+
for (i, def_id) in ecx.tcx.lang_items.items() {
15781578
for id in def_id.iter() {
15791579
if id.crate == LOCAL_CRATE {
15801580
ebml_w.start_tag(tag_lang_items_item);
@@ -1590,8 +1590,7 @@ fn encode_lang_items(ecx: &EncodeContext, ebml_w: &mut writer::Encoder) {
15901590
ebml_w.end_tag(); // tag_lang_items_item
15911591
}
15921592
}
1593-
true
1594-
};
1593+
}
15951594

15961595
ebml_w.end_tag(); // tag_lang_items
15971596
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub fn check_arms(cx: &MatchCheckCtxt, arms: &[Arm]) {
121121
for pat in arm.pats.iter() {
122122

123123
// Check that we do not match against a static NaN (#6804)
124-
let pat_matches_nan: &fn(@Pat) -> bool = |p| {
124+
let pat_matches_nan: &fn(&Pat) -> bool = |p| {
125125
match cx.tcx.def_map.find(&p.id) {
126126
Some(&DefStatic(did, false)) => {
127127
let const_expr = lookup_const_by_id(cx.tcx, did).unwrap();
@@ -893,7 +893,7 @@ pub fn check_legality_of_move_bindings(cx: &MatchCheckCtxt,
893893
}
894894
}
895895

896-
let check_move: &fn(@Pat, Option<@Pat>) = |p, sub| {
896+
let check_move: &fn(&Pat, Option<@Pat>) = |p, sub| {
897897
// check legality of moving out of the enum
898898

899899
// x @ Foo(*) is legal, but x @ Foo(y) isn't.

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
422422
}
423423

424424
fn walk_expr(&mut self,
425-
expr: @ast::Expr,
425+
expr: &ast::Expr,
426426
in_out: &mut [uint],
427427
loop_scopes: &mut ~[LoopScope]) {
428428
debug!("DataFlowContext::walk_expr(expr=%s, in_out=%s)",
@@ -744,7 +744,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
744744
}
745745

746746
fn pop_scopes(&mut self,
747-
from_expr: @ast::Expr,
747+
from_expr: &ast::Expr,
748748
to_scope: &mut LoopScope,
749749
in_out: &mut [uint]) {
750750
//! Whenever you have a `break` or a `loop` statement, flow
@@ -778,7 +778,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
778778
}
779779

780780
fn break_from_to(&mut self,
781-
from_expr: @ast::Expr,
781+
from_expr: &ast::Expr,
782782
to_scope: &mut LoopScope,
783783
in_out: &mut [uint]) {
784784
self.pop_scopes(from_expr, to_scope, in_out);
@@ -811,7 +811,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
811811
fn walk_call(&mut self,
812812
_callee_id: ast::NodeId,
813813
call_id: ast::NodeId,
814-
arg0: @ast::Expr,
814+
arg0: &ast::Expr,
815815
args: &[@ast::Expr],
816816
in_out: &mut [uint],
817817
loop_scopes: &mut ~[LoopScope]) {
@@ -865,7 +865,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
865865
}
866866

867867
fn find_scope<'a>(&self,
868-
expr: @ast::Expr,
868+
expr: &ast::Expr,
869869
label: Option<ast::Name>,
870870
loop_scopes: &'a mut ~[LoopScope]) -> &'a mut LoopScope {
871871
let index = match label {
@@ -899,7 +899,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
899899
&mut loop_scopes[index]
900900
}
901901

902-
fn is_method_call(&self, expr: @ast::Expr) -> bool {
902+
fn is_method_call(&self, expr: &ast::Expr) -> bool {
903903
self.dfcx.method_map.contains_key(&expr.id)
904904
}
905905

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

Lines changed: 50 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ use syntax::visit;
3232
use syntax::visit::Visitor;
3333

3434
use std::hashmap::HashMap;
35+
use std::iter::Enumerate;
36+
use std::vec;
3537

3638
pub enum LangItem {
3739
FreezeTraitLangItem, // 0
@@ -92,8 +94,8 @@ impl LanguageItems {
9294
}
9395
}
9496

95-
pub fn each_item(&self, f: &fn(Option<DefId>, uint) -> bool) -> bool {
96-
self.items.iter().enumerate().advance(|(i, &item)| f(item, i))
97+
pub fn items<'a>(&'a self) -> Enumerate<vec::VecIterator<'a, Option<DefId>>> {
98+
self.items.iter().enumerate()
9799
}
98100

99101
pub fn item_name(index: uint) -> &'static str {
@@ -298,7 +300,7 @@ struct LanguageItemCollector<'self> {
298300
crate: &'self Crate,
299301
session: Session,
300302

301-
item_refs: HashMap<@str, uint>,
303+
item_refs: HashMap<&'static str, uint>,
302304
}
303305

304306
struct LanguageItemVisitor<'self> {
@@ -327,51 +329,51 @@ impl<'self> LanguageItemCollector<'self> {
327329
-> LanguageItemCollector<'a> {
328330
let mut item_refs = HashMap::new();
329331

330-
item_refs.insert(@"freeze", FreezeTraitLangItem as uint);
331-
item_refs.insert(@"send", SendTraitLangItem as uint);
332-
item_refs.insert(@"sized", SizedTraitLangItem as uint);
333-
334-
item_refs.insert(@"drop", DropTraitLangItem as uint);
335-
336-
item_refs.insert(@"add", AddTraitLangItem as uint);
337-
item_refs.insert(@"sub", SubTraitLangItem as uint);
338-
item_refs.insert(@"mul", MulTraitLangItem as uint);
339-
item_refs.insert(@"div", DivTraitLangItem as uint);
340-
item_refs.insert(@"rem", RemTraitLangItem as uint);
341-
item_refs.insert(@"neg", NegTraitLangItem as uint);
342-
item_refs.insert(@"not", NotTraitLangItem as uint);
343-
item_refs.insert(@"bitxor", BitXorTraitLangItem as uint);
344-
item_refs.insert(@"bitand", BitAndTraitLangItem as uint);
345-
item_refs.insert(@"bitor", BitOrTraitLangItem as uint);
346-
item_refs.insert(@"shl", ShlTraitLangItem as uint);
347-
item_refs.insert(@"shr", ShrTraitLangItem as uint);
348-
item_refs.insert(@"index", IndexTraitLangItem as uint);
349-
350-
item_refs.insert(@"eq", EqTraitLangItem as uint);
351-
item_refs.insert(@"ord", OrdTraitLangItem as uint);
352-
353-
item_refs.insert(@"str_eq", StrEqFnLangItem as uint);
354-
item_refs.insert(@"uniq_str_eq", UniqStrEqFnLangItem as uint);
355-
item_refs.insert(@"fail_", FailFnLangItem as uint);
356-
item_refs.insert(@"fail_bounds_check",
332+
item_refs.insert("freeze", FreezeTraitLangItem as uint);
333+
item_refs.insert("send", SendTraitLangItem as uint);
334+
item_refs.insert("sized", SizedTraitLangItem as uint);
335+
336+
item_refs.insert("drop", DropTraitLangItem as uint);
337+
338+
item_refs.insert("add", AddTraitLangItem as uint);
339+
item_refs.insert("sub", SubTraitLangItem as uint);
340+
item_refs.insert("mul", MulTraitLangItem as uint);
341+
item_refs.insert("div", DivTraitLangItem as uint);
342+
item_refs.insert("rem", RemTraitLangItem as uint);
343+
item_refs.insert("neg", NegTraitLangItem as uint);
344+
item_refs.insert("not", NotTraitLangItem as uint);
345+
item_refs.insert("bitxor", BitXorTraitLangItem as uint);
346+
item_refs.insert("bitand", BitAndTraitLangItem as uint);
347+
item_refs.insert("bitor", BitOrTraitLangItem as uint);
348+
item_refs.insert("shl", ShlTraitLangItem as uint);
349+
item_refs.insert("shr", ShrTraitLangItem as uint);
350+
item_refs.insert("index", IndexTraitLangItem as uint);
351+
352+
item_refs.insert("eq", EqTraitLangItem as uint);
353+
item_refs.insert("ord", OrdTraitLangItem as uint);
354+
355+
item_refs.insert("str_eq", StrEqFnLangItem as uint);
356+
item_refs.insert("uniq_str_eq", UniqStrEqFnLangItem as uint);
357+
item_refs.insert("fail_", FailFnLangItem as uint);
358+
item_refs.insert("fail_bounds_check",
357359
FailBoundsCheckFnLangItem as uint);
358-
item_refs.insert(@"exchange_malloc", ExchangeMallocFnLangItem as uint);
359-
item_refs.insert(@"closure_exchange_malloc", ClosureExchangeMallocFnLangItem as uint);
360-
item_refs.insert(@"exchange_free", ExchangeFreeFnLangItem as uint);
361-
item_refs.insert(@"malloc", MallocFnLangItem as uint);
362-
item_refs.insert(@"free", FreeFnLangItem as uint);
363-
item_refs.insert(@"borrow_as_imm", BorrowAsImmFnLangItem as uint);
364-
item_refs.insert(@"borrow_as_mut", BorrowAsMutFnLangItem as uint);
365-
item_refs.insert(@"return_to_mut", ReturnToMutFnLangItem as uint);
366-
item_refs.insert(@"check_not_borrowed",
360+
item_refs.insert("exchange_malloc", ExchangeMallocFnLangItem as uint);
361+
item_refs.insert("closure_exchange_malloc", ClosureExchangeMallocFnLangItem as uint);
362+
item_refs.insert("exchange_free", ExchangeFreeFnLangItem as uint);
363+
item_refs.insert("malloc", MallocFnLangItem as uint);
364+
item_refs.insert("free", FreeFnLangItem as uint);
365+
item_refs.insert("borrow_as_imm", BorrowAsImmFnLangItem as uint);
366+
item_refs.insert("borrow_as_mut", BorrowAsMutFnLangItem as uint);
367+
item_refs.insert("return_to_mut", ReturnToMutFnLangItem as uint);
368+
item_refs.insert("check_not_borrowed",
367369
CheckNotBorrowedFnLangItem as uint);
368-
item_refs.insert(@"strdup_uniq", StrDupUniqFnLangItem as uint);
369-
item_refs.insert(@"record_borrow", RecordBorrowFnLangItem as uint);
370-
item_refs.insert(@"unrecord_borrow", UnrecordBorrowFnLangItem as uint);
371-
item_refs.insert(@"start", StartFnLangItem as uint);
372-
item_refs.insert(@"ty_desc", TyDescStructLangItem as uint);
373-
item_refs.insert(@"ty_visitor", TyVisitorTraitLangItem as uint);
374-
item_refs.insert(@"opaque", OpaqueStructLangItem as uint);
370+
item_refs.insert("strdup_uniq", StrDupUniqFnLangItem as uint);
371+
item_refs.insert("record_borrow", RecordBorrowFnLangItem as uint);
372+
item_refs.insert("unrecord_borrow", UnrecordBorrowFnLangItem as uint);
373+
item_refs.insert("start", StartFnLangItem as uint);
374+
item_refs.insert("ty_desc", TyDescStructLangItem as uint);
375+
item_refs.insert("ty_visitor", TyVisitorTraitLangItem as uint);
376+
item_refs.insert("opaque", OpaqueStructLangItem as uint);
375377

376378
LanguageItemCollector {
377379
crate: crate,
@@ -416,8 +418,8 @@ impl<'self> LanguageItemCollector<'self> {
416418
return; // Didn't match.
417419
}
418420

419-
let item_index = self.item_refs.find(&value).map_move(|x| *x);
420-
// prevent borrow checker from considering ^~~~~~~~~~~
421+
let item_index = self.item_refs.find_equiv(&value).map_move(|x| *x);
422+
// prevent borrow checker from considering ^~~~~~~~~~~
421423
// self to be borrowed (annoying)
422424

423425
match item_index {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5363,7 +5363,7 @@ impl Resolver {
53635363
}
53645364

53655365
pub fn enforce_default_binding_mode(&mut self,
5366-
pat: @Pat,
5366+
pat: &Pat,
53675367
pat_binding_mode: BindingMode,
53685368
descr: &str) {
53695369
match pat_binding_mode {

branches/dist-snap/src/librustc/middle/trans/_match.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ fn insert_lllocals(bcx: @mut Block,
13981398
}
13991399

14001400
fn compile_guard(bcx: @mut Block,
1401-
guard_expr: @ast::Expr,
1401+
guard_expr: &ast::Expr,
14021402
data: &ArmData,
14031403
m: &[Match],
14041404
vals: &[ValueRef],
@@ -1826,7 +1826,7 @@ fn compile_submatch_continue(mut bcx: @mut Block,
18261826

18271827
pub fn trans_match(bcx: @mut Block,
18281828
match_expr: &ast::Expr,
1829-
discr_expr: @ast::Expr,
1829+
discr_expr: &ast::Expr,
18301830
arms: &[ast::Arm],
18311831
dest: Dest) -> @mut Block {
18321832
let _icx = push_ctxt("match::trans_match");
@@ -1876,7 +1876,7 @@ fn create_bindings_map(bcx: @mut Block, pat: @ast::Pat) -> BindingsMap {
18761876
}
18771877

18781878
fn trans_match_inner(scope_cx: @mut Block,
1879-
discr_expr: @ast::Expr,
1879+
discr_expr: &ast::Expr,
18801880
arms: &[ast::Arm],
18811881
dest: Dest) -> @mut Block {
18821882
let _icx = push_ctxt("match::trans_match_inner");

branches/dist-snap/src/librustc/middle/trans/base.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,13 +1121,13 @@ pub fn do_spill_noroot(cx: @mut Block, v: ValueRef) -> ValueRef {
11211121

11221122
pub fn spill_if_immediate(cx: @mut Block, v: ValueRef, t: ty::t) -> ValueRef {
11231123
let _icx = push_ctxt("spill_if_immediate");
1124-
if ty::type_is_immediate(cx.tcx(), t) { return do_spill(cx, v, t); }
1124+
if type_is_immediate(cx.tcx(), t) { return do_spill(cx, v, t); }
11251125
return v;
11261126
}
11271127

11281128
pub fn load_if_immediate(cx: @mut Block, v: ValueRef, t: ty::t) -> ValueRef {
11291129
let _icx = push_ctxt("load_if_immediate");
1130-
if ty::type_is_immediate(cx.tcx(), t) { return Load(cx, v); }
1130+
if type_is_immediate(cx.tcx(), t) { return Load(cx, v); }
11311131
return v;
11321132
}
11331133

@@ -1407,7 +1407,10 @@ pub fn cleanup_and_leave(bcx: @mut Block,
14071407
}
14081408
match leave {
14091409
Some(target) => Br(bcx, target),
1410-
None => { Resume(bcx, Load(bcx, bcx.fcx.personality.unwrap())); }
1410+
None => {
1411+
let ll_load = Load(bcx, bcx.fcx.personality.unwrap());
1412+
Resume(bcx, ll_load);
1413+
}
14111414
}
14121415
}
14131416

@@ -2485,7 +2488,7 @@ pub fn item_path(ccx: &CrateContext, id: &ast::NodeId) -> path {
24852488
ty::item_path(ccx.tcx, ast_util::local_def(*id))
24862489
}
24872490

2488-
fn exported_name(ccx: @mut CrateContext, path: path, ty: ty::t, attrs: &[ast::Attribute]) -> ~str {
2491+
fn exported_name(ccx: &mut CrateContext, path: path, ty: ty::t, attrs: &[ast::Attribute]) -> ~str {
24892492
match attr::first_attr_value_str_by_name(attrs, "export_name") {
24902493
// Use provided name
24912494
Some(name) => name.to_owned(),
@@ -2979,7 +2982,7 @@ pub fn decl_crate_map(sess: session::Session, mapmeta: LinkMeta,
29792982
return map;
29802983
}
29812984

2982-
pub fn fill_crate_map(ccx: @mut CrateContext, map: ValueRef) {
2985+
pub fn fill_crate_map(ccx: &mut CrateContext, map: ValueRef) {
29832986
let mut subcrates: ~[ValueRef] = ~[];
29842987
let mut i = 1;
29852988
let cstore = ccx.sess.cstore;
@@ -3030,7 +3033,7 @@ pub fn crate_ctxt_to_encode_parms<'r>(cx: &'r CrateContext, ie: encoder::encode_
30303033
}
30313034
}
30323035

3033-
pub fn write_metadata(cx: &mut CrateContext, crate: &ast::Crate) {
3036+
pub fn write_metadata(cx: &CrateContext, crate: &ast::Crate) {
30343037
if !*cx.sess.building_library { return; }
30353038

30363039
let encode_inlined_item: encoder::encode_inlined_item =

0 commit comments

Comments
 (0)