Skip to content

Commit f2a2882

Browse files
committed
---
yaml --- r: 231782 b: refs/heads/auto c: 7ee876c h: refs/heads/master v: v3
1 parent 09e0b63 commit f2a2882

File tree

8 files changed

+152
-185
lines changed

8 files changed

+152
-185
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: 67aa4c775ac90342440bb5f2af3b023d3c0f3042
11+
refs/heads/auto: 7ee876cb8e0e3308669d3e00faa3ffe1034ca562
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/configure

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,16 +1180,27 @@ do
11801180
# MSVC requires cmake because that's how we're going to build LLVM
11811181
probe_need CFG_CMAKE cmake
11821182

1183+
# There are three builds of cmake on windows: MSVC, MinGW and Cygwin
1184+
# The Cygwin build does not have generators for Visual Studio, so
1185+
# detect that here and error.
1186+
if ! "$CFG_CMAKE" --help | sed -n '/^Generators/,$p' | grep 'Visual Studio' > /dev/null
1187+
then
1188+
err "cmake does not support Visual Studio generators.\n\n \
1189+
This is likely due to it being an msys/cygwin build of cmake, \
1190+
rather than the required windows version, built using MinGW \
1191+
or Visual Studio."
1192+
fi
1193+
11831194
# Use the REG program to figure out where VS is installed
11841195
# We need to figure out where cl.exe and link.exe are, so we do some
11851196
# munging and some probing here. We also look for the default
11861197
# INCLUDE and LIB variables for MSVC so we can set those in the
11871198
# build system as well.
1188-
install=$(reg QUERY \
1199+
install=$(cmd //c reg QUERY \
11891200
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0' \
11901201
-v InstallDir)
11911202
if [ -z "$install" ]; then
1192-
install=$(reg QUERY \
1203+
install=$(cmd //c reg QUERY \
11931204
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0' \
11941205
-v InstallDir)
11951206
fi
@@ -1222,9 +1233,9 @@ do
12221233
eval CFG_MSVC_LINK_$bits="\"$bindir/link.exe\""
12231234

12241235
vcvarsall="${CFG_MSVC_ROOT}/VC/vcvarsall.bat"
1225-
include_path=$(cmd /c "\"$vcvarsall\" $msvc_part && cmd /c echo %INCLUDE%")
1236+
include_path=$(cmd //V:ON //c "$vcvarsall" $msvc_part \& echo !INCLUDE!)
12261237
need_ok "failed to learn about MSVC's INCLUDE"
1227-
lib_path=$(cmd /c "\"$vcvarsall\" $msvc_part && cmd /c echo %LIB%")
1238+
lib_path=$(cmd //V:ON //c "$vcvarsall" $msvc_part \& echo !LIB!)
12281239
need_ok "failed to learn about MSVC's LIB"
12291240

12301241
eval CFG_MSVC_INCLUDE_PATH_${bits}="\"$include_path\""

branches/auto/src/libcore/array.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
integer constants",
2020
issue = "27778")]
2121

22+
use borrow::{Borrow, BorrowMut};
2223
use clone::Clone;
2324
use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
2425
use convert::{AsRef, AsMut};
@@ -70,6 +71,20 @@ macro_rules! array_impls {
7071
}
7172
}
7273

74+
#[stable(feature = "array_borrow", since = "1.4.0")]
75+
impl<T> Borrow<[T]> for [T; $N] {
76+
fn borrow(&self) -> &[T] {
77+
self
78+
}
79+
}
80+
81+
#[stable(feature = "array_borrow", since = "1.4.0")]
82+
impl<T> BorrowMut<[T]> for [T; $N] {
83+
fn borrow_mut(&mut self) -> &mut [T] {
84+
self
85+
}
86+
}
87+
7388
#[stable(feature = "rust1", since = "1.0.0")]
7489
impl<T:Copy> Clone for [T; $N] {
7590
fn clone(&self) -> [T; $N] {

branches/auto/src/librustc/middle/traits/object_safety.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,13 @@ fn object_safety_violations_for_trait<'tcx>(tcx: &ty::ctxt<'tcx>,
9292
// Check methods for violations.
9393
let mut violations: Vec<_> =
9494
tcx.trait_items(trait_def_id).iter()
95-
.flat_map(|item| {
95+
.filter_map(|item| {
9696
match *item {
9797
ty::MethodTraitItem(ref m) => {
9898
object_safety_violation_for_method(tcx, trait_def_id, &**m)
9999
.map(|code| ObjectSafetyViolation::Method(m.clone(), code))
100-
.into_iter()
101100
}
102-
_ => None.into_iter(),
101+
_ => None,
103102
}
104103
})
105104
.collect();

branches/auto/src/librustc_trans/save/dump_csv.rs

Lines changed: 47 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -71,30 +71,29 @@ pub struct DumpCsvVisitor<'l, 'tcx: 'l> {
7171
span: SpanUtils<'l>,
7272
fmt: FmtStrs<'l>,
7373

74-
cur_scope: NodeId
74+
cur_scope: NodeId,
7575
}
7676

7777
impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
7878
pub fn new(tcx: &'l ty::ctxt<'tcx>,
7979
analysis: &'l ty::CrateAnalysis,
80-
output_file: Box<File>) -> DumpCsvVisitor<'l, 'tcx> {
80+
output_file: Box<File>)
81+
-> DumpCsvVisitor<'l, 'tcx> {
8182
let span_utils = SpanUtils::new(&tcx.sess);
8283
DumpCsvVisitor {
8384
sess: &tcx.sess,
8485
tcx: tcx,
8586
save_ctxt: SaveContext::from_span_utils(tcx, span_utils.clone()),
8687
analysis: analysis,
8788
span: span_utils.clone(),
88-
fmt: FmtStrs::new(box Recorder {
89-
out: output_file,
90-
dump_spans: false,
91-
}, span_utils),
92-
cur_scope: 0
89+
fmt: FmtStrs::new(box Recorder { out: output_file, dump_spans: false },
90+
span_utils),
91+
cur_scope: 0,
9392
}
9493
}
9594

96-
fn nest<F>(&mut self, scope_id: NodeId, f: F) where
97-
F: FnOnce(&mut DumpCsvVisitor<'l, 'tcx>),
95+
fn nest<F>(&mut self, scope_id: NodeId, f: F)
96+
where F: FnOnce(&mut DumpCsvVisitor<'l, 'tcx>)
9897
{
9998
let parent_scope = self.cur_scope;
10099
self.cur_scope = scope_id;
@@ -140,9 +139,11 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
140139
let mut segs = vec!();
141140
for (i, (seg, span)) in path.segments.iter().zip(&spans).enumerate() {
142141
segs.push(seg.clone());
143-
let sub_path = ast::Path{span: *span, // span for the last segment
144-
global: path.global,
145-
segments: segs};
142+
let sub_path = ast::Path {
143+
span: *span, // span for the last segment
144+
global: path.global,
145+
segments: segs,
146+
};
146147
let qualname = if i == 0 && path.global {
147148
format!("::{}", path_to_string(&sub_path))
148149
} else {
@@ -271,7 +272,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
271272
def::DefPrimTy(_) => {
272273
self.sess.span_bug(span, &format!("lookup_def_kind for unexpected item: {:?}",
273274
def));
274-
},
275+
}
275276
}
276277
}
277278

@@ -357,9 +358,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
357358
}
358359
}
359360

360-
fn process_struct_field_def(&mut self,
361-
field: &ast::StructField,
362-
parent_id: NodeId) {
361+
fn process_struct_field_def(&mut self, field: &ast::StructField, parent_id: NodeId) {
363362
let field_data = self.save_ctxt.get_field_data(field, parent_id);
364363
if let Some(field_data) = field_data {
365364
self.fmt.field_str(field.span,
@@ -374,7 +373,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
374373

375374
// Dump generic params bindings, then visit_generics
376375
fn process_generic_params(&mut self,
377-
generics:&ast::Generics,
376+
generics: &ast::Generics,
378377
full_span: Span,
379378
prefix: &str,
380379
id: NodeId) {
@@ -427,11 +426,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
427426
self.nest(item.id, |v| v.visit_block(&body));
428427
}
429428

430-
fn process_static_or_const_item(&mut self,
431-
item: &ast::Item,
432-
typ: &ast::Ty,
433-
expr: &ast::Expr)
434-
{
429+
fn process_static_or_const_item(&mut self, item: &ast::Item, typ: &ast::Ty, expr: &ast::Expr) {
435430
let var_data = self.save_ctxt.get_item_data(item);
436431
down_cast_data!(var_data, VariableData, self, item.span);
437432
self.fmt.static_str(item.span,
@@ -452,8 +447,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
452447
ident: &ast::Ident,
453448
span: Span,
454449
typ: &ast::Ty,
455-
expr: &ast::Expr)
456-
{
450+
expr: &ast::Expr) {
457451
let qualname = format!("::{}", self.tcx.map.path_to_string(id));
458452

459453
let sub_span = self.span.sub_span_after_keyword(span,
@@ -641,8 +635,8 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
641635
sub_span,
642636
id,
643637
item.id);
644-
},
645-
None => ()
638+
}
639+
None => (),
646640
}
647641
}
648642

@@ -653,8 +647,8 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
653647
}
654648
}
655649

656-
fn process_mod(&mut self,
657-
item: &ast::Item) { // The module in question, represented as an item.
650+
// `item` is the module in question, represented as an item.
651+
fn process_mod(&mut self, item: &ast::Item) {
658652
let mod_data = self.save_ctxt.get_item_data(item);
659653
down_cast_data!(mod_data, ModData, self, item.span);
660654
self.fmt.mod_str(item.span,
@@ -665,10 +659,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
665659
&mod_data.filename);
666660
}
667661

668-
fn process_path(&mut self,
669-
id: NodeId,
670-
path: &ast::Path,
671-
ref_kind: Option<recorder::Row>) {
662+
fn process_path(&mut self, id: NodeId, path: &ast::Path, ref_kind: Option<recorder::Row>) {
672663
if generated_code(path.span) {
673664
return;
674665
}
@@ -737,7 +728,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
737728
def::DefStruct(_) |
738729
def::DefVariant(..) |
739730
def::DefFn(..) => self.write_sub_paths_truncated(path, false),
740-
_ => {},
731+
_ => {}
741732
}
742733
}
743734

@@ -783,9 +774,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
783774
visit::walk_expr_opt(self, base)
784775
}
785776

786-
fn process_method_call(&mut self,
787-
ex: &ast::Expr,
788-
args: &Vec<P<ast::Expr>>) {
777+
fn process_method_call(&mut self, ex: &ast::Expr, args: &Vec<P<ast::Expr>>) {
789778
if let Some(call_data) = self.save_ctxt.get_expr_data(ex) {
790779
down_cast_data!(call_data, MethodCallData, self, ex.span);
791780
self.fmt.meth_call_str(ex.span,
@@ -799,7 +788,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
799788
visit::walk_exprs(self, &args);
800789
}
801790

802-
fn process_pat(&mut self, p:&ast::Pat) {
791+
fn process_pat(&mut self, p: &ast::Pat) {
803792
if generated_code(p.span) {
804793
return;
805794
}
@@ -827,7 +816,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
827816
self.visit_pat(&field.pat);
828817
}
829818
}
830-
_ => visit::walk_pat(self, p)
819+
_ => visit::walk_pat(self, p),
831820
}
832821
}
833822
}
@@ -851,10 +840,10 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
851840
sub_span,
852841
def_id,
853842
self.cur_scope),
854-
None => {},
843+
None => {}
855844
}
856845
Some(def_id)
857-
},
846+
}
858847
None => None,
859848
};
860849

