Skip to content

Commit f670081

Browse files
committed
---
yaml --- r: 107563 b: refs/heads/dist-snap c: aa66b91 h: refs/heads/master i: 107561: c113786 107559: 086be7f v: v3
1 parent 4ba2227 commit f670081

File tree

28 files changed

+90
-113
lines changed

28 files changed

+90
-113
lines changed

[refs]

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

branches/dist-snap/src/libextra/num/bigint.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ impl Integer for BigUint {
385385
}
386386

387387
let mut shift = 0;
388-
let mut n = *other.data.last();
388+
let mut n = *other.data.last().unwrap();
389389
while n < (1 << BigDigit::bits - 2) {
390390
n <<= 1;
391391
shift += 1;
@@ -434,7 +434,7 @@ impl Integer for BigUint {
434434
}
435435

436436
let an = a.data.slice(a.data.len() - n, a.data.len());
437-
let bn = *b.data.last();
437+
let bn = *b.data.last().unwrap();
438438
let mut d = ~[];
439439
let mut carry = 0;
440440
for elt in an.rev_iter() {
@@ -798,7 +798,7 @@ impl BigUint {
798798
/// Determines the fewest bits necessary to express the `BigUint`.
799799
pub fn bits(&self) -> uint {
800800
if self.is_zero() { return 0; }
801-
let zeros = self.data.last().leading_zeros();
801+
let zeros = self.data.last().unwrap().leading_zeros();
802802
return self.data.len()*BigDigit::bits - (zeros as uint);
803803
}
804804
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ mod tests {
234234
sorted.sort();
235235
let mut heap = PriorityQueue::from_vec(data);
236236
while !heap.is_empty() {
237-
assert_eq!(heap.top(), sorted.last());
237+
assert_eq!(heap.top(), sorted.last().unwrap());
238238
assert_eq!(heap.pop(), sorted.pop());
239239
}
240240
}

branches/dist-snap/src/librustc/front/feature_gate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,17 @@ impl Visitor<()> for Context {
179179
fn visit_mac(&mut self, macro: &ast::Mac, _: ()) {
180180
let ast::MacInvocTT(ref path, _, _) = macro.node;
181181

182-
if path.segments.last().identifier == self.sess.ident_of("macro_rules") {
182+
if path.segments.last().unwrap().identifier == self.sess.ident_of("macro_rules") {
183183
self.gate_feature("macro_rules", path.span, "macro definitions are \
184184
not stable enough for use and are subject to change");
185185
}
186186

187-
else if path.segments.last().identifier == self.sess.ident_of("asm") {
187+
else if path.segments.last().unwrap().identifier == self.sess.ident_of("asm") {
188188
self.gate_feature("asm", path.span, "inline assembly is not \
189189
stable enough for use and is subject to change");
190190
}
191191

192-
else if path.segments.last().identifier == self.sess.ident_of("log_syntax") {
192+
else if path.segments.last().unwrap().identifier == self.sess.ident_of("log_syntax") {
193193
self.gate_feature("log_syntax", path.span, "`log_syntax!` is not \
194194
stable enough for use and is subject to change");
195195
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ impl<'a> GatherLoanCtxt<'a> {
445445
return;
446446
}
447447

448-
let root_ub = { *self.repeating_ids.last() }; // FIXME(#5074)
448+
let root_ub = { *self.repeating_ids.last().unwrap() }; // FIXME(#5074)
449449

450450
// Check that the lifetime of the borrow does not exceed
451451
// the lifetime of the data being borrowed.

branches/dist-snap/src/librustc/middle/cfg/construct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ impl CFGBuilder {
495495
label: Option<ast::Name>) -> LoopScope {
496496
match label {
497497
None => {
498-
return *self.loop_scopes.last();
498+
return *self.loop_scopes.last().unwrap();
499499
}
500500

501501
Some(_) => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ fn check_pat_non_uppercase_statics(cx: &Context, p: &ast::Pat) {
10771077
match (&p.node, def_map.get().find(&p.id)) {
10781078
(&ast::PatIdent(_, ref path, _), Some(&ast::DefStatic(_, false))) => {
10791079
// last identifier alone is right choice for this lint.
1080-
let ident = path.segments.last().identifier;
1080+
let ident = path.segments.last().unwrap().identifier;
10811081
let s = cx.tcx.sess.str_of(ident);
10821082
if s.chars().any(|c| c.is_lowercase()) {
10831083
cx.span_lint(NonUppercasePatternStatics, path.span,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ impl Liveness {
790790

791791
pub fn last_loop_scope(&self) -> NodeId {
792792
let loop_scope = self.loop_scope.borrow();
793-
*loop_scope.get().last()
793+
*loop_scope.get().last().unwrap()
794794
}
795795

796796
pub fn ln_str(&self, ln: LiveNode) -> ~str {
@@ -1593,7 +1593,7 @@ impl Liveness {
15931593
} else {
15941594
let ends_with_stmt = match body.expr {
15951595
None if body.stmts.len() > 0 =>
1596-
match body.stmts.last().node {
1596+
match body.stmts.last().unwrap().node {
15971597
StmtSemi(e, _) => {
15981598
let t_stmt = ty::expr_ty(self.tcx, e);
15991599
ty::get(t_stmt).sty == ty::get(t_ret).sty
@@ -1603,7 +1603,7 @@ impl Liveness {
16031603
_ => false
16041604
};
16051605
if ends_with_stmt {
1606-
let last_stmt = body.stmts.last();
1606+
let last_stmt = body.stmts.last().unwrap();
16071607
let span_semicolon = Span {
16081608
lo: last_stmt.span.hi,
16091609
hi: last_stmt.span.hi,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ impl<'a> PrivacyVisitor<'a> {
595595
match *self.last_private_map.get(&path_id) {
596596
resolve::AllPublic => {},
597597
resolve::DependsOn(def) => {
598-
let name = token::ident_to_str(&path.segments.last()
598+
let name = token::ident_to_str(&path.segments.last().unwrap()
599599
.identifier);
600600
self.ensure_public(span, def, Some(origdid),
601601
format!("{} `{}`", tyname, name));

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ impl Resolver {
14761476
match view_path.node {
14771477
ViewPathSimple(binding, ref full_path, id) => {
14781478
let source_ident =
1479-
full_path.segments.last().identifier;
1479+
full_path.segments.last().unwrap().identifier;
14801480
let subclass = @SingleImport(binding,
14811481
source_ident);
14821482
self.build_import_directive(module_,
@@ -4303,7 +4303,7 @@ impl Resolver {
43034303

43044304
// First, check to see whether the name is a primitive type.
43054305
if path.segments.len() == 1 {
4306-
let id = path.segments.last().identifier;
4306+
let id = path.segments.last().unwrap().identifier;
43074307

43084308
match self.primitive_type_table
43094309
.primitive_types
@@ -4342,7 +4342,7 @@ impl Resolver {
43424342
debug!("(resolving type) resolved `{}` to \
43434343
type {:?}",
43444344
self.session.str_of(path.segments
4345-
.last()
4345+
.last().unwrap()
43464346
.identifier),
43474347
def);
43484348
result_def = Some(def);
@@ -4561,7 +4561,7 @@ impl Resolver {
45614561
path.span,
45624562
format!("`{}` is not an enum variant or constant",
45634563
self.session.str_of(
4564-
path.segments.last().identifier)))
4564+
path.segments.last().unwrap().identifier)))
45654565
}
45664566
None => {
45674567
self.resolve_error(path.span,
@@ -4592,7 +4592,7 @@ impl Resolver {
45924592
format!("`{}` is not an enum variant, struct or const",
45934593
self.session
45944594
.str_of(path.segments
4595-
.last()
4595+
.last().unwrap()
45964596
.identifier)));
45974597
}
45984598
None => {
@@ -4601,7 +4601,7 @@ impl Resolver {
46014601
struct or const `{}`",
46024602
self.session
46034603
.str_of(path.segments
4604-
.last()
4604+
.last().unwrap()
46054605
.identifier)));
46064606
}
46074607
}
@@ -4722,7 +4722,7 @@ impl Resolver {
47224722

47234723
let unqualified_def =
47244724
self.resolve_identifier(path.segments
4725-
.last()
4725+
.last().unwrap()
47264726
.identifier,
47274727
namespace,
47284728
check_ribs,
@@ -4883,7 +4883,7 @@ impl Resolver {
48834883
}
48844884
}
48854885

4886-
let ident = path.segments.last().identifier;
4886+
let ident = path.segments.last().unwrap().identifier;
48874887
let def = match self.resolve_definition_of_name_in_module(containing_module,
48884888
ident,
48894889
namespace) {
@@ -4952,7 +4952,7 @@ impl Resolver {
49524952
}
49534953
}
49544954

4955-
let name = path.segments.last().identifier;
4955+
let name = path.segments.last().unwrap().identifier;
49564956
match self.resolve_definition_of_name_in_module(containing_module,
49574957
name,
49584958
namespace) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ fn enter_default<'r,'b>(
575575
// non guarded matches, and thus by exhaustiveness, we know that
576576
// we don't need any default cases. If the check *isn't* nonexhaustive
577577
// (because chk is Some), then we need the defaults anyways.
578-
let is_exhaustive = match matches.last_opt() {
578+
let is_exhaustive = match matches.last() {
579579
Some(m) if m.data.arm.guard.is_some() && chk.is_infallible() => true,
580580
_ => false
581581
};
@@ -913,7 +913,7 @@ fn get_options(bcx: &Block, m: &[Match], col: uint) -> ~[Opt] {
913913
// to not always merge conditions.
914914
fn add_veclen_to_set(set: &mut ~[Opt], i: uint,
915915
len: uint, vlo: VecLenOpt) {
916-
match set.last_opt() {
916+
match set.last() {
917917
// If the last condition in the list matches the one we want
918918
// to add, then extend its range. Otherwise, make a new
919919
// vec_len with a range just covering the new entry.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,7 @@ fn exported_name(ccx: &CrateContext, path: ast_map::Path,
20142014

20152015
// Don't mangle
20162016
_ if attr::contains_name(attrs, "no_mangle")
2017-
=> path_elem_to_str(*path.last(), token::get_ident_interner()),
2017+
=> path_elem_to_str(*path.last().unwrap(), token::get_ident_interner()),
20182018

20192019
// Usual name mangling
20202020
_ => mangle_exported_name(ccx, path, ty)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ impl<'a> CleanupHelperMethods<'a> for FunctionContext<'a> {
475475

476476
fn top_scope<R>(&self, f: |&CleanupScope<'a>| -> R) -> R {
477477
let scopes = self.scopes.borrow();
478-
f(scopes.get().last())
478+
f(scopes.get().last().unwrap())
479479
}
480480

481481
fn trans_cleanups_to_exit_scope(&self,
@@ -568,7 +568,7 @@ impl<'a> CleanupHelperMethods<'a> for FunctionContext<'a> {
568568
// and this scope is that loop, then stop popping and set
569569
// `prev_llbb` to the appropriate exit block from the loop.
570570
popped_scopes.push(self.pop_scope());
571-
let scope = popped_scopes.last();
571+
let scope = popped_scopes.last().unwrap();
572572
match label {
573573
UnwindExit | ReturnExit => { }
574574
LoopExit(id, exit) => {

0 commit comments

Comments
 (0)