diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/io.rs | 16 | ||||
| -rw-r--r-- | src/libcore/rt/stack.rs | 4 | ||||
| -rw-r--r-- | src/libcore/rt/uv/mod.rs | 7 | ||||
| -rw-r--r-- | src/libcore/rt/uv/uvio.rs | 1 | ||||
| -rw-r--r-- | src/libcore/unstable/lang.rs | 1 | ||||
| -rw-r--r-- | src/librustc/middle/borrowck/gather_loans/lifetime.rs | 1 | ||||
| -rw-r--r-- | src/librustc/middle/borrowck/gather_loans/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustc/middle/borrowck/gather_loans/restrictions.rs | 1 | ||||
| -rw-r--r-- | src/librustc/middle/borrowck/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustc/middle/dataflow.rs | 1 | ||||
| -rw-r--r-- | src/librustc/middle/trans/consts.rs | 1 | ||||
| -rw-r--r-- | src/librustc/middle/trans/expr.rs | 2 | ||||
| -rw-r--r-- | src/librustc/middle/typeck/infer/combine.rs | 2 | ||||
| -rw-r--r-- | src/librustc/middle/typeck/infer/lattice.rs | 2 | ||||
| -rw-r--r-- | src/librustpkg/util.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/opt_vec.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 |
17 files changed, 21 insertions, 29 deletions
diff --git a/src/libcore/io.rs b/src/libcore/io.rs index 2ffd362519f..aa312742e3e 100644 --- a/src/libcore/io.rs +++ b/src/libcore/io.rs @@ -114,14 +114,16 @@ pub trait Reader { // FIXME (#2982): This should probably return an error. /** - * Reads bytes and puts them into `bytes`. Returns the number of - * bytes read. + * Reads bytes and puts them into `bytes`, advancing the cursor. Returns the + * number of bytes read. * * The number of bytes to be read is `len` or the end of the file, * whichever comes first. * * The buffer must be at least `len` bytes long. * + * `read` is conceptually similar to C's `fread` function. + * * # Examples * * None right now. @@ -129,10 +131,12 @@ pub trait Reader { fn read(&self, bytes: &mut [u8], len: uint) -> uint; /** - * Reads a single byte. + * Reads a single byte, advancing the cursor. * * In the case of an EOF or an error, returns a negative value. * + * `read_byte` is conceptually similar to C's `getc` function. + * * # Examples * * None right now. @@ -142,6 +146,8 @@ pub trait Reader { /** * Returns a boolean value: are we currently at EOF? * + * `eof` is conceptually similar to C's `feof` function. + * * # Examples * * None right now. @@ -154,6 +160,8 @@ pub trait Reader { * Takes an optional SeekStyle, which affects how we seek from the * position. See `SeekStyle` docs for more details. * + * `seek` is conceptually similar to C's `fseek` function. + * * # Examples * * None right now. @@ -163,6 +171,8 @@ pub trait Reader { /** * Returns the current position within the stream. * + * `tell` is conceptually similar to C's `ftell` function. + * * # Examples * * None right now. diff --git a/src/libcore/rt/stack.rs b/src/libcore/rt/stack.rs index cab9c3390b2..ec56e65931c 100644 --- a/src/libcore/rt/stack.rs +++ b/src/libcore/rt/stack.rs @@ -39,9 +39,7 @@ pub impl StackSegment { /// Point to the low end of the allocated stack fn start(&self) -> *uint { - unsafe { - vec::raw::to_ptr(self.buf) as *uint - } + vec::raw::to_ptr(self.buf) as *uint } /// Point one word beyond the high end of the allocated stack diff --git a/src/libcore/rt/uv/mod.rs b/src/libcore/rt/uv/mod.rs index ad593058303..2bd657fd864 100644 --- a/src/libcore/rt/uv/mod.rs +++ b/src/libcore/rt/uv/mod.rs @@ -44,9 +44,6 @@ use vec; use ptr; use cast; use str; -use option::*; -use str::raw::from_c_str; -use to_str::ToStr; use libc::{c_void, c_int, size_t, malloc, free}; use cast::transmute; use ptr::null; @@ -273,8 +270,8 @@ pub fn uv_error_to_io_error(uverr: UvError) -> IoError { ECONNREFUSED => ConnectionRefused, ECONNRESET => ConnectionReset, EPIPE => BrokenPipe, - e => { - rtdebug!("e %u", e as uint); + _ => { + rtdebug!("uverr.code %u", uverr.code as uint); // XXX: Need to map remaining uv error types OtherIoError } diff --git a/src/libcore/rt/uv/uvio.rs b/src/libcore/rt/uv/uvio.rs index 8666d43a100..8aa1860f352 100644 --- a/src/libcore/rt/uv/uvio.rs +++ b/src/libcore/rt/uv/uvio.rs @@ -11,7 +11,6 @@ use option::*; use result::*; use ops::Drop; -use old_iter::CopyableIter; use cell::{Cell, empty_cell}; use cast::transmute; use clone::Clone; diff --git a/src/libcore/unstable/lang.rs b/src/libcore/unstable/lang.rs index 4b599d7562b..1ae657849c4 100644 --- a/src/libcore/unstable/lang.rs +++ b/src/libcore/unstable/lang.rs @@ -16,7 +16,6 @@ use libc::{c_char, c_uchar, c_void, size_t, uintptr_t, c_int, STDERR_FILENO}; use managed::raw::BoxRepr; use str; use sys; -use cast::transmute; use rt::{context, OldTaskContext}; use rt::local_services::borrow_local_services; use option::{Option, Some, None}; diff --git a/src/librustc/middle/borrowck/gather_loans/lifetime.rs b/src/librustc/middle/borrowck/gather_loans/lifetime.rs index e377bebcc26..4916a827ccd 100644 --- a/src/librustc/middle/borrowck/gather_loans/lifetime.rs +++ b/src/librustc/middle/borrowck/gather_loans/lifetime.rs @@ -11,7 +11,6 @@ //! This module implements the check that the lifetime of a borrow //! does not exceed the lifetime of the value being borrowed. -use core::prelude::*; use middle::borrowck::*; use mc = middle::mem_categorization; use middle::ty; diff --git a/src/librustc/middle/borrowck/gather_loans/mod.rs b/src/librustc/middle/borrowck/gather_loans/mod.rs index a422d99b6f5..3d2c318a87e 100644 --- a/src/librustc/middle/borrowck/gather_loans/mod.rs +++ b/src/librustc/middle/borrowck/gather_loans/mod.rs @@ -16,8 +16,6 @@ // their associated scopes. In phase two, checking loans, we will then make // sure that all of these loans are honored. -use core::prelude::*; - use middle::borrowck::*; use mc = middle::mem_categorization; use middle::pat_util; diff --git a/src/librustc/middle/borrowck/gather_loans/restrictions.rs b/src/librustc/middle/borrowck/gather_loans/restrictions.rs index 3760350dc26..17bd2109bbe 100644 --- a/src/librustc/middle/borrowck/gather_loans/restrictions.rs +++ b/src/librustc/middle/borrowck/gather_loans/restrictions.rs @@ -10,7 +10,6 @@ //! Computes the restrictions that result from a borrow. -use core::prelude::*; use middle::borrowck::*; use mc = middle::mem_categorization; use middle::ty; diff --git a/src/librustc/middle/borrowck/mod.rs b/src/librustc/middle/borrowck/mod.rs index 1e6df883e17..12321cf048e 100644 --- a/src/librustc/middle/borrowck/mod.rs +++ b/src/librustc/middle/borrowck/mod.rs @@ -10,8 +10,6 @@ /*! See doc.rs for a thorough explanation of the borrow checker */ -use core::prelude::*; - use mc = middle::mem_categorization; use middle::ty; use middle::typeck; diff --git a/src/librustc/middle/dataflow.rs b/src/librustc/middle/dataflow.rs index 4508c50435d..593d4b13a3f 100644 --- a/src/librustc/middle/dataflow.rs +++ b/src/librustc/middle/dataflow.rs @@ -16,7 +16,6 @@ * GEN and KILL bits for each expression. */ -use core::prelude::*; use core::cast; use core::uint; use syntax::ast; diff --git a/src/librustc/middle/trans/consts.rs b/src/librustc/middle/trans/consts.rs index 22014fa3304..1348ea6801e 100644 --- a/src/librustc/middle/trans/consts.rs +++ b/src/librustc/middle/trans/consts.rs @@ -30,7 +30,6 @@ use util::ppaux::{Repr, ty_to_str}; use core::libc::c_uint; use syntax::{ast, ast_util, ast_map}; -use util::ppaux::ty_to_str; pub fn const_lit(cx: @CrateContext, e: @ast::expr, lit: ast::lit) -> ValueRef { diff --git a/src/librustc/middle/trans/expr.rs b/src/librustc/middle/trans/expr.rs index 51f17fcf47c..8883cc44d12 100644 --- a/src/librustc/middle/trans/expr.rs +++ b/src/librustc/middle/trans/expr.rs @@ -145,7 +145,7 @@ use middle::trans::type_of; use middle::ty::struct_fields; use middle::ty::{AutoDerefRef, AutoAddEnv}; use middle::ty::{AutoPtr, AutoBorrowVec, AutoBorrowVecRef, AutoBorrowFn, - AutoDerefRef, AutoAddEnv, AutoUnsafe}; + AutoUnsafe}; use middle::ty; use util::common::indenter; use util::ppaux::Repr; diff --git a/src/librustc/middle/typeck/infer/combine.rs b/src/librustc/middle/typeck/infer/combine.rs index 0efecefa358..b318e6ff3f6 100644 --- a/src/librustc/middle/typeck/infer/combine.rs +++ b/src/librustc/middle/typeck/infer/combine.rs @@ -62,7 +62,7 @@ use middle::typeck::infer::glb::Glb; use middle::typeck::infer::lub::Lub; use middle::typeck::infer::sub::Sub; use middle::typeck::infer::to_str::InferStr; -use middle::typeck::infer::{cres, InferCtxt, ures, IntType, UintType}; +use middle::typeck::infer::{cres, InferCtxt, ures}; use util::common::indent; use core::result::{iter_vec2, map_vec2}; diff --git a/src/librustc/middle/typeck/infer/lattice.rs b/src/librustc/middle/typeck/infer/lattice.rs index 3c48e09c057..57bab29664d 100644 --- a/src/librustc/middle/typeck/infer/lattice.rs +++ b/src/librustc/middle/typeck/infer/lattice.rs @@ -41,8 +41,6 @@ use middle::typeck::infer::glb::Glb; use middle::typeck::infer::lub::Lub; use middle::typeck::infer::unify::*; use middle::typeck::infer::sub::Sub; -use middle::typeck::infer::lub::Lub; -use middle::typeck::infer::glb::Glb; use middle::typeck::infer::to_str::InferStr; use util::common::indenter; diff --git a/src/librustpkg/util.rs b/src/librustpkg/util.rs index 108a404eb7c..0ae9539fece 100644 --- a/src/librustpkg/util.rs +++ b/src/librustpkg/util.rs @@ -16,7 +16,7 @@ use rustc::driver::{driver, session}; use rustc::metadata::filesearch; use std::getopts::groups::getopts; use std::semver; -use std::{term, getopts}; +use std::term; use syntax::ast_util::*; use syntax::codemap::{dummy_sp, spanned, dummy_spanned}; use syntax::ext::base::{mk_ctxt, ext_ctxt}; diff --git a/src/libsyntax/opt_vec.rs b/src/libsyntax/opt_vec.rs index db1e95d5ad5..e3f1e9e1328 100644 --- a/src/libsyntax/opt_vec.rs +++ b/src/libsyntax/opt_vec.rs @@ -16,7 +16,6 @@ * other useful things like `push()` and `len()`. */ -use core::prelude::*; use core::old_iter; use core::old_iter::BaseIter; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 25b45a5f3b5..cfef9c49879 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -30,10 +30,10 @@ use ast::{expr_ret, expr_self, expr_struct, expr_tup, expr_unary}; use ast::{expr_vec, expr_vstore, expr_vstore_mut_box}; use ast::{expr_vstore_slice, expr_vstore_box}; use ast::{expr_vstore_mut_slice, expr_while, extern_fn, field, fn_decl}; -use ast::{expr_vstore_uniq, TyClosure, TyBareFn, Onceness, Once, Many}; +use ast::{expr_vstore_uniq, Onceness, Once, Many}; use ast::{foreign_item, foreign_item_const, foreign_item_fn, foreign_mod}; use ast::{ident, impure_fn, inherited, item, item_, item_const}; -use ast::{item_const, item_enum, item_fn, item_foreign_mod, item_impl}; +use ast::{item_enum, item_fn, item_foreign_mod, item_impl}; use ast::{item_mac, item_mod, item_struct, item_trait, item_ty, lit, lit_}; use ast::{lit_bool, lit_float, lit_float_unsuffixed, lit_int}; use ast::{lit_int_unsuffixed, lit_nil, lit_str, lit_uint, local, m_const}; |