@@ -902,20 +891,19 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
902891
match plid.node {
903892
ast::PathListIdent { id, .. } => {
904893
match self.lookup_type_ref(id) {
905-
Some(def_id) =>
906-
match self.lookup_def_kind(id, plid.span) {
907-
Some(kind) => {
908-
self.fmt.ref_str(
894+
Some(def_id) => match self.lookup_def_kind(id, plid.span) {
895+
Some(kind) => {
896+
self.fmt.ref_str(
909897
kind, plid.span,
910898
Some(plid.span),
911899
def_id, self.cur_scope);
912-
}
913-
None => ()
914-
},
915-
None => ()
900+
}
901+
None => (),
902+
},
903+
None => (),
916904
}
917-
},
918-
ast::PathListMod { .. } => ()
905+
}
906+
ast::PathListMod { .. } => (),
919907
}
920908
}
921909

@@ -978,7 +966,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
978966

979967
self.visit_ty(&**ty);
980968
self.process_generic_params(ty_params, item.span, &qualname, item.id);
981-
},
969+
}
982970
ast::ItemMac(_) => (),
983971
_ => visit::walk_item(self, item),
984972
}
@@ -1048,14 +1036,14 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
10481036
sub_span,
10491037
id,
10501038
self.cur_scope);
1051-
},
1052-
None => ()
1039+
}
1040+
None => (),
10531041
}
10541042

