Skip to content

Commit 3a2530d

Browse files
committed
Test fixes and rebase conflicts
Also some tidying up of a bunch of crate attributes
1 parent 188d7c0 commit 3a2530d

File tree

56 files changed

+220
-239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+220
-239
lines changed

src/compiletest/compiletest.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,20 @@
99
// except according to those terms.
1010

1111
#![crate_type = "bin"]
12-
#![allow(unknown_features)]
13-
#![feature(slicing_syntax, unboxed_closures)]
12+
1413
#![feature(box_syntax)]
14+
#![feature(collections)]
15+
#![feature(core)]
1516
#![feature(int_uint)]
16-
#![feature(test)]
17-
#![feature(rustc_private)]
18-
#![feature(std_misc)]
19-
#![feature(path)]
2017
#![feature(io)]
21-
#![feature(core)]
22-
#![feature(collections)]
2318
#![feature(os)]
19+
#![feature(path)]
20+
#![feature(rustc_private)]
21+
#![feature(slicing_syntax, unboxed_closures)]
22+
#![feature(std_misc)]
23+
#![feature(test)]
2424
#![feature(unicode)]
2525

26-
#![allow(unstable)]
2726
#![deny(warnings)]
2827

2928
extern crate test;

src/doc/trpl/patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ If you want to match against a slice or array, you can use `&`:
180180
fn main() {
181181
let v = vec!["match_this", "1"];
182182
183-
match &v {
183+
match &v[] {
184184
["match_this", second] => println!("The second element is {}", second),
185185
_ => {},
186186
}

src/driver/driver.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![allow(unknown_features)]
1211
#![cfg_attr(rustc, feature(rustc_private))]
1312
#![cfg_attr(rustdoc, feature(rustdoc))]
1413

src/liballoc/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@
6666
html_root_url = "http://doc.rust-lang.org/nightly/")]
6767

6868
#![no_std]
69-
#![allow(unknown_features)]
7069
#![feature(lang_items, unsafe_destructor)]
7170
#![feature(box_syntax)]
7271
#![feature(optin_builtin_traits)]
73-
#![allow(unknown_features)] #![feature(int_uint)]
72+
#![feature(int_uint)]
7473
#![feature(core)]
7574
#![feature(hash)]
7675
#![feature(libc)]

src/libarena/lib.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,21 @@
2121
2222
#![crate_name = "arena"]
2323
#![unstable(feature = "rustc_private")]
24-
#![feature(staged_api)]
2524
#![staged_api]
2625
#![crate_type = "rlib"]
2726
#![crate_type = "dylib"]
2827
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2928
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
3029
html_root_url = "http://doc.rust-lang.org/nightly/")]
3130

32-
#![allow(unknown_features)]
33-
#![feature(unsafe_destructor)]
34-
#![feature(unboxed_closures)]
35-
#![feature(box_syntax)]
36-
#![allow(unknown_features)] #![feature(int_uint)]
37-
#![allow(missing_docs)]
3831
#![feature(alloc)]
32+
#![feature(box_syntax)]
3933
#![feature(core)]
34+
#![feature(int_uint)]
35+
#![feature(staged_api)]
36+
#![feature(unboxed_closures)]
37+
#![feature(unsafe_destructor)]
4038
#![cfg_attr(test, feature(test))]
41-
#![cfg_attr(test, feature(collections))]
4239

4340
extern crate alloc;
4441

src/libcollections/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,27 @@
1515

1616
#![crate_name = "collections"]
1717
#![unstable(feature = "collections")]
18-
#![feature(staged_api)]
1918
#![staged_api]
2019
#![crate_type = "rlib"]
2120
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2221
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2322
html_root_url = "http://doc.rust-lang.org/nightly/",
2423
html_playground_url = "http://play.rust-lang.org/")]
2524

