Skip to content

Rollup of PRs in the queue; Monday #22940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Mar 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4dad907
Qualify uses of MethodContext variants.
Ms2ger Feb 28, 2015
57e0248
Various formatting cleanup.
Ms2ger Feb 28, 2015
2a37f7f
Add a comment to code that confused me.
Ms2ger Feb 28, 2015
f38b83b
Avoid unnecessary mutability for UnusedResults.
Ms2ger Feb 28, 2015
8a7b6b3
Collapse nested matches in method_context.
Ms2ger Feb 28, 2015
fe2e097
Use if-let for UnusedImportBraces.
Ms2ger Feb 28, 2015
2fc6224
Rename LintPass::check_trait_method to check_trait_item
ipetkov Feb 28, 2015
9e28cae
Remove int/uint
GuillaumeGomez Feb 18, 2015
c74d49c
Fix errors, remove unused files
GuillaumeGomez Feb 19, 2015
5ef6182
Add check for unbounded due to non-regular types in dropck.
pnkfelix Feb 24, 2015
180ef47
Add regression tests for issue 22443.
pnkfelix Feb 24, 2015
549be5f
Emit proper function argument attributes for closure environments
dotdash Feb 28, 2015
708c385
Use trans_arg_datum in trans_args_under_call_abi
dotdash Feb 28, 2015
df12658
Remove int/uint from libstd/lib.rs
GuillaumeGomez Feb 27, 2015
a71da37
unbreak dragonfly build after nacl integration
semarie Mar 1, 2015
8b6b3c1
Emit proper attributes for the self pointer in method call through tr…
dotdash Mar 1, 2015
fb19cd7
Rollup merge of #22504 - GuillaumeGomez:audit-integer-libcore, r=Mani…
Manishearth Mar 1, 2015
85bdb31
Rollup merge of #22777 - pnkfelix:issue-22443, r=nikomatsakis
Manishearth Mar 1, 2015
ef8b20a
Rollup merge of #22821 - ipetkov:lint-method-rename, r=eddyb
Manishearth Mar 1, 2015
fb28214
Rollup merge of #22893 - Ms2ger:lints, r=huonw
Manishearth Mar 1, 2015
644b931
Rollup merge of #22922 - dotdash:closure_env_attr, r=eddyb
Manishearth Mar 1, 2015
d9b352f
Rollup merge of #22923 - dotdash:trans_arg, r=eddyb
Manishearth Mar 1, 2015
7398071
Rollup merge of #22931 - semarie:dragonfly-ino_t, r=alexcrichton
Manishearth Mar 1, 2015
b79a788
Rollup merge of #22935 - dotdash:method_attr, r=eddyb
Manishearth Mar 1, 2015
1f1c5d5
Ignore issue #16671 test on android (again)
sfackler Dec 6, 2014
c84e3a1
Rollup merge of #22941 - sfackler:re-disable, r=sfackler
Manishearth Mar 1, 2015
6988157
Rollup merge of #22944 - Manishearth:patch-1, r=sfackler
Manishearth Mar 2, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
//! distribution.
//!
//! * `rust_begin_unwind` - This function takes three arguments, a
//! `fmt::Arguments`, a `&str`, and a `uint`. These three arguments dictate
//! `fmt::Arguments`, a `&str`, and a `usize`. These three arguments dictate
//! the panic message, the file at which panic was invoked, and the line.
//! It is up to consumers of this core library to define this panic
//! function; it is only required to never return.
Expand Down Expand Up @@ -88,14 +88,12 @@ mod int_macros;
#[macro_use]
mod uint_macros;

#[path = "num/int.rs"] pub mod int;
#[path = "num/isize.rs"] pub mod isize;
#[path = "num/i8.rs"] pub mod i8;
#[path = "num/i16.rs"] pub mod i16;
#[path = "num/i32.rs"] pub mod i32;
#[path = "num/i64.rs"] pub mod i64;

#[path = "num/uint.rs"] pub mod uint;
#[path = "num/usize.rs"] pub mod usize;
#[path = "num/u8.rs"] pub mod u8;
#[path = "num/u16.rs"] pub mod u16;
Expand Down
21 changes: 0 additions & 21 deletions src/libcore/num/int.rs

