Skip to content

Commit 5ad9b4c

Browse files
committed
---
yaml --- r: 152370 b: refs/heads/try2 c: 90339ef h: refs/heads/master v: v3
1 parent 81bcf64 commit 5ad9b4c

File tree

11 files changed

+98
-211
lines changed

11 files changed

+98
-211
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: bbd448a27c37dd95a9551c45606f865bff411a47
8+
refs/heads/try2: 90339ef18919be0212543a1b1f376c9c62c1d365
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcollections/dlist.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
use core::prelude::*;
2525

2626
use alloc::owned::Box;
27-
use core::fmt;
2827
use core::iter;
2928
use core::mem;
3029
use core::ptr;
@@ -609,19 +608,6 @@ impl<A: Clone> Clone for DList<A> {
609608
}
610609
}
611610

612-
impl<A: fmt::Show> fmt::Show for DList<A> {
613-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
614-
try!(write!(f, "["));
615-
616-
for (i, e) in self.iter().enumerate() {
617-
if i != 0 { try!(write!(f, ", ")); }
618-
try!(write!(f, "{}", *e));
619-
}
620-
621-
write!(f, "]")
622-
}
623-
}
624-
625611
#[cfg(test)]
626612
mod tests {
627613
use std::prelude::*;
@@ -1041,17 +1027,6 @@ mod tests {
10411027
}
10421028
}
10431029

1044-
#[test]
1045-
fn test_show() {
1046-
let list: DList<int> = range(0, 10).collect();
1047-
assert!(list.to_str().as_slice() == "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]");
1048-
1049-
let list: DList<&str> = vec!["just", "one", "test", "more"].iter()
1050-
.map(|&s| s)
1051-
.collect();
1052-
assert!(list.to_str().as_slice() == "[just, one, test, more]");
1053-
}
1054-
10551030
#[cfg(test)]
10561031
fn fuzz_test(sz: int) {
10571032
let mut m: DList<int> = DList::new();

branches/try2/src/libcollections/smallintmap.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
use core::prelude::*;
1919

20-
use core::fmt;
2120
use core::iter::{Enumerate, FilterMap};
2221
use core::mem::replace;
2322

@@ -177,18 +176,6 @@ impl<V:Clone> SmallIntMap<V> {
177176
}
178177
}
179178

180-
impl<V: fmt::Show> fmt::Show for SmallIntMap<V> {
181-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
182-
try!(write!(f, r"\{"));
183-
184-
for (i, (k, v)) in self.iter().enumerate() {
185-
if i != 0 { try!(write!(f, ", ")); }
186-
try!(write!(f, "{}: {}", k, *v));
187-
}
188-
189-
write!(f, r"\}")
190-
}
191-
}
192179

