Skip to content

Commit 039929e

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 159867 b: refs/heads/try c: f7c1771 h: refs/heads/master i: 159865: 88da46e 159863: c855f9f v: v3
1 parent 9782185 commit 039929e

File tree

7 files changed

+22
-55
lines changed

7 files changed

+22
-55
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: e09d98603e608c9e47d4c89f7b4dca87a4b56da3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 9c96a79a74f10bed18b031ce0ac4126c56d6cfb3
5-
refs/heads/try: a0a7ab461283322215f0343cd2b5e66fc19a7bd5
5+
refs/heads/try: f7c1771fd18672a148979d334bf732d15a2c4023
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libcore/ops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ shr_impl!(uint u8 u16 u32 u64 int i8 i16 i32 i64)
638638
* ```
639639
*/
640640
#[lang="index"]
641-
pub trait Index<Index, Sized? Result> {
641+
pub trait Index<Index, Sized? Result> for Sized? {
642642
/// The method for the indexing (`Foo[Bar]`) operation
643643
fn index<'a>(&'a self, index: &Index) -> &'a Result;
644644
}
@@ -669,7 +669,7 @@ pub trait Index<Index, Sized? Result> {
669669
* ```
670670
*/
671671
#[lang="index_mut"]
672-
pub trait IndexMut<Index, Result> {
672+
pub trait IndexMut<Index, Result> for Sized? {
673673
/// The method for the indexing (`Foo[Bar]`) operation
674674
fn index_mut<'a>(&'a mut self, index: &Index) -> &'a mut Result;
675675
}

branches/try/src/libcore/slice.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ pub trait SlicePrelude<T> for Sized? {
256256
#[inline]
257257
#[experimental = "not triaged yet"]
258258
fn is_empty(&self) -> bool { self.len() == 0 }
259-
260259
/// Returns a mutable reference to the element at the given index,
261260
/// or `None` if the index is out of bounds
262261
#[unstable = "waiting on final error conventions"]
@@ -698,6 +697,22 @@ impl<T> SlicePrelude<T> for [T] {
698697
}
699698
}
700699

700+
impl<T> ops::Index<uint, T> for [T] {
701+
fn index(&self, &index: &uint) -> &T {
702+
assert!(index < self.len());
703+
704+
unsafe { mem::transmute(self.repr().data.offset(index as int)) }
705+
}
706+
}
707+
708+
impl<T> ops::IndexMut<uint, T> for [T] {
709+
fn index_mut(&mut self, &index: &uint) -> &mut T {
710+
assert!(index < self.len());
711+
712+
unsafe { mem::transmute(self.repr().data.offset(index as int)) }
713+
}
714+
}
715+
701716
impl<T> ops::Slice<uint, [T]> for [T] {
702717
#[inline]
703718
fn as_slice_<'a>(&'a self) -> &'a [T] {

branches/try/src/librustc/middle/cfg/construct.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,8 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
448448
}
449449

450450
ast::ExprStruct(_, ref fields, ref base) => {
451-
let field_cfg = self.straightline(expr, pred, fields.iter().map(|f| &*f.expr));
452-
self.opt_expr(base, field_cfg)
451+
let base_exit = self.opt_expr(base, pred);
452+
self.straightline(expr, base_exit, fields.iter().map(|f| &*f.expr))
453453
}
454454

455455
ast::ExprRepeat(ref elem, ref count) => {

branches/try/src/librustc/middle/expr_use_visitor.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -672,10 +672,6 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,TYPER> {
672672
}
673673
}
674674

675-
// walk the with expression so that complex expressions
676-
// are properly handled.
677-
self.walk_expr(with_expr);
678-
679675
fn contains_field_named(field: &ty::field,
680676
fields: &Vec<ast::Field>)
681677
-> bool

branches/try/src/libstd/num/strconv.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ pub fn from_str_radix_float<T: Float>(src: &str, radix: uint) -> Option<T> {
451451
};
452452

453453
// The significand to accumulate
454-
let mut sig = if is_positive { _0 } else { -_0 };
454+
let mut sig = if is_positive { _0 } else { -_1 };
455455
// Necessary to detect overflow
456456
let mut prev_sig = sig;
457457
let mut cs = src.chars().enumerate();
@@ -647,22 +647,6 @@ mod test {
647647
let fe : Option<f32> = from_str_radix_float("1e40", 10);
648648
assert_eq!(fe, Some(Float::infinity()))
649649
}
650-
651-
#[test]
652-
fn test_from_str_radix_float() {
653-
let x1 : Option<f64> = from_str_radix_float("-123.456", 10);
654-
assert_eq!(x1, Some(-123.456));
655-
let x2 : Option<f32> = from_str_radix_float("123.456", 10);
656-
assert_eq!(x2, Some(123.456));
657-
let x3 : Option<f32> = from_str_radix_float("-0.0", 10);
658-
assert_eq!(x3, Some(-0.0));
659-
let x4 : Option<f32> = from_str_radix_float("0.0", 10);
660-
assert_eq!(x4, Some(0.0));
661-
let x4 : Option<f32> = from_str_radix_float("1.0", 10);
662-
assert_eq!(x4, Some(1.0));
663-
let x5 : Option<f32> = from_str_radix_float("-1.0", 10);
664-
assert_eq!(x5, Some(-1.0));
665-
}
666650
}
667651

668652
#[cfg(test)]

branches/try/src/test/compile-fail/walk-struct-literal-with.rs

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)