26-
#![allow(unknown_features)]
27-
#![feature(unsafe_destructor, slicing_syntax)]
25+
#![cfg_attr(not(stage0), allow(unused_mut))] // NOTE: remove after stage0 snap
26+
27+
#![feature(alloc)]
2828
#![feature(box_syntax)]
29-
#![feature(unboxed_closures)]
30-
#![allow(unknown_features)] #![feature(int_uint)]
31-
#![no_std]
3229
#![feature(core)]
33-
#![feature(alloc)]
34-
#![feature(unicode)]
3530
#![feature(hash)]
31+
#![feature(int_uint)]
32+
#![feature(staged_api)]
33+
#![feature(unboxed_closures)]
34+
#![feature(unicode)]
35+
#![feature(unsafe_destructor, slicing_syntax)]
3636
#![cfg_attr(test, feature(test))]
37-
// NOTE(stage0): remove after a snapshot
38-
#![cfg_attr(not(stage0), allow(unused_mut))]
37+
38+
#![no_std]
3939

4040
#[macro_use]
4141
extern crate core;

src/libcollections/ring_buf.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,7 @@ mod tests {
22042204
d.push_back(i);
22052205
}
22062206

2207-
assert_eq!(d.drain().collect::<Vec<i32>>(), [0, 1, 2, 3, 4]);
2207+
assert_eq!(d.drain().collect::<Vec<_>>(), [0, 1, 2, 3, 4]);
22082208
assert!(d.is_empty());
22092209
}
22102210