193180
macro_rules! iterator {
194181
(impl $name:ident -> $elem:ty, $getter:ident) => {
@@ -474,20 +461,6 @@ mod test_map {
474461
assert!(called);
475462
m.insert(2, box 1);
476463
}
477-
478-
#[test]
479-
fn test_show() {
480-
let mut map = SmallIntMap::new();
481-
let empty = SmallIntMap::<int>::new();
482-
483-
map.insert(1, 2);
484-
map.insert(3, 4);
485-
486-
let map_str = map.to_str();
487-
let map_str = map_str.as_slice();
488-
assert!(map_str == "{1: 2, 3: 4}" || map_str == "{3: 4, 1: 2}");
489-
assert_eq!(format!("{}", empty), "{}".to_string());
490-
}
491464
}
492465

493466
#[cfg(test)]

branches/try2/src/libcore/cmp.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,13 @@
3939
4040
/// Trait for values that can be compared for equality and inequality.
4141
///
42-
/// This trait allows for partial equality, for types that do not have an
43-
/// equivalence relation. For example, in floating point numbers `NaN != NaN`,
44-
/// so floating point types implement `PartialEq` but not `Eq`.
42+
/// This trait allows partial equality, where types can be unordered instead of
43+
/// strictly equal or unequal. For example, with the built-in floating-point
44+
/// types `a == b` and `a != b` will both evaluate to false if either `a` or
45+
/// `b` is NaN (cf. IEEE 754-2008 section 5.11).
4546
///
46-
/// PartialEq only requires the `eq` method to be implemented; `ne` is defined
47-
/// in terms of it by default. Any manual implementation of `ne` *must* respect
48-
/// the rule that `eq` is a strict inverse of `ne`; that is, `!(a == b)` if and
49-
/// only if `a != b`.
47+
/// PartialEq only requires the `eq` method to be implemented; `ne` is its negation by
48+
/// default.
5049
///
5150
/// Eventually, this will be implemented by default for types that implement
5251
/// `Eq`.
@@ -148,10 +147,9 @@ pub fn lexical_ordering(o1: Ordering, o2: Ordering) -> Ordering {
148147
/// PartialOrd only requires implementation of the `lt` method,
149148
/// with the others generated from default implementations.
150149
///
151-
/// However it remains possible to implement the others separately for types
152-
/// which do not have a total order. For example, for floating point numbers,
153-
/// `NaN < 0 == false` and `NaN >= 0 == false` (cf. IEEE 754-2008 section
154-
/// 5.11).
150+
/// However it remains possible to implement the others separately,
151+
/// for compatibility with floating-point NaN semantics
152+
/// (cf. IEEE 754-2008 section 5.11).
155153
#[lang="ord"]
156154
pub trait PartialOrd: PartialEq {
157155
/// This method tests less than (for `self` and `other`) and is used by the `<` operator.

branches/try2/src/librustc/middle/typeck/check/_match.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,8 @@ pub fn check_pat(pcx: &pat_ctxt, pat: &ast::Pat, expected: ty::t) {
460460
{
461461
// no-op
462462
} else if !ty::type_is_numeric(b_ty) && !ty::type_is_char(b_ty) {
463-
tcx.sess.span_err(pat.span, "non-numeric type used in range");
463+
tcx.sess.span_err(pat.span,
464+
"only char and numeric types are allowed in range");
464465
} else {
465466
match valid_range_bounds(fcx.ccx, begin, end) {
466467
Some(false) => {

branches/try2/src/librustdoc/html/static/playpen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
a.attr('target', '_blank');
2323
$(this).append(a);
2424
}, function() {
25-
$(this).find('a.test-arrow').remove();
25+
$(this).find('a').remove();
2626
});
2727
}
2828
}());

branches/try2/src/libsyntax/ext/quote.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,6 @@ pub mod rt {
135135
}
136136
}
137137

138-
impl ToSource for ast::Arg {
139-
fn to_source(&self) -> String {
140-
pprust::arg_to_str(self)
141-
}
142-
}
143-
144138
impl<'a> ToSource for &'a str {
145139
fn to_source(&self) -> String {
146140
let lit = dummy_spanned(ast::LitStr(
@@ -270,7 +264,6 @@ pub mod rt {
270264
impl_to_tokens!(Generics)
271265
impl_to_tokens!(@ast::Expr)
272266
impl_to_tokens!(ast::Block)
273-
impl_to_tokens!(ast::Arg)
274267
impl_to_tokens_self!(&'a str)
275268
impl_to_tokens!(())
276269
impl_to_tokens!(char)

branches/try2/src/libsyntax/print/pprust.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,6 @@ pub fn variant_to_str(var: &ast::Variant) -> String {
242242
to_str(|s| s.print_variant(var))
243243
}
244244

245-
pub fn arg_to_str(arg: &ast::Arg) -> String {
246-
to_str(|s| s.print_arg(arg))
247-
}
248-
249245
pub fn visibility_qualified(vis: ast::Visibility, s: &str) -> String {
250246
match vis {
251247
ast::Public => format!("pub {}", s).to_string(),

branches/try2/src/test/compile-fail/borrowck-field-sensitivity.rs

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@
1010

1111
struct A { a: int, b: Box<int> }
1212

13-
fn deref_after_move() {
13+
fn borrow<T>(_: &T) { }
14+
15+
fn use_after_move() {
1416
let x = A { a: 1, b: box 2 };
1517
drop(x.b);
1618
drop(*x.b); //~ ERROR use of partially moved value: `*x.b`
1719
}
1820

19-
fn deref_after_fu_move() {
21+
fn use_after_fu_move() {
2022
let x = A { a: 1, b: box 2 };
2123
let y = A { a: 3, .. x };
2224
drop(*x.b); //~ ERROR use of partially moved value: `*x.b`
@@ -25,37 +27,35 @@ fn deref_after_fu_move() {
2527
fn borrow_after_move() {
2628
let x = A { a: 1, b: box 2 };
2729
drop(x.b);
28-
let p = &x.b; //~ ERROR use of moved value: `x.b`
29-
drop(**p);
30+
borrow(&x.b); //~ ERROR use of moved value: `x.b`
3031
}
3132

3233
fn borrow_after_fu_move() {
3334
let x = A { a: 1, b: box 2 };
3435
let _y = A { a: 3, .. x };
35-
let p = &x.b; //~ ERROR use of moved value: `x.b`
36-
drop(**p);
36+
borrow(&x.b); //~ ERROR use of moved value: `x.b`
3737
}
3838

3939
fn move_after_borrow() {
4040
let x = A { a: 1, b: box 2 };
41-
let p = &x.b;
41+
let y = &x.b;
4242
drop(x.b); //~ ERROR cannot move out of `x.b` because it is borrowed
43-
drop(**p);
43+
borrow(&*y);
4444
}
4545

4646
fn fu_move_after_borrow() {
4747
let x = A { a: 1, b: box 2 };
48-
let p = &x.b;
49-
let _y = A { a: 3, .. x }; //~ ERROR cannot move out of `x.b` because it is borrowed
50-
drop(**p);
48+
let y = &x.b;
49+
let _z = A { a: 3, .. x }; //~ ERROR cannot move out of `x.b` because it is borrowed
50+
borrow(&*y);
5151
}
5252

5353
fn mut_borrow_after_mut_borrow() {
5454
let mut x = A { a: 1, b: box 2 };
55-
let p = &mut x.a;
56-
let q = &mut x.a; //~ ERROR cannot borrow `x.a` as mutable more than once at a time
57-
drop(*p);
58-
drop(*q);
55+
let y = &mut x.a;
56+
let z = &mut x.a; //~ ERROR cannot borrow `x.a` as mutable more than once at a time
57+
drop(*y);
58+
drop(*z);
5959
}
6060

6161
fn move_after_move() {
@@ -84,21 +84,7 @@ fn fu_move_after_fu_move() {
8484

8585
// The following functions aren't yet accepted, but they should be.
8686

87-
fn move_after_borrow_correct() {
88-
let x = A { a: 1, b: box 2 };
89-
let p = &x.a;
90-
drop(x.b); //~ ERROR cannot move out of `x.b` because it is borrowed
91-
drop(*p);
92-
}
93-
94-
fn fu_move_after_borrow_correct() {
95-
let x = A { a: 1, b: box 2 };
96-
let p = &x.a;
97-
let _y = A { a: 3, .. x }; //~ ERROR cannot move out of `x.b` because it is borrowed
98-
drop(*p);
99-
}
100-
101-
fn copy_after_field_assign_after_uninit() {
87+
fn use_after_field_assign_after_uninit() {
10288
let mut x: A;
10389
x.a = 1;
10490
drop(x.a); //~ ERROR use of possibly uninitialized variable: `x.a`
@@ -107,8 +93,7 @@ fn copy_after_field_assign_after_uninit() {
10793
fn borrow_after_field_assign_after_uninit() {
10894
let mut x: A;
10995
x.a = 1;
110-
let p = &x.a; //~ ERROR use of possibly uninitialized variable: `x.a`
111-
drop(*p);
96+
borrow(&x.a); //~ ERROR use of possibly uninitialized variable: `x.a`
11297
}
11398

11499
fn move_after_field_assign_after_uninit() {
@@ -118,8 +103,8 @@ fn move_after_field_assign_after_uninit() {
118103
}
119104

120105
fn main() {
121-
deref_after_move();
122-
deref_after_fu_move();
106+
use_after_move();
107+
use_after_fu_move();
123108

124109
borrow_after_move();
125110
borrow_after_fu_move();
@@ -132,10 +117,7 @@ fn main() {
132117
fu_move_after_move();
133118
fu_move_after_fu_move();
134119

135-
move_after_borrow_correct();
136-
fu_move_after_borrow_correct();
137-
138-
copy_after_field_assign_after_uninit();
120+
use_after_field_assign_after_uninit();
139121
borrow_after_field_assign_after_uninit();
140122
move_after_field_assign_after_uninit();
141123
}

branches/try2/src/test/compile-fail/match-range-fail.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
//error-pattern: lower range bound
12-
//error-pattern: non-numeric
12+
//error-pattern: only char and numeric types
1313
//error-pattern: mismatched types
1414

1515
fn main() {

0 commit comments

Comments
 (0)