Skip to content

Commit 336c8d2

Browse files
committed
Auto merge of rust-lang#21613 - alfie:suffix-small, r=alexcrichton
2 parents 7858cb4 + 8f4844d commit 336c8d2

File tree

35 files changed

+182
-182
lines changed

35 files changed

+182
-182
lines changed

src/compiletest/header.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ fn parse_exec_env(line: &str) -> Option<(String, String)> {
300300
.collect();
301301

302302
match strs.len() {
303-
1u => (strs.pop().unwrap(), "".to_string()),
304-
2u => {
303+
1 => (strs.pop().unwrap(), "".to_string()),
304+
2 => {
305305
let end = strs.pop().unwrap();
306306
(strs.pop().unwrap(), end)
307307
}

src/compiletest/runtest.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
230230
let s = File::open(&filepath).read_to_end().unwrap();
231231
String::from_utf8(s).unwrap()
232232
}
233-
None => { srcs[srcs.len() - 2u].clone() }
233+
None => { srcs[srcs.len() - 2].clone() }
234234
};
235-
let mut actual = srcs[srcs.len() - 1u].clone();
235+
let mut actual = srcs[srcs.len() - 1].clone();
236236

237237
if props.pp_exact.is_some() {
238238
// Now we have to care about line endings
@@ -842,7 +842,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
842842
}).collect();
843843
// check if each line in props.check_lines appears in the
844844
// output (in order)
845-
let mut i = 0u;
845+
let mut i = 0;
846846
for line in debugger_run_result.stdout.lines() {
847847
let mut rest = line.trim();
848848
let mut first = true;
@@ -869,7 +869,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
869869
first = false;
870870
}
871871
if !failed && rest.len() == 0 {
872-
i += 1u;
872+
i += 1;
873873
}
874874
if i == num_check_lines {
875875
// all lines checked
@@ -892,13 +892,13 @@ fn check_error_patterns(props: &TestProps,
892892
fatal(format!("no error pattern specified in {:?}",
893893
testfile.display()).as_slice());
894894
}
895-
let mut next_err_idx = 0u;
895+
let mut next_err_idx = 0;
896896
let mut next_err_pat = &props.error_patterns[next_err_idx];
897897
let mut done = false;
898898
for line in output_to_check.lines() {
899899
if line.contains(next_err_pat.as_slice()) {
900900
debug!("found error pattern {}", next_err_pat);
901-
next_err_idx += 1u;
901+
next_err_idx += 1;
902902
if next_err_idx == props.error_patterns.len() {
903903
debug!("found all error patterns");
904904
done = true;
@@ -910,7 +910,7 @@ fn check_error_patterns(props: &TestProps,
910910
if done { return; }
911911

912912
let missing_patterns = &props.error_patterns[next_err_idx..];
913-
if missing_patterns.len() == 1u {
913+
if missing_patterns.len() == 1 {
914914
fatal_proc_rec(format!("error pattern '{}' not found!",
915915
missing_patterns[0]).as_slice(),
916916
proc_res);
@@ -1025,7 +1025,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
10251025
}
10261026

10271027
fn is_compiler_error_or_warning(line: &str) -> bool {
1028-
let mut i = 0u;
1028+
let mut i = 0;
10291029
return
10301030
scan_until_char(line, ':', &mut i) &&
10311031
scan_char(line, ':', &mut i) &&
@@ -1084,7 +1084,7 @@ fn scan_integer(haystack: &str, idx: &mut uint) -> bool {
10841084

10851085
fn scan_string(haystack: &str, needle: &str, idx: &mut uint) -> bool {
10861086
let mut haystack_i = *idx;
1087-
let mut needle_i = 0u;
1087+
let mut needle_i = 0;
10881088
while needle_i < needle.len() {
10891089
if haystack_i >= haystack.len() {
10901090
return false;

src/libarena/lib.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub struct Arena {
101101
impl Arena {
102102
/// Allocates a new Arena with 32 bytes preallocated.
103103
pub fn new() -> Arena {
104-
Arena::new_with_size(32u)
104+
Arena::new_with_size(32)
105105
}
106106

107107
/// Allocates a new Arena with `initial_size` bytes preallocated.
@@ -117,7 +117,7 @@ impl Arena {
117117
fn chunk(size: uint, is_copy: bool) -> Chunk {
118118
Chunk {
119119
data: Rc::new(RefCell::new(Vec::with_capacity(size))),
120-
fill: Cell::new(0u),
120+
fill: Cell::new(0),
121121
is_copy: Cell::new(is_copy),
122122
}
123123
}
@@ -193,7 +193,7 @@ impl Arena {
193193
self.chunks.borrow_mut().push(self.copy_head.borrow().clone());
194194

195195
*self.copy_head.borrow_mut() =
196-
chunk((new_min_chunk_size + 1u).next_power_of_two(), true);
196+
chunk((new_min_chunk_size + 1).next_power_of_two(), true);
197197

198198
return self.alloc_copy_inner(n_bytes, align);
199199
}
@@ -234,7 +234,7 @@ impl Arena {
234234
self.chunks.borrow_mut().push(self.head.borrow().clone());
235235

236236
*self.head.borrow_mut() =
237-
chunk((new_min_chunk_size + 1u).next_power_of_two(), false);
237+
chunk((new_min_chunk_size + 1).next_power_of_two(), false);
238238

239239
return self.alloc_noncopy_inner(n_bytes, align);
240240
}
@@ -308,7 +308,7 @@ impl Arena {
308308
#[test]
309309
fn test_arena_destructors() {
310310
let arena = Arena::new();
311-
for i in 0u..10 {
311+
for i in 0..10 {
312312
// Arena allocate something with drop glue to make sure it
313313
// doesn't leak.
314314
arena.alloc(|| Rc::new(i));
@@ -337,7 +337,7 @@ fn test_arena_alloc_nested() {
337337
fn test_arena_destructors_fail() {
338338
let arena = Arena::new();
339339
// Put some stuff in the arena.
340-
for i in 0u..10 {
340+
for i in 0..10 {
341341
// Arena allocate something with drop glue to make sure it
342342
// doesn't leak.
343343
arena.alloc(|| { Rc::new(i) });
@@ -527,7 +527,7 @@ mod tests {
527527
#[test]
528528
pub fn test_copy() {
529529
let arena = TypedArena::new();
530-
for _ in 0u..100000 {
530+
for _ in 0..100000 {
531531
arena.alloc(Point {
532532
x: 1,
533533
y: 2,
@@ -582,7 +582,7 @@ mod tests {
582582
#[test]
583583
pub fn test_noncopy() {
584584
let arena = TypedArena::new();
585-
for _ in 0u..100000 {
585+
for _ in 0..100000 {
586586
arena.alloc(Noncopy {
587587
string: "hello world".to_string(),
588588
array: vec!( 1, 2, 3, 4, 5 ),

src/libflate/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,14 @@ mod tests {
138138
fn test_flate_round_trip() {
139139
let mut r = rand::thread_rng();
140140
let mut words = vec!();
141-
for _ in 0u..20 {
142-
let range = r.gen_range(1u, 10);
141+
for _ in 0..20 {
142+
let range = r.gen_range(1, 10);
143143
let v = r.gen_iter::<u8>().take(range).collect::<Vec<u8>>();
144144
words.push(v);
145145
}
146-
for _ in 0u..20 {
146+
for _ in 0..20 {
147147
let mut input = vec![];
148-
for _ in 0u..2000 {
148+
for _ in 0..2000 {
149149
input.push_all(r.choose(words.as_slice()).unwrap().as_slice());
150150
}
151151
debug!("de/inflate of {} bytes of random word-sequences",

src/libgetopts/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ pub type Result = result::Result<Matches, Fail>;
227227

228228
impl Name {
229229
fn from_str(nm: &str) -> Name {
230-
if nm.len() == 1u {
231-
Short(nm.char_at(0u))
230+
if nm.len() == 1 {
231+
Short(nm.char_at(0))
232232
} else {
233233
Long(nm.to_string())
234234
}
@@ -694,7 +694,7 @@ pub fn getopts(args: &[String], optgrps: &[OptGroup]) -> Result {
694694
}
695695
i += 1;
696696
}
697-
for i in 0u..n_opts {
697+
for i in 0..n_opts {
698698
let n = vals[i].len();
699699
let occ = opts[i].occur;
700700
if occ == Req && n == 0 {

src/libgraphviz/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ mod tests {
715715

716716
impl<'a> GraphWalk<'a, Node, &'a Edge> for LabelledGraph {
717717
fn nodes(&'a self) -> Nodes<'a,Node> {
718-
(0u..self.node_labels.len()).collect()
718+
(0..self.node_labels.len()).collect()
719719
}
720720
fn edges(&'a self) -> Edges<'a,&'a Edge> {
721721
self.edges.iter().collect()

src/liblibc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1935,7 +1935,7 @@ pub mod types {
19351935
pub iSecurityScheme: c_int,
19361936
pub dwMessageSize: DWORD,
19371937
pub dwProviderReserved: DWORD,
1938-
pub szProtocol: [u8; (WSAPROTOCOL_LEN as uint) + 1u],
1938+
pub szProtocol: [u8; (WSAPROTOCOL_LEN as uint) + 1us],
19391939
}
19401940

19411941
pub type LPWSAPROTOCOL_INFO = *mut WSAPROTOCOL_INFO;

src/liblog/macros.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/// fn main() {
2525
/// log!(log::WARN, "this is a warning {}", "message");
2626
/// log!(log::DEBUG, "this is a debug message");
27-
/// log!(6, "this is a custom logging level: {level}", level=6u);
27+
/// log!(6, "this is a custom logging level: {level}", level=6);
2828
/// }
2929
/// ```
3030
///
@@ -70,7 +70,7 @@ macro_rules! log {
7070
/// #[macro_use] extern crate log;
7171
///
7272
/// fn main() {
73-
/// let error = 3u;
73+
/// let error = 3;
7474
/// error!("the build has failed with error code: {}", error);
7575
/// }
7676
/// ```
@@ -95,7 +95,7 @@ macro_rules! error {
9595
/// #[macro_use] extern crate log;
9696
///
9797
/// fn main() {
98-
/// let code = 3u;
98+
/// let code = 3;
9999
/// warn!("you may like to know that a process exited with: {}", code);
100100
/// }
101101
/// ```

src/librand/chacha.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,9 @@ mod test {
268268
// Store the 17*i-th 32-bit word,
269269
// i.e., the i-th word of the i-th 16-word block
270270
let mut v : Vec<u32> = Vec::new();
271-
for _ in 0u..16 {
271+
for _ in 0..16 {
272272
v.push(ra.next_u32());
273-
for _ in 0u..16 {
273+
for _ in 0..16 {
274274
ra.next_u32();
275275
}
276276
}
@@ -287,7 +287,7 @@ mod test {
287287
let seed : &[_] = &[0u32; 8];
288288
let mut rng: ChaChaRng = SeedableRng::from_seed(seed);
289289
let mut clone = rng.clone();
290-
for _ in 0u..16 {
290+
for _ in 0..16 {
291291
assert_eq!(rng.next_u64(), clone.next_u64());
292292
}
293293
}

src/librand/distributions/exponential.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ mod test {
103103
fn test_exp() {
104104
let mut exp = Exp::new(10.0);
105105
let mut rng = ::test::rng();
106-
for _ in 0u..1000 {
106+
for _ in 0..1000 {
107107
assert!(exp.sample(&mut rng) >= 0.0);
108108
assert!(exp.ind_sample(&mut rng) >= 0.0);
109109
}

src/librand/distributions/gamma.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ mod test {
332332
fn test_chi_squared_one() {
333333
let mut chi = ChiSquared::new(1.0);
334334
let mut rng = ::test::rng();
335-
for _ in 0u..1000 {
335+
for _ in 0..1000 {
336336
chi.sample(&mut rng);
337337
chi.ind_sample(&mut rng);
338338
}
@@ -341,7 +341,7 @@ mod test {
341341
fn test_chi_squared_small() {
342342
let mut chi = ChiSquared::new(0.5);
343343
let mut rng = ::test::rng();
344-
for _ in 0u..1000 {
344+
for _ in 0..1000 {
345345
chi.sample(&mut rng);
346346
chi.ind_sample(&mut rng);
347347
}
@@ -350,7 +350,7 @@ mod test {
350350
fn test_chi_squared_large() {
351351
let mut chi = ChiSquared::new(30.0);
352352
let mut rng = ::test::rng();
353-
for _ in 0u..1000 {
353+
for _ in 0..1000 {
354354
chi.sample(&mut rng);
355355
chi.ind_sample(&mut rng);
356356
}
@@ -365,7 +365,7 @@ mod test {
365365
fn test_f() {
366366
let mut f = FisherF::new(2.0, 32.0);
367367
let mut rng = ::test::rng();
368-
for _ in 0u..1000 {
368+
for _ in 0..1000 {
369369
f.sample(&mut rng);
370370
f.ind_sample(&mut rng);
371371
}
@@ -375,7 +375,7 @@ mod test {
375375
fn test_t() {
376376
let mut t = StudentT::new(11.0);
377377
let mut rng = ::test::rng();
378-
for _ in 0u..1000 {
378+
for _ in 0..1000 {
379379
t.sample(&mut rng);
380380
t.ind_sample(&mut rng);
381381
}

src/librand/distributions/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub struct Weighted<T> {
9797
/// Weighted { weight: 1, item: 'c' });
9898
/// let wc = WeightedChoice::new(items.as_mut_slice());
9999
/// let mut rng = rand::thread_rng();
100-
/// for _ in 0u..16 {
100+
/// for _ in 0..16 {
101101
/// // on average prints 'a' 4 times, 'b' 8 and 'c' twice.
102102
/// println!("{}", wc.ind_sample(&mut rng));
103103
/// }
@@ -118,7 +118,7 @@ impl<'a, T: Clone> WeightedChoice<'a, T> {
118118
// strictly speaking, this is subsumed by the total weight == 0 case
119119
assert!(!items.is_empty(), "WeightedChoice::new called with no items");
120120

121-
let mut running_total = 0u;
121+
let mut running_total = 0;
122122

123123
// we convert the list from individual weights to cumulative
124124
// weights so we can binary search. This *could* drop elements

src/librand/distributions/normal.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ mod tests {
169169
fn test_normal() {
170170
let mut norm = Normal::new(10.0, 10.0);
171171
let mut rng = ::test::rng();
172-
for _ in 0u..1000 {
172+
for _ in 0..1000 {
173173
norm.sample(&mut rng);
174174
norm.ind_sample(&mut rng);
175175
}
@@ -185,7 +185,7 @@ mod tests {
185185
fn test_log_normal() {
186186
let mut lnorm = LogNormal::new(10.0, 10.0);
187187
let mut rng = ::test::rng();
188-
for _ in 0u..1000 {
188+
for _ in 0..1000 {
189189
lnorm.sample(&mut rng);
190190
lnorm.ind_sample(&mut rng);
191191
}

src/librand/distributions/range.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ use distributions::{Sample, IndependentSample};
3838
/// use std::rand::distributions::{IndependentSample, Range};
3939
///
4040
/// fn main() {
41-
/// let between = Range::new(10u, 10000u);
41+
/// let between = Range::new(10, 10000);
4242
/// let mut rng = std::rand::thread_rng();
4343
/// let mut sum = 0;
44-
/// for _ in 0u..1000 {
44+
/// for _ in 0..1000 {
4545
/// sum += between.ind_sample(&mut rng);
4646
/// }
4747
/// println!("{}", sum);
@@ -190,7 +190,7 @@ mod tests {
190190
(Int::min_value(), Int::max_value())];
191191
for &(low, high) in v {
192192
let mut sampler: Range<$ty> = Range::new(low, high);
193-
for _ in 0u..1000 {
193+
for _ in 0..1000 {
194194
let v = sampler.sample(&mut rng);
195195
assert!(low <= v && v < high);
196196
let v = sampler.ind_sample(&mut rng);
@@ -216,7 +216,7 @@ mod tests {
216216
(-1e35, 1e35)];
217217
for &(low, high) in v {
218218
let mut sampler: Range<$ty> = Range::new(low, high);
219-
for _ in 0u..1000 {
219+
for _ in 0..1000 {
220220
let v = sampler.sample(&mut rng);
221221
assert!(low <= v && v < high);
222222
let v = sampler.ind_sample(&mut rng);

0 commit comments

Comments
 (0)