Skip to content

Commit 758a296

Browse files
committed
Auto merge of #21647 - alfie:suffix-medium, r=alexcrichton
2 parents ca4b967 + 00a933f commit 758a296

40 files changed

+201
-201
lines changed

src/liballoc/arc.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
//!
4040
//! let five = Arc::new(5);
4141
//!
42-
//! for _ in 0u..10 {
42+
//! for _ in 0..10 {
4343
//! let five = five.clone();
4444
//!
4545
//! Thread::spawn(move || {
@@ -56,7 +56,7 @@
5656
//!
5757
//! let five = Arc::new(Mutex::new(5));
5858
//!
59-
//! for _ in 0u..10 {
59+
//! for _ in 0..10 {
6060
//! let five = five.clone();
6161
//!
6262
//! Thread::spawn(move || {
@@ -101,7 +101,7 @@ use heap::deallocate;
101101
/// let numbers: Vec<_> = (0..100u32).map(|i| i as f32).collect();
102102
/// let shared_numbers = Arc::new(numbers);
103103
///
104-
/// for _ in 0u..10 {
104+
/// for _ in 0..10 {
105105
/// let child_numbers = shared_numbers.clone();
106106
///
107107
/// Thread::spawn(move || {
@@ -661,7 +661,7 @@ mod tests {
661661

662662
#[test]
663663
fn test_cowarc_clone_make_unique() {
664-
let mut cow0 = Arc::new(75u);
664+
let mut cow0 = Arc::new(75);
665665
let mut cow1 = cow0.clone();
666666
let mut cow2 = cow1.clone();
667667

@@ -685,7 +685,7 @@ mod tests {
685685

686686
#[test]
687687
fn test_cowarc_clone_unique2() {
688-
let mut cow0 = Arc::new(75u);
688+
let mut cow0 = Arc::new(75);
689689
let cow1 = cow0.clone();
690690
let cow2 = cow1.clone();
691691

@@ -708,7 +708,7 @@ mod tests {
708708

709709
#[test]
710710
fn test_cowarc_clone_weak() {
711-
let mut cow0 = Arc::new(75u);
711+
let mut cow0 = Arc::new(75);
712712
let cow1_weak = cow0.downgrade();
713713

714714
assert!(75 == *cow0);

src/liballoc/boxed_test.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ struct Test;
3131

3232
#[test]
3333
fn any_move() {
34-
let a = Box::new(8u) as Box<Any>;
34+
let a = Box::new(8us) as Box<Any>;
3535
let b = Box::new(Test) as Box<Any>;
3636

3737
match a.downcast::<uint>() {
38-
Ok(a) => { assert!(a == Box::new(8u)); }
38+
Ok(a) => { assert!(a == Box::new(8us)); }
3939
Err(..) => panic!()
4040
}
4141
match b.downcast::<Test>() {
4242
Ok(a) => { assert!(a == Box::new(Test)); }
4343
Err(..) => panic!()
4444
}
4545

46-
let a = Box::new(8u) as Box<Any>;
46+
let a = Box::new(8) as Box<Any>;
4747
let b = Box::new(Test) as Box<Any>;
4848

4949
assert!(a.downcast::<Box<Test>>().is_err());
@@ -52,14 +52,14 @@ fn any_move() {
5252

5353
#[test]
5454
fn test_show() {
55-
let a = Box::new(8u) as Box<Any>;
55+
let a = Box::new(8) as Box<Any>;
5656
let b = Box::new(Test) as Box<Any>;
5757
let a_str = format!("{:?}", a);
5858
let b_str = format!("{:?}", b);
5959
assert_eq!(a_str, "Box<Any>");
6060
assert_eq!(b_str, "Box<Any>");
6161

62-
static EIGHT: usize = 8us;
62+
static EIGHT: usize = 8;
6363
static TEST: Test = Test;
6464
let a = &EIGHT as &Any;
6565
let b = &TEST as &Any;

src/liballoc/rc.rs

+21-21
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,12 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool {
266266
/// ```
267267
/// use std::rc::{self, Rc};
268268
///
269-
/// let x = Rc::new(3u);
270-
/// assert_eq!(rc::try_unwrap(x), Ok(3u));
269+
/// let x = Rc::new(3);
270+
/// assert_eq!(rc::try_unwrap(x), Ok(3));
271271
///
272-
/// let x = Rc::new(4u);
272+
/// let x = Rc::new(4);
273273
/// let _y = x.clone();
274-
/// assert_eq!(rc::try_unwrap(x), Err(Rc::new(4u)));
274+
/// assert_eq!(rc::try_unwrap(x), Err(Rc::new(4)));
275275
/// ```
276276
#[inline]
277277
#[unstable(feature = "alloc")]
@@ -300,9 +300,9 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
300300
/// ```
301301
/// use std::rc::{self, Rc};
302302
///
303-
/// let mut x = Rc::new(3u);
304-
/// *rc::get_mut(&mut x).unwrap() = 4u;
305-
/// assert_eq!(*x, 4u);
303+
/// let mut x = Rc::new(3);
304+
/// *rc::get_mut(&mut x).unwrap() = 4;
305+
/// assert_eq!(*x, 4);
306306
///
307307
/// let _y = x.clone();
308308
/// assert!(rc::get_mut(&mut x).is_none());
@@ -845,7 +845,7 @@ mod tests {
845845

846846
#[test]
847847
fn is_unique() {
848-
let x = Rc::new(3u);
848+
let x = Rc::new(3);
849849
assert!(super::is_unique(&x));
850850
let y = x.clone();
851851
assert!(!super::is_unique(&x));
@@ -893,21 +893,21 @@ mod tests {
893893

894894
#[test]
895895
fn try_unwrap() {
896-
let x = Rc::new(3u);
897-
assert_eq!(super::try_unwrap(x), Ok(3u));
898-
let x = Rc::new(4u);
896+
let x = Rc::new(3);
897+
assert_eq!(super::try_unwrap(x), Ok(3));
898+
let x = Rc::new(4);
899899
let _y = x.clone();
900-
assert_eq!(super::try_unwrap(x), Err(Rc::new(4u)));
901-
let x = Rc::new(5u);
900+
assert_eq!(super::try_unwrap(x), Err(Rc::new(4)));
901+
let x = Rc::new(5);
902902
let _w = x.downgrade();
903-
assert_eq!(super::try_unwrap(x), Err(Rc::new(5u)));
903+
assert_eq!(super::try_unwrap(x), Err(Rc::new(5)));
904904
}
905905

906906
#[test]
907907
fn get_mut() {
908-
let mut x = Rc::new(3u);
909-
*super::get_mut(&mut x).unwrap() = 4u;
910-
assert_eq!(*x, 4u);
908+
let mut x = Rc::new(3);
909+
*super::get_mut(&mut x).unwrap() = 4;
910+
assert_eq!(*x, 4);
911911
let y = x.clone();
912912
assert!(super::get_mut(&mut x).is_none());
913913
drop(y);
@@ -918,7 +918,7 @@ mod tests {
918918

919919
#[test]
920920
fn test_cowrc_clone_make_unique() {
921-
let mut cow0 = Rc::new(75u);
921+
let mut cow0 = Rc::new(75);
922922
let mut cow1 = cow0.clone();
923923
let mut cow2 = cow1.clone();
924924

@@ -942,7 +942,7 @@ mod tests {
942942

943943
#[test]
944944
fn test_cowrc_clone_unique2() {
945-
let mut cow0 = Rc::new(75u);
945+
let mut cow0 = Rc::new(75);
946946
let cow1 = cow0.clone();
947947
let cow2 = cow1.clone();
948948

@@ -965,7 +965,7 @@ mod tests {
965965

966966
#[test]
967967
fn test_cowrc_clone_weak() {
968-
let mut cow0 = Rc::new(75u);
968+
let mut cow0 = Rc::new(75);
969969
let cow1_weak = cow0.downgrade();
970970

971971
assert!(75 == *cow0);
@@ -979,7 +979,7 @@ mod tests {
979979

980980
#[test]
981981
fn test_show() {
982-
let foo = Rc::new(75u);
982+
let foo = Rc::new(75);
983983
assert_eq!(format!("{:?}", foo), "75");
984984
}
985985

src/librustc/lint/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ pub struct BoxPointers;
493493
impl BoxPointers {
494494
fn check_heap_type<'a, 'tcx>(&self, cx: &Context<'a, 'tcx>,
495495
span: Span, ty: Ty<'tcx>) {
496-
let mut n_uniq = 0u;
496+
let mut n_uniq = 0us;
497497
ty::fold_ty(cx.tcx, ty, |t| {
498498
match t.sty {
499499
ty::ty_uniq(_) => {

src/librustc/lint/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
490490
// current dictionary of lint information. Along the way, keep a history
491491
// of what we changed so we can roll everything back after invoking the
492492
// specified closure
493-
let mut pushed = 0u;
493+
let mut pushed = 0;
494494

495495
for result in gather_attrs(attrs).into_iter() {
496496
let v = match result {

src/librustc/metadata/decoder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub fn maybe_find_item<'a>(item_id: ast::NodeId,
8888
items: rbml::Doc<'a>) -> Option<rbml::Doc<'a>> {
8989
fn eq_item(bytes: &[u8], item_id: ast::NodeId) -> bool {
9090
return u64_from_be_bytes(
91-
&bytes[0u..4u], 0u, 4u) as ast::NodeId
91+
&bytes[0..4], 0, 4) as ast::NodeId
9292
== item_id;
9393
}
9494
lookup_hash(items,
@@ -1164,7 +1164,7 @@ fn get_attributes(md: rbml::Doc) -> Vec<ast::Attribute> {
11641164
let meta_items = get_meta_items(attr_doc);
11651165
// Currently it's only possible to have a single meta item on
11661166
// an attribute
1167-
assert_eq!(meta_items.len(), 1u);
1167+
assert_eq!(meta_items.len(), 1);
11681168
let meta_item = meta_items.into_iter().nth(0).unwrap();
11691169
attrs.push(
11701170
codemap::Spanned {

src/librustc/metadata/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
10601060
encode_name(rbml_w, item.ident.name);
10611061
encode_path(rbml_w, path);
10621062
encode_attributes(rbml_w, &item.attrs[]);
1063-
if tps_len > 0u || should_inline(&item.attrs[]) {
1063+
if tps_len > 0 || should_inline(&item.attrs[]) {
10641064
encode_inlined_item(ecx, rbml_w, IIItemRef(item));
10651065
}
10661066
if tps_len == 0 {

src/librustc/metadata/loader.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ impl<'a> Context<'a> {
487487
fn extract_one(&mut self, m: HashMap<Path, PathKind>, flavor: &str,
488488
slot: &mut Option<MetadataBlob>) -> Option<(Path, PathKind)> {
489489
let mut ret = None::<(Path, PathKind)>;
490-
let mut error = 0u;
490+
let mut error = 0;
491491

492492
if slot.is_some() {
493493
// FIXME(#10786): for an optimization, we only read one of the

src/librustc/metadata/tydecode.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ fn peek(st: &PState) -> char {
7676

7777
fn next(st: &mut PState) -> char {
7878
let ch = st.data[st.pos] as char;
79-
st.pos = st.pos + 1u;
79+
st.pos = st.pos + 1;
8080
return ch;
8181
}
8282

8383
fn next_byte(st: &mut PState) -> u8 {
8484
let b = st.data[st.pos];
85-
st.pos = st.pos + 1u;
85+
st.pos = st.pos + 1;
8686
return b;
8787
}
8888

@@ -498,7 +498,7 @@ fn parse_ty_<'a, 'tcx, F>(st: &mut PState<'a, 'tcx>, conv: &mut F) -> Ty<'tcx> w
498498
assert_eq!(next(st), '[');
499499
let mut params = Vec::new();
500500
while peek(st) != ']' { params.push(parse_ty_(st, conv)); }
501-
st.pos = st.pos + 1u;
501+
st.pos = st.pos + 1;
502502
return ty::mk_tup(tcx, params);
503503
}
504504
'F' => {
@@ -590,7 +590,7 @@ fn parse_uint(st: &mut PState) -> uint {
590590
loop {
591591
let cur = peek(st);
592592
if cur < '0' || cur > '9' { return n; }
593-
st.pos = st.pos + 1u;
593+
st.pos = st.pos + 1;
594594
n *= 10;
595595
n += (cur as uint) - ('0' as uint);
596596
};
@@ -608,15 +608,15 @@ fn parse_param_space(st: &mut PState) -> subst::ParamSpace {
608608
}
609609

610610
fn parse_hex(st: &mut PState) -> uint {
611-
let mut n = 0u;
611+
let mut n = 0;
612612
loop {
613613
let cur = peek(st);
614614
if (cur < '0' || cur > '9') && (cur < 'a' || cur > 'f') { return n; }
615-
st.pos = st.pos + 1u;
616-
n *= 16u;
615+
st.pos = st.pos + 1;
616+
n *= 16;
617617
if '0' <= cur && cur <= '9' {
618618
n += (cur as uint) - ('0' as uint);
619-
} else { n += 10u + (cur as uint) - ('a' as uint); }
619+
} else { n += 10 + (cur as uint) - ('a' as uint); }
620620
};
621621
}
622622

@@ -686,15 +686,15 @@ fn parse_sig_<'a, 'tcx, F>(st: &mut PState<'a, 'tcx>, conv: &mut F) -> ty::PolyF
686686
while peek(st) != ']' {
687687
inputs.push(parse_ty_(st, conv));
688688
}
689-
st.pos += 1u; // eat the ']'
689+
st.pos += 1; // eat the ']'
690690
let variadic = match next(st) {
691691
'V' => true,
692692
'N' => false,
693693
r => panic!(format!("bad variadic: {}", r)),
694694
};
695695
let output = match peek(st) {
696696
'z' => {
697-
st.pos += 1u;
697+
st.pos += 1;
698698
ty::FnDiverging
699699
}
700700
_ => ty::FnConverging(parse_ty_(st, conv))
@@ -706,16 +706,16 @@ fn parse_sig_<'a, 'tcx, F>(st: &mut PState<'a, 'tcx>, conv: &mut F) -> ty::PolyF
706706

707707
// Rust metadata parsing
708708
pub fn parse_def_id(buf: &[u8]) -> ast::DefId {
709-
let mut colon_idx = 0u;
709+
let mut colon_idx = 0;
710710
let len = buf.len();
711-
while colon_idx < len && buf[colon_idx] != ':' as u8 { colon_idx += 1u; }
711+
while colon_idx < len && buf[colon_idx] != ':' as u8 { colon_idx += 1; }
712712
if colon_idx == len {
713713
error!("didn't find ':' when parsing def id");
714714
panic!();
715715
}
716716

717-
let crate_part = &buf[0u..colon_idx];
718-
let def_part = &buf[colon_idx + 1u..len];
717+
let crate_part = &buf[0..colon_idx];
718+
let def_part = &buf[colon_idx + 1..len];
719719

720720
let crate_num = match str::from_utf8(crate_part).ok().and_then(|s| {
721721
s.parse::<uint>().ok()

src/librustc/middle/astconv_util.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ pub const NO_TPS: uint = 2;
2525
pub fn check_path_args(tcx: &ty::ctxt,
2626
path: &ast::Path,
2727
flags: uint) {
28-
if (flags & NO_TPS) != 0u {
28+
if (flags & NO_TPS) != 0 {
2929
if path.segments.iter().any(|s| s.parameters.has_types()) {
3030
span_err!(tcx.sess, path.span, E0109,
3131
"type parameters are not allowed on this type");
3232
}
3333
}
3434

35-
if (flags & NO_REGIONS) != 0u {
35+
if (flags & NO_REGIONS) != 0 {
3636
if path.segments.iter().any(|s| s.parameters.has_lifetimes()) {
3737
span_err!(tcx.sess, path.span, E0110,
3838
"region parameters are not allowed on this type");

0 commit comments

Comments
 (0)