about summary refs log tree commit diff
path: root/src/libcore/io.rs
AgeCommit message (Collapse)AuthorLines
2013-05-13Remove re-exports from libcore/core.rcAlex Crichton-0/+5
Also fix up all the fallout elsewhere throughout core. It's really nice being able to have the prelude.
2013-05-11auto merge of #6389 : sonwow/rust/issue-3356, r=bstriebors-1/+1
Fix for #3356
2013-05-10renamed str::from_slice to str::to_ownedYoungsoo Son-1/+1
2013-05-10core: Use the new `for` protocolAlex Crichton-0/+47
2013-05-09libcore: rename vec::each(variable) to variable.eachYoungmin Yoo-1/+1
2013-05-08libcore: Fix tests.Patrick Walton-3/+3
2013-05-08librustc: Fix merge fallout.Patrick Walton-5/+8
2013-05-08libcore: Remove more mutable fields from commPatrick Walton-34/+68
2013-05-08io: handle fread() errorsFedor Indutny-2/+12
When, occasionally, trying to read directory instead of file, `fread()` returns `EISDIR` error. And, considering, absence of error handling, `read_whole_stream()` just loops indefinitely.
2013-05-05Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freezeNiko Matsakis-10/+0
Conflicts: src/libcore/core.rc src/libcore/hashmap.rs src/libcore/num/f32.rs src/libcore/num/f64.rs src/libcore/num/float.rs src/libcore/num/int-template.rs src/libcore/num/num.rs src/libcore/num/strconv.rs src/libcore/num/uint-template.rs src/libcore/ops.rs src/libcore/os.rs src/libcore/prelude.rs src/libcore/rt/mod.rs src/libcore/unstable/lang.rs src/librustc/driver/session.rs src/librustc/middle/astencode.rs src/librustc/middle/borrowck/check_loans.rs src/librustc/middle/borrowck/gather_loans.rs src/librustc/middle/borrowck/loan.rs src/librustc/middle/borrowck/preserve.rs src/librustc/middle/liveness.rs src/librustc/middle/mem_categorization.rs src/librustc/middle/region.rs src/librustc/middle/trans/base.rs src/librustc/middle/trans/inline.rs src/librustc/middle/trans/reachable.rs src/librustc/middle/typeck/check/_match.rs src/librustc/middle/typeck/check/regionck.rs src/librustc/util/ppaux.rs src/libstd/arena.rs src/libstd/ebml.rs src/libstd/json.rs src/libstd/serialize.rs src/libstd/std.rc src/libsyntax/ast_map.rs src/libsyntax/parse/parser.rs src/test/compile-fail/borrowck-uniq-via-box.rs src/test/compile-fail/regions-infer-borrow-scope-within-loop.rs src/test/run-pass/borrowck-nested-calls.rs
2013-05-02Remove 'Local Variable' commentsBrendan Zabarauskas-10/+0
2013-04-30new borrow checker (mass squash)Niko Matsakis-7/+7
2013-04-18core: io: the read_until function checks bytes not chars, so type should ↵Huon Wilson-6/+6
reflect that.
2013-04-14core: remove unnecessary unsafe blocks/functionsAlex Crichton-14/+9
2013-04-02auto merge of #5674 : steveklabnik/rust/improve_reader_util_docs, r=catamorphismbors-40/+335
I filled out better descriptions for all of the necessary functions. r?
2013-04-02Remove excess trailing whitespace.Steve Klabnik-61/+61
2013-04-02remove trailing whitespaceSteve Klabnik-17/+17
2013-04-01Typo fix. u8 -> i8Steve Klabnik-1/+1
2013-04-01Improve docs for Core::ReaderUtil.Steve Klabnik-40/+335
I filled out better descriptions for all of the neccesary functions.
2013-04-01Improve documentation for core::io.Steve Klabnik-8/+68
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-36/+36
2013-03-28Removing unused importsAlex Crichton-1/+1
2013-03-26librustc: Modify all code to use new lifetime binder syntaxPatrick Walton-2/+2
2013-03-26libcore: Change `[const T]` to `const [T]` everywherePatrick Walton-8/+10
2013-03-22libcore: Remove `pure` from libcore. rs=depurePatrick Walton-5/+5
2013-03-22auto merge of #5398 : dbaupp/rust/core-readlines, r=graydonbors-6/+49
The `each_line` function in `ReaderUtil` acts very differently to equivalent functions in Python, Ruby, Clojure etc. E.g. given a file `t` with contents `trailing\nnew line\n` and `n` containing `no trailing\nnew line`: Rust: ```Rust t: ~[~"trailing", ~"new line", ~""] n: ~[~"no trailing", ~"new line"] ``` Python: ```Python >>> open('t').readlines() ['trailing\n', 'new line\n'] >>> open('n').readlines() ['no trailing\n', 'new line'] ``` Ruby: ```Ruby irb(main):001:0> File.readlines('t') => ["trailing\n", "new line\n"] irb(main):002:0> File.readlines('n') => ["no trailing\n", "new line"] ``` Clojure ```Clojure user=> (read-lines "t") ("trailing" "new line") user=> (read-lines "n") ("no trailing" "new line") ``` The extra string that rust includes at the end is inconsistent, and means that it is impossible to distinguish between the "real" empty line a file that ends `...\n\n`, and the "fake" one after the last `\n`. The code attached makes Rust's `each_line` act like Clojure (and PHP, i.e. not including the `\n`), as well as adjusting `str::lines` to fix the trailing empty line problem. Also, add a convenience `read_lines` method to read all the lines in a file into a vector.
2013-03-23libcore: handle trailing newlines more like other languages.Huon Wilson-6/+49
Specifically, `lines` and `each_line` will not emit a trailing empty string when given "...\n". Also, add `read_lines`, which just collects all of `each_line` into a vector, and `split_*_no_trailing` which will is the generalised version of `lines`.
2013-03-22core: replace uses of old deriving attribute with new oneAndrew Paseltiner-1/+1
2013-03-22auto merge of #5484 : pcwalton/rust/snapshots, r=pcwaltonbors-6/+0
2013-03-21librustc: Register new snapshotsPatrick Walton-6/+0
2013-03-21librustc: Forbid destructors from being attached to any structs that might ↵Patrick Walton-6/+8
contain non-Owned fields. r=nmatsakis
2013-03-21libcore: Remove a few possibly-cyclic imports in an effort to unbreak the ↵Patrick Walton-1/+3
tree on Linux
2013-03-20auto merge of #5456 : graydon/rust/fixups, r=pcwaltonbors-1/+5
Stage markers for stage3 and a trivial prelude fix.
2013-03-20libsyntax: Never use `::<>` in the type grammarPatrick Walton-1/+1
2013-03-20add stage3 markers where necessary for dist-snapGraydon Hoare-0/+2
2013-03-20core: add Reader, Writer, ReaderUtil, WriterUtil to prelude. Close #4182.Graydon Hoare-1/+3
2013-03-18librustc: Make the compiler ignore purity.Patrick Walton-2/+2
For bootstrapping purposes, this commit does not remove all uses of the keyword "pure" -- doing so would cause the compiler to no longer bootstrap due to some syntax extensions ("deriving" in particular). Instead, it makes the compiler ignore "pure". Post-snapshot, we can remove "pure" from the language. There are quite a few (~100) borrow check errors that were essentially all the result of mutable fields or partial borrows of `@mut`. Per discussions with Niko I think we want to allow partial borrows of `@mut` but detect obvious footguns. We should also improve the error message when `@mut` is erroneously reborrowed.
2013-03-18libsyntax: Stop parsing old lifetimes, except for the ones on data type ↵Patrick Walton-1/+1
declarations.
2013-03-18librustc: Convert all uses of old lifetime notation to new lifetime ↵Patrick Walton-1/+1
notation. rs=delifetiming
2013-03-13librustc: Don't accept `as Trait` anymore; fix all occurrences of it.Patrick Walton-14/+15
2013-03-11Remove uses of logBrian Anderson-6/+5
2013-03-11librustc: Replace all uses of `fn()` with `&fn()`. rs=defunPatrick Walton-15/+15
2013-03-08Fix dvec-related fallout in testsAlex Crichton-5/+3
2013-03-08core: Remove uses of DVec in io/reprAlex Crichton-20/+14
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-40/+40
2013-03-07libcore: Remove `extern mod { ... }` from libcore. rs=deexterningPatrick Walton-5/+10
2013-03-06Add manual &self/ and &static/ and /&self declarations thatNiko Matsakis-2/+2
are currently inferred. New rules are coming that will require them to be explicit. All add some explicit self declarations.
2013-03-06Make object types not implement associated trait. Fixes #5087.Niko Matsakis-2/+32
2013-03-06add floating-point read/write to Reader/WriterJihyun Yu-0/+108
2013-03-05auto merge of #5179 : alexcrichton/rust/default-warn-unused-import, r=graydonbors-4/+3
I've found that unused imports can often start cluttering a project after a long time, and it's very useful to keep them under control. I don't like how Go forces a compiler error by default and it can't be changed, but I certainly want to know about them so I think that a warn is a good default. Now that the `unused_imports` lint option is a bit smarter, I think it's possible to change the default level to warn. This commit also removes all unused imports throughout the compiler and libraries (500+). The only odd things that I ran into were that some `use` statements had to have `#[cfg(notest)]` or `#[cfg(test)]` based on where they were. The ones with `notest` were mostly in core for modules like `cmp` whereas `cfg(test)` was for tests that weren't part of a normal `mod test` module.