Skip to content

Commit

Permalink
Auto merge of #21647 - alfie:suffix-medium, r=alexcrichton
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Feb 2, 2015
2 parents ca4b967 + 00a933f commit 758a296
Show file tree
Hide file tree
Showing 40 changed files with 201 additions and 201 deletions.
12 changes: 6 additions & 6 deletions src/liballoc/arc.rs
Expand Up @@ -39,7 +39,7 @@
//!
//! let five = Arc::new(5);
//!
//! for _ in 0u..10 {
//! for _ in 0..10 {
//! let five = five.clone();
//!
//! Thread::spawn(move || {
Expand All @@ -56,7 +56,7 @@
//!
//! let five = Arc::new(Mutex::new(5));
//!
//! for _ in 0u..10 {
//! for _ in 0..10 {
//! let five = five.clone();
//!
//! Thread::spawn(move || {
Expand Down Expand Up @@ -101,7 +101,7 @@ use heap::deallocate;
/// let numbers: Vec<_> = (0..100u32).map(|i| i as f32).collect();
/// let shared_numbers = Arc::new(numbers);
///
/// for _ in 0u..10 {
/// for _ in 0..10 {
/// let child_numbers = shared_numbers.clone();
///
/// Thread::spawn(move || {
Expand Down Expand Up @@ -661,7 +661,7 @@ mod tests {

#[test]
fn test_cowarc_clone_make_unique() {
let mut cow0 = Arc::new(75u);
let mut cow0 = Arc::new(75);
let mut cow1 = cow0.clone();
let mut cow2 = cow1.clone();

Expand All @@ -685,7 +685,7 @@ mod tests {

#[test]
fn test_cowarc_clone_unique2() {
let mut cow0 = Arc::new(75u);
let mut cow0 = Arc::new(75);
let cow1 = cow0.clone();
let cow2 = cow1.clone();

Expand All @@ -708,7 +708,7 @@ mod tests {

#[test]
fn test_cowarc_clone_weak() {
let mut cow0 = Arc::new(75u);
let mut cow0 = Arc::new(75);
let cow1_weak = cow0.downgrade();

assert!(75 == *cow0);
Expand Down
10 changes: 5 additions & 5 deletions src/liballoc/boxed_test.rs
Expand Up @@ -31,19 +31,19 @@ struct Test;

#[test]
fn any_move() {
let a = Box::new(8u) as Box<Any>;
let a = Box::new(8us) as Box<Any>;
let b = Box::new(Test) as Box<Any>;

match a.downcast::<uint>() {
Ok(a) => { assert!(a == Box::new(8u)); }
Ok(a) => { assert!(a == Box::new(8us)); }
Err(..) => panic!()
}
match b.downcast::<Test>() {
Ok(a) => { assert!(a == Box::new(Test)); }
Err(..) => panic!()
}

let a = Box::new(8u) as Box<Any>;
let a = Box::new(8) as Box<Any>;
let b = Box::new(Test) as Box<Any>;

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

#[test]
fn test_show() {
let a = Box::new(8u) as Box<Any>;
let a = Box::new(8) as Box<Any>;
let b = Box::new(Test) as Box<Any>;
let a_str = format!("{:?}", a);
let b_str = format!("{:?}", b);
assert_eq!(a_str, "Box<Any>");
assert_eq!(b_str, "Box<Any>");

static EIGHT: usize = 8us;
static EIGHT: usize = 8;
static TEST: Test = Test;
let a = &EIGHT as &Any;
let b = &TEST as &Any;
Expand Down
42 changes: 21 additions & 21 deletions src/liballoc/rc.rs
Expand Up @@ -266,12 +266,12 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool {
/// ```
/// use std::rc::{self, Rc};
///
/// let x = Rc::new(3u);
/// assert_eq!(rc::try_unwrap(x), Ok(3u));
/// let x = Rc::new(3);
/// assert_eq!(rc::try_unwrap(x), Ok(3));
///
/// let x = Rc::new(4u);
/// let x = Rc::new(4);
/// let _y = x.clone();
/// assert_eq!(rc::try_unwrap(x), Err(Rc::new(4u)));
/// assert_eq!(rc::try_unwrap(x), Err(Rc::new(4)));
/// ```
#[inline]
#[unstable(feature = "alloc")]
Expand Down Expand Up @@ -300,9 +300,9 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
/// ```
/// use std::rc::{self, Rc};
///
/// let mut x = Rc::new(3u);
/// *rc::get_mut(&mut x).unwrap() = 4u;
/// assert_eq!(*x, 4u);
/// let mut x = Rc::new(3);
/// *rc::get_mut(&mut x).unwrap() = 4;
/// assert_eq!(*x, 4);
///
/// let _y = x.clone();
/// assert!(rc::get_mut(&mut x).is_none());
Expand Down Expand Up @@ -845,7 +845,7 @@ mod tests {

#[test]
fn is_unique() {
let x = Rc::new(3u);
let x = Rc::new(3);
assert!(super::is_unique(&x));
let y = x.clone();
assert!(!super::is_unique(&x));
Expand Down Expand Up @@ -893,21 +893,21 @@ mod tests {

#[test]
fn try_unwrap() {
let x = Rc::new(3u);
assert_eq!(super::try_unwrap(x), Ok(3u));
let x = Rc::new(4u);
let x = Rc::new(3);
assert_eq!(super::try_unwrap(x), Ok(3));
let x = Rc::new(4);
let _y = x.clone();
assert_eq!(super::try_unwrap(x), Err(Rc::new(4u)));
let x = Rc::new(5u);
assert_eq!(super::try_unwrap(x), Err(Rc::new(4)));
let x = Rc::new(5);
let _w = x.downgrade();
assert_eq!(super::try_unwrap(x), Err(Rc::new(5u)));
assert_eq!(super::try_unwrap(x), Err(Rc::new(5)));
}

#[test]
fn get_mut() {
let mut x = Rc::new(3u);
*super::get_mut(&mut x).unwrap() = 4u;
assert_eq!(*x, 4u);
let mut x = Rc::new(3);
*super::get_mut(&mut x).unwrap() = 4;
assert_eq!(*x, 4);
let y = x.clone();
assert!(super::get_mut(&mut x).is_none());
drop(y);
Expand All @@ -918,7 +918,7 @@ mod tests {

#[test]
fn test_cowrc_clone_make_unique() {
let mut cow0 = Rc::new(75u);
let mut cow0 = Rc::new(75);
let mut cow1 = cow0.clone();
let mut cow2 = cow1.clone();

Expand All @@ -942,7 +942,7 @@ mod tests {

#[test]
fn test_cowrc_clone_unique2() {
let mut cow0 = Rc::new(75u);
let mut cow0 = Rc::new(75);
let cow1 = cow0.clone();
let cow2 = cow1.clone();

Expand All @@ -965,7 +965,7 @@ mod tests {

#[test]
fn test_cowrc_clone_weak() {
let mut cow0 = Rc::new(75u);
let mut cow0 = Rc::new(75);
let cow1_weak = cow0.downgrade();

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

#[test]
fn test_show() {
let foo = Rc::new(75u);
let foo = Rc::new(75);
assert_eq!(format!("{:?}", foo), "75");
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lint/builtin.rs
Expand Up @@ -493,7 +493,7 @@ pub struct BoxPointers;
impl BoxPointers {
fn check_heap_type<'a, 'tcx>(&self, cx: &Context<'a, 'tcx>,
span: Span, ty: Ty<'tcx>) {
let mut n_uniq = 0u;
let mut n_uniq = 0us;
ty::fold_ty(cx.tcx, ty, |t| {
match t.sty {
ty::ty_uniq(_) => {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lint/context.rs
Expand Up @@ -490,7 +490,7 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
// current dictionary of lint information. Along the way, keep a history
// of what we changed so we can roll everything back after invoking the
// specified closure
let mut pushed = 0u;
let mut pushed = 0;

for result in gather_attrs(attrs).into_iter() {
let v = match result {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/metadata/decoder.rs
Expand Up @@ -88,7 +88,7 @@ pub fn maybe_find_item<'a>(item_id: ast::NodeId,
items: rbml::Doc<'a>) -> Option<rbml::Doc<'a>> {
fn eq_item(bytes: &[u8], item_id: ast::NodeId) -> bool {
return u64_from_be_bytes(
&bytes[0u..4u], 0u, 4u) as ast::NodeId
&bytes[0..4], 0, 4) as ast::NodeId
== item_id;
}
lookup_hash(items,
Expand Down Expand Up @@ -1164,7 +1164,7 @@ fn get_attributes(md: rbml::Doc) -> Vec<ast::Attribute> {
let meta_items = get_meta_items(attr_doc);
// Currently it's only possible to have a single meta item on
// an attribute
assert_eq!(meta_items.len(), 1u);
assert_eq!(meta_items.len(), 1);
let meta_item = meta_items.into_iter().nth(0).unwrap();
attrs.push(
codemap::Spanned {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/metadata/encoder.rs
Expand Up @@ -1060,7 +1060,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
encode_name(rbml_w, item.ident.name);
encode_path(rbml_w, path);
encode_attributes(rbml_w, &item.attrs[]);
if tps_len > 0u || should_inline(&item.attrs[]) {
if tps_len > 0 || should_inline(&item.attrs[]) {
encode_inlined_item(ecx, rbml_w, IIItemRef(item));
}
if tps_len == 0 {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/metadata/loader.rs
Expand Up @@ -487,7 +487,7 @@ impl<'a> Context<'a> {
fn extract_one(&mut self, m: HashMap<Path, PathKind>, flavor: &str,
slot: &mut Option<MetadataBlob>) -> Option<(Path, PathKind)> {
let mut ret = None::<(Path, PathKind)>;
let mut error = 0u;
let mut error = 0;

if slot.is_some() {
// FIXME(#10786): for an optimization, we only read one of the
Expand Down
28 changes: 14 additions & 14 deletions src/librustc/metadata/tydecode.rs
Expand Up @@ -76,13 +76,13 @@ fn peek(st: &PState) -> char {

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

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

Expand Down Expand Up @@ -498,7 +498,7 @@ fn parse_ty_<'a, 'tcx, F>(st: &mut PState<'a, 'tcx>, conv: &mut F) -> Ty<'tcx> w
assert_eq!(next(st), '[');
let mut params = Vec::new();
while peek(st) != ']' { params.push(parse_ty_(st, conv)); }
st.pos = st.pos + 1u;
st.pos = st.pos + 1;
return ty::mk_tup(tcx, params);
}
'F' => {
Expand Down Expand Up @@ -590,7 +590,7 @@ fn parse_uint(st: &mut PState) -> uint {
loop {
let cur = peek(st);
if cur < '0' || cur > '9' { return n; }
st.pos = st.pos + 1u;
st.pos = st.pos + 1;
n *= 10;
n += (cur as uint) - ('0' as uint);
};
Expand All @@ -608,15 +608,15 @@ fn parse_param_space(st: &mut PState) -> subst::ParamSpace {
}

fn parse_hex(st: &mut PState) -> uint {
let mut n = 0u;
let mut n = 0;
loop {
let cur = peek(st);
if (cur < '0' || cur > '9') && (cur < 'a' || cur > 'f') { return n; }
st.pos = st.pos + 1u;
n *= 16u;
st.pos = st.pos + 1;
n *= 16;
if '0' <= cur && cur <= '9' {
n += (cur as uint) - ('0' as uint);
} else { n += 10u + (cur as uint) - ('a' as uint); }
} else { n += 10 + (cur as uint) - ('a' as uint); }
};
}

Expand Down Expand Up @@ -686,15 +686,15 @@ fn parse_sig_<'a, 'tcx, F>(st: &mut PState<'a, 'tcx>, conv: &mut F) -> ty::PolyF
while peek(st) != ']' {
inputs.push(parse_ty_(st, conv));
}
st.pos += 1u; // eat the ']'
st.pos += 1; // eat the ']'
let variadic = match next(st) {
'V' => true,
'N' => false,
r => panic!(format!("bad variadic: {}", r)),
};
let output = match peek(st) {
'z' => {
st.pos += 1u;
st.pos += 1;
ty::FnDiverging
}
_ => ty::FnConverging(parse_ty_(st, conv))
Expand All @@ -706,16 +706,16 @@ fn parse_sig_<'a, 'tcx, F>(st: &mut PState<'a, 'tcx>, conv: &mut F) -> ty::PolyF

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

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

let crate_num = match str::from_utf8(crate_part).ok().and_then(|s| {
s.parse::<uint>().ok()
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/astconv_util.rs
Expand Up @@ -25,14 +25,14 @@ pub const NO_TPS: uint = 2;
pub fn check_path_args(tcx: &ty::ctxt,
path: &ast::Path,
flags: uint) {
if (flags & NO_TPS) != 0u {
if (flags & NO_TPS) != 0 {
if path.segments.iter().any(|s| s.parameters.has_types()) {
span_err!(tcx.sess, path.span, E0109,
"type parameters are not allowed on this type");
}
}

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

0 comments on commit 758a296

Please sign in to comment.