Skip to content

Commit 735ce33

Browse files
committed
---
yaml --- r: 193787 b: refs/heads/beta c: d66d0b3 h: refs/heads/master i: 193785: 4391add 193783: a98e7ac v: v3
1 parent 63a7d4a commit 735ce33

File tree

22 files changed

+255
-214
lines changed

22 files changed

+255
-214
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 7130c75e4612f9c91652e4472a66fe7573224df8
34+
refs/heads/beta: d66d0b3ac2e45071e40f0e2f3d38aec85cd3c941
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,11 +823,11 @@ then
823823
LLVM_VERSION=$($LLVM_CONFIG --version)
824824

825825
case $LLVM_VERSION in
826-
(3.[2-6]*)
826+
(3.[5-6]*)
827827
msg "found ok version of LLVM: $LLVM_VERSION"
828828
;;
829829
(*)
830-
err "bad LLVM version: $LLVM_VERSION, need >=3.0svn"
830+
err "bad LLVM version: $LLVM_VERSION, need >=3.5"
831831
;;
832832
esac
833833
fi

branches/beta/mk/main.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version)
290290
LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir)
291291
LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir)
292292
LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir)
293+
LLVM_LIBDIR_RUSTFLAGS_$(1)=-L "$$(LLVM_LIBDIR_$(1))"
293294
LLVM_LIBS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libs $$(LLVM_COMPONENTS))
294295
LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags)
295296
# On FreeBSD, it may search wrong headers (that are for pre-installed LLVM),

branches/beta/mk/target.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
8484
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) \
8585
$$(RUST_LIB_FLAGS_ST$(1)) \
8686
-L "$$(RT_OUTPUT_DIR_$(2))" \
87-
-L "$$(LLVM_LIBDIR_$(2))" \
87+
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
8888
$$(LLVM_STDCPP_RUSTFLAGS_$(2)) \
8989
$$(RUSTFLAGS_$(4)) \
9090
--out-dir $$(@D) \

branches/beta/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
372372
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
373373
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
374374
-L "$$(RT_OUTPUT_DIR_$(2))" \
375-
-L "$$(LLVM_LIBDIR_$(2))" \
375+
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
376376
$$(RUSTFLAGS_$(4))
377377

378378
endef