This file was deleted.

20 changes: 0 additions & 20 deletions src/libcore/num/uint.rs

This file was deleted.

14 changes: 7 additions & 7 deletions src/libcoretest/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use core::iter::*;
use core::iter::order::*;
use core::iter::MinMaxResult::*;
use core::num::SignedInt;
use core::uint;
use core::usize;
use core::cmp;

use test::Bencher;
Expand Down Expand Up @@ -292,7 +292,7 @@ fn test_unfoldr() {
fn test_cycle() {
let cycle_len = 3;
let it = count(0, 1).take(cycle_len).cycle();
assert_eq!(it.size_hint(), (uint::MAX, None));
assert_eq!(it.size_hint(), (usize::MAX, None));
for (i, x) in it.take(100).enumerate() {
assert_eq!(i % cycle_len, x);
}
Expand Down Expand Up @@ -365,19 +365,19 @@ fn test_iterator_size_hint() {
let v2 = &[10, 11, 12];
let vi = v.iter();

assert_eq!(c.size_hint(), (uint::MAX, None));
assert_eq!(c.size_hint(), (usize::MAX, None));
assert_eq!(vi.clone().size_hint(), (10, Some(10)));

assert_eq!(c.clone().take(5).size_hint(), (5, Some(5)));
assert_eq!(c.clone().skip(5).size_hint().1, None);
assert_eq!(c.clone().take_while(|_| false).size_hint(), (0, None));
assert_eq!(c.clone().skip_while(|_| false).size_hint(), (0, None));
assert_eq!(c.clone().enumerate().size_hint(), (uint::MAX, None));
assert_eq!(c.clone().chain(vi.clone().cloned()).size_hint(), (uint::MAX, None));
assert_eq!(c.clone().enumerate().size_hint(), (usize::MAX, None));
assert_eq!(c.clone().chain(vi.clone().cloned()).size_hint(), (usize::MAX, None));
assert_eq!(c.clone().zip(vi.clone()).size_hint(), (10, Some(10)));
assert_eq!(c.clone().scan(0, |_,_| Some(0)).size_hint(), (0, None));
assert_eq!(c.clone().filter(|_| false).size_hint(), (0, None));
assert_eq!(c.clone().map(|_| 0).size_hint(), (uint::MAX, None));
assert_eq!(c.clone().map(|_| 0).size_hint(), (usize::MAX, None));
assert_eq!(c.filter_map(|_| Some(0)).size_hint(), (0, None));

assert_eq!(vi.clone().take(5).size_hint(), (5, Some(5)));
Expand Down Expand Up @@ -753,7 +753,7 @@ fn test_range() {

assert_eq!((0..100).size_hint(), (100, Some(100)));
// this test is only meaningful when sizeof uint < sizeof u64
assert_eq!((uint::MAX - 1..uint::MAX).size_hint(), (1, Some(1)));
assert_eq!((usize::MAX - 1..usize::MAX).size_hint(), (1, Some(1)));
assert_eq!((-10..-1).size_hint(), (9, Some(9)));
assert_eq!((-1..-10).size_hint(), (0, Some(0)));
}
Expand Down
11 changes: 0 additions & 11 deletions src/libcoretest/num/int.rs

This file was deleted.

4 changes: 2 additions & 2 deletions src/libcoretest/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ macro_rules! int_module { ($T:ty, $T_i:ident) => (
#[cfg(test)]
mod tests {
use core::$T_i::*;
use core::int;
use core::isize;
use core::num::{FromStrRadix, Int, SignedInt};
use core::ops::{Shl, Shr, Not, BitXor, BitAnd, BitOr};
use num;
Expand Down Expand Up @@ -153,7 +153,7 @@ mod tests {
fn test_signed_checked_div() {
assert!(10.checked_div(2) == Some(5));
assert!(5.checked_div(0) == None);
assert!(int::MIN.checked_div(-1) == None);
assert!(isize::MIN.checked_div(-1) == None);
}

#[test]
Expand Down
2 changes: 0 additions & 2 deletions src/libcoretest/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ mod i8;
mod i16;
mod i32;
mod i64;
mod int;

#[macro_use]
mod uint_macros;
Expand All @@ -30,7 +29,6 @@ mod u8;
mod u16;
mod u32;
mod u64;
mod uint;

/// Helper function for testing numeric operations
pub fn test_num<T>(ten: T, two: T) where
Expand Down
11 changes: 0 additions & 11 deletions src/libcoretest/num/uint.rs

This file was deleted.

2 changes: 1 addition & 1 deletion src/libgetopts/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ fn test_split_within() {
"little lamb".to_string(),
"Little lamb".to_string()
]);
t("\nMary had a little lamb\nLittle lamb\n", ::std::uint::MAX,
t("\nMary had a little lamb\nLittle lamb\n", ::std::usize::MAX,
&["Mary had a little lamb\nLittle lamb".to_string()]);
}

Expand Down
1 change: 0 additions & 1 deletion src/liblibc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,6 @@ pub mod types {
pub mod posix88 {
pub type off_t = i64;
pub type dev_t = u32;
pub type ino_t = u32;
pub type pid_t = i32;
pub type uid_t = u32;
pub type gid_t = u32;
Expand Down
24 changes: 12 additions & 12 deletions src/librand/rand_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@

use core::prelude::*;
use core::char;
use core::int;
use core::uint;
use core::isize;
use core::usize;

use {Rand,Rng};

impl Rand for int {
impl Rand for isize {
#[inline]
fn rand<R: Rng>(rng: &mut R) -> int {
if int::BITS == 32 {
rng.gen::<i32>() as int
fn rand<R: Rng>(rng: &mut R) -> isize {
if isize::BITS == 32 {
rng.gen::<i32>() as isize
} else {
rng.gen::<i64>() as int
rng.gen::<i64>() as isize
}
}
}
Expand Down Expand Up @@ -56,13 +56,13 @@ impl Rand for i64 {
}
}

impl Rand for uint {
impl Rand for usize {
#[inline]
fn rand<R: Rng>(rng: &mut R) -> uint {
if uint::BITS == 32 {
rng.gen::<u32>() as uint
fn rand<R: Rng>(rng: &mut R) -> usize {
if usize::BITS == 32 {
rng.gen::<u32>() as usize
} else {
rng.gen::<u64>() as uint
rng.gen::<u64>() as usize
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lint/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for Context<'a, 'tcx> {
}

fn visit_trait_item(&mut self, m: &ast::TraitItem) {
run_lints!(self, check_trait_method, m);
run_lints!(self, check_trait_item, m);
visit::walk_trait_item(self, m);
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ pub trait LintPass {
fn check_fn(&mut self, _: &Context,
_: FnKind, _: &ast::FnDecl, _: &ast::Block, _: Span, _: ast::NodeId) { }
fn check_ty_method(&mut self, _: &Context, _: &ast::TypeMethod) { }
fn check_trait_method(&mut self, _: &Context, _: &ast::TraitItem) { }
fn check_trait_item(&mut self, _: &Context, _: &ast::TraitItem) { }
fn check_struct_def(&mut self, _: &Context,
_: &ast::StructDef, _: ast::Ident, _: &ast::Generics, _: ast::NodeId) { }
fn check_struct_def_post(&mut self, _: &Context,
Expand Down
40 changes: 20 additions & 20 deletions src/librustc/middle/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
//! enclosing function. On the way down the tree, it identifies those AST
//! nodes and variable IDs that will be needed for the liveness analysis
//! and assigns them contiguous IDs. The liveness id for an AST node is
//! called a `live_node` (it's a newtype'd uint) and the id for a variable
//! is called a `variable` (another newtype'd uint).
//! called a `live_node` (it's a newtype'd usize) and the id for a variable
//! is called a `variable` (another newtype'd usize).
//!
//! On the way back up the tree, as we are about to exit from a function
//! declaration we allocate a `liveness` instance. Now that we know
Expand Down Expand Up @@ -118,7 +118,7 @@ use middle::ty::ClosureTyper;
use lint;
use util::nodemap::NodeMap;

use std::{fmt, old_io, uint};
use std::{fmt, old_io, usize};
use std::rc::Rc;
use std::iter::repeat;
use syntax::ast::{self, NodeId, Expr};
Expand All @@ -138,17 +138,17 @@ enum LoopKind<'a> {
}

#[derive(Copy, PartialEq)]
struct Variable(uint);
struct Variable(usize);

#[derive(Copy, PartialEq)]
struct LiveNode(uint);
struct LiveNode(usize);

impl Variable {
fn get(&self) -> uint { let Variable(v) = *self; v }
fn get(&self) -> usize { let Variable(v) = *self; v }
}

impl LiveNode {
fn get(&self) -> uint { let LiveNode(v) = *self; v }
fn get(&self) -> usize { let LiveNode(v) = *self; v }
}

impl Clone for LiveNode {
Expand Down Expand Up @@ -232,11 +232,11 @@ impl fmt::Debug for Variable {

impl LiveNode {
fn is_valid(&self) -> bool {
self.get() != uint::MAX
self.get() != usize::MAX
}
}

fn invalid_node() -> LiveNode { LiveNode(uint::MAX) }
fn invalid_node() -> LiveNode { LiveNode(usize::MAX) }

struct CaptureInfo {
ln: LiveNode,
Expand All @@ -260,8 +260,8 @@ enum VarKind {
struct IrMaps<'a, 'tcx: 'a> {
tcx: &'a ty::ctxt<'tcx>,

num_live_nodes: uint,
num_vars: uint,
num_live_nodes: usize,
num_vars: usize,
live_node_map: NodeMap<LiveNode>,
variable_map: NodeMap<Variable>,
capture_info_map: NodeMap<Rc<Vec<CaptureInfo>>>,
Expand Down Expand Up @@ -540,9 +540,9 @@ struct Specials {
clean_exit_var: Variable
}

static ACC_READ: uint = 1;
static ACC_WRITE: uint = 2;
static ACC_USE: uint = 4;
static ACC_READ: u32 = 1;
static ACC_WRITE: u32 = 2;
static ACC_USE: u32 = 4;

struct Liveness<'a, 'tcx: 'a> {
ir: &'a mut IrMaps<'a, 'tcx>,
Expand Down Expand Up @@ -631,7 +631,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
succ
}

fn idx(&self, ln: LiveNode, var: Variable) -> uint {
fn idx(&self, ln: LiveNode, var: Variable) -> usize {
ln.get() * self.ir.num_vars + var.get()
}

Expand Down Expand Up @@ -670,7 +670,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
}

fn indices2<F>(&mut self, ln: LiveNode, succ_ln: LiveNode, mut op: F) where
F: FnMut(&mut Liveness<'a, 'tcx>, uint, uint),
F: FnMut(&mut Liveness<'a, 'tcx>, usize, usize),
{
let node_base_idx = self.idx(ln, Variable(0));
let succ_base_idx = self.idx(succ_ln, Variable(0));
Expand All @@ -684,7 +684,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
ln: LiveNode,
mut test: F)
-> old_io::IoResult<()> where
F: FnMut(uint) -> LiveNode,
F: FnMut(usize) -> LiveNode,
{
let node_base_idx = self.idx(ln, Variable(0));
for var_idx in 0..self.ir.num_vars {
Expand Down Expand Up @@ -807,7 +807,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
}

// Either read, write, or both depending on the acc bitset
fn acc(&mut self, ln: LiveNode, var: Variable, acc: uint) {
fn acc(&mut self, ln: LiveNode, var: Variable, acc: u32) {
debug!("{:?} accesses[{:x}] {:?}: {}",
ln, acc, var, self.ln_str(ln));

Expand Down Expand Up @@ -1283,7 +1283,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
}

// see comment on propagate_through_lvalue()
fn write_lvalue(&mut self, expr: &Expr, succ: LiveNode, acc: uint)
fn write_lvalue(&mut self, expr: &Expr, succ: LiveNode, acc: u32)
-> LiveNode {
match expr.node {
ast::ExprPath(..) => {
Expand All @@ -1298,7 +1298,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
}
}

fn access_path(&mut self, expr: &Expr, succ: LiveNode, acc: uint)
fn access_path(&mut self, expr: &Expr, succ: LiveNode, acc: u32)
-> LiveNode {
match self.ir.tcx.def_map.borrow()[expr.id].full_def() {
DefLocal(nid) => {
Expand Down
Loading