@@ -2214,21 +2214,21 @@ mod tests {
22142214
for i in 0..5 {
22152215
d.push_back(i);
22162216
}
2217-
for i in 6i..9 {
2217+
for i in 6..9 {
22182218
d.push_front(i);
22192219
}
22202220

2221-
assert_eq!(d.drain().collect::<Vec<i32>>(), [8,7,6,0,1,2,3,4]);
2221+
assert_eq!(d.drain().collect::<Vec<_>>(), [8,7,6,0,1,2,3,4]);
22222222
assert!(d.is_empty());
22232223
}
22242224

22252225
// partially used
22262226
{
2227-
let mut d = RingBuf::new();
2227+
let mut d: RingBuf<i32> = RingBuf::new();
22282228
for i in 0..5 {
22292229
d.push_back(i);
22302230
}
2231-
for i in 6i..9 {
2231+
for i in 6..9 {
22322232
d.push_front(i);
22332233
}
22342234

@@ -2669,7 +2669,7 @@ mod tests {
26692669
#[test]
26702670
fn test_as_slices() {
26712671
let mut ring: RingBuf<i32> = RingBuf::with_capacity(127);
2672-
let cap = ring.capacity() as int;
2672+
let cap = ring.capacity() as i32;
26732673
let first = cap/2;
26742674
let last = cap - first;
26752675
for i in 0..first {
@@ -2690,14 +2690,14 @@ mod tests {
26902690
assert_eq!(right, expected_right);
26912691
}
26922692

2693-
assert_eq!(ring.len() as int, cap);
2694-
assert_eq!(ring.capacity() as int, cap);
2693+
assert_eq!(ring.len() as i32, cap);
2694+
assert_eq!(ring.capacity() as i32, cap);
26952695
}
26962696

26972697
#[test]
26982698
fn test_as_mut_slices() {
26992699
let mut ring: RingBuf<i32> = RingBuf::with_capacity(127);
2700-
let cap = ring.capacity() as int;
2700+
let cap = ring.capacity() as i32;
27012701
let first = cap/2;
27022702
let last = cap - first;
27032703
for i in 0..first {
@@ -2718,7 +2718,7 @@ mod tests {
27182718
assert_eq!(right, expected_right);
27192719
}
27202720

2721-
assert_eq!(ring.len() as int, cap);
2722-
assert_eq!(ring.capacity() as int, cap);
2721+
assert_eq!(ring.len() as i32, cap);
2722+
assert_eq!(ring.capacity() as i32, cap);
27232723
}
27242724
}

src/libcollections/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl<T> Vec<T> {
181181
/// # Examples
182182
///
183183
/// ```
184-
/// let mut vec: Vec<int> = Vec::with_capacity(10);
184+
/// let mut vec: Vec<_> = Vec::with_capacity(10);
185185
///
186186
/// // The vector contains no items, even though it has capacity for more
187187
/// assert_eq!(vec.len(), 0);

src/libcore/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949

5050
#![crate_name = "core"]
5151
#![unstable(feature = "core")]
52-
#![feature(staged_api)]
5352
#![staged_api]
5453
#![crate_type = "rlib"]
5554
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
@@ -58,15 +57,16 @@
5857
html_playground_url = "http://play.rust-lang.org/")]
5958

6059
#![no_std]
61-
#![allow(unknown_features, raw_pointer_derive)]
62-
#![allow(unknown_features)] #![feature(intrinsics, lang_items)]
60+
#![allow(raw_pointer_derive)]
61+
#![deny(missing_docs)]
62+
#![cfg_attr(not(stage0), allow(unused_mut))] // NOTE: remove after stage0 snap
63+
64+
#![feature(int_uint)]
65+
#![feature(intrinsics, lang_items)]
66+
#![feature(on_unimplemented)]
6367
#![feature(simd, unsafe_destructor, slicing_syntax)]
68+
#![feature(staged_api)]
6469
#![feature(unboxed_closures)]
65-
#![allow(unknown_features)] #![feature(int_uint)]
66-
#![feature(on_unimplemented)]
67-
#![deny(missing_docs)]
68-
// NOTE(stage0) remove cfg_attr after a snapshot
69-
#![cfg_attr(not(stage0), allow(unused_mut))]
7070

7171
#[macro_use]
7272
mod macros;

src/libcore/num/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,11 +1728,11 @@ from_str_radix_int_impl! { u32 }
17281728
from_str_radix_int_impl! { u64 }
17291729

17301730
/// An error which can be returned when parsing an integer.
1731-
#[derive(Show, Clone, PartialEq)]
1731+
#[derive(Debug, Clone, PartialEq)]
17321732
#[stable(feature = "rust1", since = "1.0.0")]
17331733
pub struct ParseIntError { kind: IntErrorKind }
17341734

1735-
#[derive(Show, Clone, PartialEq)]
1735+
#[derive(Debug, Clone, PartialEq)]
17361736
enum IntErrorKind {
17371737
Empty,
17381738
InvalidDigit,
@@ -1760,11 +1760,11 @@ impl Error for ParseIntError {
17601760
}
17611761

17621762
/// An error which can be returned when parsing a float.
1763-
#[derive(Show, Clone, PartialEq)]
1763+
#[derive(Debug, Clone, PartialEq)]
17641764
#[stable(feature = "rust1", since = "1.0.0")]
17651765
pub struct ParseFloatError { kind: FloatErrorKind }
17661766

1767-
#[derive(Show, Clone, PartialEq)]
1767+
#[derive(Debug, Clone, PartialEq)]
17681768
enum FloatErrorKind {
17691769
Empty,
17701770
Invalid,

src/libcore/str/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl FromStr for bool {
148148
}
149149

150150
/// An error returned when parsing a `bool` from a string fails.
151-
#[derive(Show, Clone, PartialEq)]
151+
#[derive(Debug, Clone, PartialEq)]
152152
#[allow(missing_copy_implementations)]
153153
#[stable(feature = "rust1", since = "1.0.0")]
154154
pub struct ParseBoolError { _priv: () }

src/libcoretest/hash/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ fn test_writer_hasher() {
7676
// FIXME (#18248) Add tests for hashing Rc<str> and Rc<[T]>
7777

7878
unsafe {
79-
let ptr: *const int = mem::transmute(5);
79+
let ptr: *const i32 = mem::transmute(5is);
8080
assert_eq!(hash(&ptr), 5);
8181
}
8282

8383
unsafe {
84-
let ptr: *mut int = mem::transmute(5);
84+
let ptr: *mut i32 = mem::transmute(5is);
8585
assert_eq!(hash(&ptr), 5);
8686
}
8787
}

src/libcoretest/iter.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,15 @@ fn test_iterator_len() {
328328

329329
#[test]
330330
fn test_iterator_sum() {
331-
let v: &[_] = &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
331+
let v: &[i32] = &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
332332
assert_eq!(v[..4].iter().map(|&x| x).sum(), 6);
333333
assert_eq!(v.iter().map(|&x| x).sum(), 55);
334334
assert_eq!(v[..0].iter().map(|&x| x).sum(), 0);
335335
}
336336

337337
#[test]
338338
fn test_iterator_product() {
339-
let v: &[_] = &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
339+
let v: &[i32] = &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
340340
assert_eq!(v[..4].iter().map(|&x| x).product(), 0);
341341
assert_eq!(v[1..5].iter().map(|&x| x).product(), 24);
342342
assert_eq!(v[..0].iter().map(|&x| x).product(), 1);
@@ -730,23 +730,23 @@ fn test_random_access_cycle() {
730730

731731
#[test]
732732
fn test_double_ended_range() {
733-
assert!((11..14).rev().collect::<Vec<int>>() == vec![13, 12, 11]);
733+
assert!((11..14).rev().collect::<Vec<_>>() == vec![13, 12, 11]);
734734
for _ in (10..0).rev() {
735735
panic!("unreachable");
736736
}
737737

738-
assert!((11u..14).rev().collect::<Vec<uint>>() == vec![13u, 12, 11]);
739-
for _ in (10u..0).rev() {
738+
assert!((11..14).rev().collect::<Vec<_>>() == vec![13, 12, 11]);
739+
for _ in (10..0).rev() {
740740
panic!("unreachable");
741741
}
742742
}
743743

744744
#[test]
745745
fn test_range() {
746-
assert!((0..5).collect::<Vec<int>>() == vec![0, 1, 2, 3, 4]);
747-
assert!((-10..-1).collect::<Vec<int>>() ==
746+
assert!((0..5).collect::<Vec<_>>() == vec![0, 1, 2, 3, 4]);
747+
assert!((-10..-1).collect::<Vec<_>>() ==
748748
vec![-10, -9, -8, -7, -6, -5, -4, -3, -2]);
749-
assert!((0..5).rev().collect::<Vec<int>>() == vec![4, 3, 2, 1, 0]);
749+
assert!((0..5).rev().collect::<Vec<_>>() == vec![4, 3, 2, 1, 0]);
750750
assert_eq!((200..-5).count(), 0);
751751
assert_eq!((200..-5).rev().count(), 0);
752752
assert_eq!((200..200).count(), 0);

src/libcoretest/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(unsafe_destructor, slicing_syntax)]
12-
#![feature(unboxed_closures)]
1311
#![feature(box_syntax)]
14-
#![allow(unknown_features)] #![feature(int_uint)]
12+
#![feature(int_uint)]
13+
#![feature(unboxed_closures)]
14+
#![feature(unsafe_destructor, slicing_syntax)]
1515

1616
extern crate core;
1717
extern crate test;

src/libflate/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
1717
#![crate_name = "flate"]
1818
#![unstable(feature = "rustc_private")]
19-
#![feature(staged_api)]
2019
#![staged_api]
21-
#![allow(unknown_features)] #![feature(int_uint)]
2220
#![crate_type = "rlib"]
2321
#![crate_type = "dylib"]
2422
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2523
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2624
html_root_url = "http://doc.rust-lang.org/nightly/")]
27-
#![feature(hash)]
25+
2826
#![feature(core)]
27+
#![feature(int_uint)]
2928
#![feature(libc)]
29+
#![feature(staged_api)]
3030

3131
#[cfg(test)] #[macro_use] extern crate log;
3232

src/libfmt_macros/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
1717
#![crate_name = "fmt_macros"]
1818
#![unstable(feature = "rustc_private")]
19-
#![feature(staged_api)]
2019
#![staged_api]
2120
#![crate_type = "rlib"]
2221
#![crate_type = "dylib"]
@@ -25,10 +24,10 @@
2524
html_root_url = "http://doc.rust-lang.org/nightly/",
2625
html_playground_url = "http://play.rust-lang.org/")]
2726

27+
#![cfg_attr(stage0, feature(core))]
28+
#![feature(int_uint)]
2829
#![feature(slicing_syntax)]
29-
#![allow(unknown_features)] #![feature(int_uint)]
30-
#![feature(collections)]
31-
#![feature(core)]
30+
#![feature(staged_api)]
3231
#![feature(unicode)]
3332

3433
pub use self::Piece::*;

0 commit comments

Comments
 (0)