branches/beta/src/doc/trpl/concurrency.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ fn main() {
339339
});
340340
}
341341
342-
rx.recv().ok().expect("Could not recieve answer");
342+
rx.recv().ok().expect("Could not receive answer");
343343
}
344344
```
345345

branches/beta/src/doc/trpl/method-syntax.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ impl CircleBuilder {
187187
}
188188
189189
fn coordinate(&mut self, coordinate: f64) -> &mut CircleBuilder {
190-
self.coordinate = coordinate;
191-
self
190+
self.coordinate = coordinate;
191+
self
192192
}
193193
194194
fn radius(&mut self, radius: f64) -> &mut CircleBuilder {
195-
self.radius = radius;
196-
self
195+
self.radius = radius;
196+
self
197197
}
198198
199199
fn finalize(&self) -> Circle {

branches/beta/src/librustc/middle/check_match.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ fn is_useful(cx: &MatchCheckCtxt,
646646
if rows[0].len() == 0 {
647647
return NotUseful;
648648
}
649+
assert!(rows.iter().all(|r| r.len() == v.len()));
649650
let real_pat = match rows.iter().find(|r| (*r)[0].id != DUMMY_NODE_ID) {
650651
Some(r) => raw_pat(r[0]),
651652
None if v.len() == 0 => return NotUseful,
@@ -654,7 +655,12 @@ fn is_useful(cx: &MatchCheckCtxt,
654655
let left_ty = if real_pat.id == DUMMY_NODE_ID {
655656
ty::mk_nil(cx.tcx)
656657
} else {
657-
ty::pat_ty(cx.tcx, &*real_pat)
658+
let left_ty = ty::pat_ty(cx.tcx, &*real_pat);
659+
660+
match real_pat.node {
661+
ast::PatIdent(ast::BindByRef(..), _, _) => ty::deref(left_ty, false).unwrap().ty,
662+
_ => left_ty,
663+
}
658664
};
659665

660666
let max_slice_length = rows.iter().filter_map(|row| match row[0].node {

branches/beta/src/librustc/middle/dead.rs

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ struct MarkSymbolVisitor<'a, 'tcx: 'a> {
4747
struct_has_extern_repr: bool,
4848
ignore_non_const_paths: bool,
4949
inherited_pub_visibility: bool,
50-
ignore_variant_stack: Vec<ast::NodeId>,
5150
}
5251

5352
impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
@@ -60,7 +59,6 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
6059
struct_has_extern_repr: false,
6160
ignore_non_const_paths: false,
6261
inherited_pub_visibility: false,
63-
ignore_variant_stack: vec![],
6462
}
6563
}
6664

@@ -81,9 +79,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
8179
def::DefPrimTy(_) => (),
8280
def::DefVariant(enum_id, variant_id, _) => {
8381
self.check_def_id(enum_id);
84-
if !self.ignore_variant_stack.contains(&variant_id.node) {
85-
self.check_def_id(variant_id);
86-
}
82+
self.check_def_id(variant_id);
8783
}
8884
_ => {
8985
self.check_def_id(def.def_id());
@@ -282,23 +278,6 @@ impl<'a, 'tcx, 'v> Visitor<'v> for MarkSymbolVisitor<'a, 'tcx> {
282278
visit::walk_expr(self, expr);
283279
}
284280

285-
fn visit_arm(&mut self, arm: &ast::Arm) {
286-
if arm.pats.len() == 1 {
287-
let pat = &*arm.pats[0];
288-
let variants = pat_util::necessary_variants(&self.tcx.def_map, pat);
289-
290-
// Inside the body, ignore constructions of variants
291-
// necessary for the pattern to match. Those construction sites
292-
// can't be reached unless the variant is constructed elsewhere.
293-
let len = self.ignore_variant_stack.len();
294-
self.ignore_variant_stack.push_all(&*variants);
295-
visit::walk_arm(self, arm);
296-
self.ignore_variant_stack.truncate(len);
297-
} else {
298-
visit::walk_arm(self, arm);
299-
}
300-
}
301-
302281
fn visit_pat(&mut self, pat: &ast::Pat) {
303282
let def_map = &self.tcx.def_map;
304283
match pat.node {
@@ -418,11 +397,6 @@ fn create_and_seed_worklist(tcx: &ty::ctxt,
418397
worklist.push(*id);
419398
}
420399
for id in reachable_symbols {
421-
// Reachable variants can be dead, because we warn about
422-
// variants never constructed, not variants never used.
423-
if let Some(ast_map::NodeVariant(..)) = tcx.map.find(*id) {
424-
continue;
425-
}
426400
worklist.push(*id);
427401
}
428402

branches/beta/src/librustc/middle/pat_util.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -155,27 +155,3 @@ pub fn def_to_path(tcx: &ty::ctxt, id: ast::DefId) -> ast::Path {
155155
span: DUMMY_SP,
156156
})
157157
}
158-
159-
/// Return variants that are necessary to exist for the pattern to match.
160-
pub fn necessary_variants(dm: &DefMap, pat: &ast::Pat) -> Vec<ast::NodeId> {
161-
let mut variants = vec![];
162-
walk_pat(pat, |p| {
163-
match p.node {
164-
ast::PatEnum(_, _) |
165-
ast::PatIdent(_, _, None) |
166-
ast::PatStruct(..) => {
167-
match dm.borrow().get(&p.id) {
168-
Some(&PathResolution {base_def: DefVariant(_, id, _), ..}) => {
169-
variants.push(id.node);
170-
}
171-
_ => ()
172-
}
173-
}
174-
_ => ()
175-
}
176-
true
177-
});
178-
variants.sort();
179-
variants.dedup();
180-
variants
181-
}

branches/beta/src/librustc/session/search_paths.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use std::slice;
1212
use std::path::{Path, PathBuf};
13+
use session::early_error;
1314

1415
#[derive(Clone, Debug)]
1516
pub struct SearchPaths {
@@ -50,6 +51,9 @@ impl SearchPaths {
5051
} else {
5152
(PathKind::All, path)
5253
};
54+
if path.is_empty() {
55+
early_error("empty search path given via `-L`");
56+
}
5357
self.paths.push((kind, PathBuf::new(path)));
5458
}
5559

branches/beta/src/librustc_lint/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ impl NonCamelCaseTypes {
811811
if i == 0 {
812812
c.to_uppercase().collect::<String>()
813813
} else {
814-
c.to_string()
814+
c.to_lowercase().collect()
815815
}
816816
)).collect::<Vec<_>>().concat()
817817
}

branches/beta/src/librustc_trans/trans/tvec.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ pub fn write_content<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
293293
}
294294
SaveIn(lldest) => {
295295
match ty::eval_repeat_count(bcx.tcx(), &**count_expr) {
296-
0 => bcx,
296+
0 => expr::trans_into(bcx, &**element, Ignore),
297297
1 => expr::trans_into(bcx, &**element, SaveIn(lldest)),
298298
count => {
299299
let elem = unpack_datum!(bcx, expr::trans(bcx, &**element));
@@ -410,8 +410,12 @@ pub fn iter_vec_loop<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
410410
F: FnOnce(Block<'blk, 'tcx>, ValueRef, Ty<'tcx>) -> Block<'blk, 'tcx>,
411411
{
412412
let _icx = push_ctxt("tvec::iter_vec_loop");
413-
let fcx = bcx.fcx;
414413

414+
if bcx.unreachable.get() {
415+
return bcx;
416+
}
417+
418+
let fcx = bcx.fcx;
415419
let loop_bcx = fcx.new_temp_block("expr_repeat");
416420
let next_bcx = fcx.new_temp_block("expr_repeat: next");
417421

0 commit comments

Comments
 (0)