10551043
self.write_sub_paths_truncated(path, false);
10561044

10571045
visit::walk_path(self, path);
1058-
},
1046+
}
10591047
_ => visit::walk_ty(self, t),
10601048
}
10611049
}
@@ -1101,7 +1089,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
11011089
field_data.ref_id,
11021090
field_data.scope);
11031091
}
1104-
},
1092+
}
11051093
ast::ExprTupField(ref sub_ex, idx) => {
11061094
if generated_code(sub_ex.span) {
11071095
return
@@ -1125,7 +1113,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
11251113
&format!("Expected struct or tuple \
11261114
type, found {:?}", ty)),
11271115
}
1128-
},
1116+
}
11291117
ast::ExprClosure(_, ref decl, ref body) => {
11301118
if generated_code(body.span) {
11311119
return
@@ -1146,7 +1134,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
11461134

11471135
// walk the body
11481136
self.nest(ex.id, |v| v.visit_block(&**body));
1149-
},
1137+
}
11501138
_ => {
11511139
visit::walk_expr(self, ex)
11521140
}
@@ -1182,7 +1170,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
11821170
}
11831171
let def = def_map.get(&id).unwrap().full_def();
11841172
match def {
1185-
def::DefLocal(id) => {
1173+
def::DefLocal(id) => {
11861174
let value = if immut == ast::MutImmutable {
11871175
self.span.snippet(p.span).to_string()
11881176
} else {
@@ -1205,7 +1193,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
12051193
def::DefConst(..) |
12061194
def::DefAssociatedConst(..) => {}
12071195
_ => error!("unexpected definition kind when processing collected paths: {:?}",
1208-
def)
1196+
def),
12091197
}
12101198
}
12111199

0 commit comments

Comments
 (0)