Steve Klabnik
e0b1bdca5b
Add additional documentation in core::io.
...
Added docs for stdout, stderr, print, and println.
2013-05-19 12:06:39 -07:00
Corey Richardson
cc57ca012a
Use assert_eq! rather than assert! where possible
2013-05-19 08:16:02 -04:00
Youngmin Yoo
a2a8596c3d
Rename vec::len(var) to var.len()
2013-05-15 11:05:28 +09:00
Alex Crichton
66e1e51701
Remove re-exports from libcore/core.rc
...
Also fix up all the fallout elsewhere throughout core. It's really nice being
able to have the prelude.
2013-05-13 18:51:40 -04:00
bors
957251817b
auto merge of #6389 : sonwow/rust/issue-3356, r=bstrie
...
Fix for #3356
2013-05-11 12:55:49 -07:00
Youngsoo Son
24ef88cee9
renamed str::from_slice to str::to_owned
2013-05-10 20:08:56 +09:00
Alex Crichton
28256052a4
core: Use the new for
protocol
2013-05-10 02:46:18 -04:00
Youngmin Yoo
9a292b3da5
libcore: rename vec::each(variable) to variable.each
2013-05-09 14:17:18 +09:00
Patrick Walton
16a0125e41
libcore: Fix tests.
2013-05-08 17:04:01 -07:00
Patrick Walton
99daec602f
librustc: Fix merge fallout.
2013-05-08 17:04:00 -07:00
Patrick Walton
d12d25534b
libcore: Remove more mutable fields from comm
2013-05-08 17:03:59 -07:00
Fedor Indutny
db1a274bf5
io: handle fread() errors
...
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-08 01:04:41 +04:00
Niko Matsakis
4300d4d2fa
Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freeze
...
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-05 15:11:04 -04:00
Brendan Zabarauskas
e596128bd8
Remove 'Local Variable' comments
2013-05-02 13:22:04 +10:00
Niko Matsakis
a896440ca1
new borrow checker (mass squash)
2013-04-30 06:59:32 -04:00
Huon Wilson
19cc352302
core: io: the read_until function checks bytes not chars, so type should reflect that.
2013-04-18 23:36:38 +10:00
Alex Crichton
d9595d1737
core: remove unnecessary unsafe blocks/functions
2013-04-14 01:15:46 -04:00
bors
26d8b5188a
auto merge of #5674 : steveklabnik/rust/improve_reader_util_docs, r=catamorphism
...
I filled out better descriptions for all of the necessary
functions.
r?
2013-04-02 21:18:43 -07:00
Steve Klabnik
a3e2d6ea81
Remove excess trailing whitespace.
2013-04-02 17:31:42 -07:00
Steve Klabnik
86d5ce5cef
remove trailing whitespace
2013-04-02 17:29:02 -07:00
Steve Klabnik
948ff6056f
Typo fix. u8 -> i8
2013-04-01 18:20:30 -07:00
Steve Klabnik
1d658d9b97
Improve docs for Core::ReaderUtil.
...
I filled out better descriptions for all of the neccesary
functions.
2013-04-01 18:03:54 -07:00
Steve Klabnik
a20d1ad0cb
Improve documentation for core::io.
2013-04-01 16:37:40 -07:00
Patrick Walton
1e91595520
librustc: Remove fail_unless!
2013-03-29 16:39:08 -07:00
Alex Crichton
be57d745d2
Removing unused imports
2013-03-28 23:56:46 -04:00
Patrick Walton
8b56a8380b
librustc: Modify all code to use new lifetime binder syntax
2013-03-26 21:30:17 -07:00
Patrick Walton
0d52b22e7b
libcore: Change [const T]
to const [T]
everywhere
2013-03-26 21:29:33 -07:00
Patrick Walton
be9bddd463
libcore: Remove pure
from libcore. rs=depure
2013-03-22 10:29:17 -07:00
bors
1616ffd0c2
auto merge of #5398 : dbaupp/rust/core-readlines, r=graydon
...
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-22 09:24:53 -07:00
Huon Wilson
429b8a9b9e
libcore: handle trailing newlines more like other languages.
...
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-23 00:15:05 +11:00
Andrew Paseltiner
98e8fe12d2
core: replace uses of old deriving attribute with new one
2013-03-22 06:24:19 -04:00
bors
9584c60871
auto merge of #5484 : pcwalton/rust/snapshots, r=pcwalton
2013-03-22 00:00:50 -07:00
Patrick Walton
e7dbe6cd6f
librustc: Register new snapshots
2013-03-21 18:10:20 -07:00
Patrick Walton
d4fee24c7c
librustc: Forbid destructors from being attached to any structs that might contain non-Owned fields. r=nmatsakis
2013-03-21 17:31:34 -07:00
Patrick Walton
efb5f8734a
libcore: Remove a few possibly-cyclic imports in an effort to unbreak the tree on Linux
2013-03-21 08:06:20 -07:00
bors
a8527e2e97
auto merge of #5456 : graydon/rust/fixups, r=pcwalton
...
Stage markers for stage3 and a trivial prelude fix.
2013-03-20 18:27:48 -07:00
Patrick Walton
9c4d804cfe
libsyntax: Never use ::<>
in the type grammar
2013-03-20 13:54:25 -07:00
Graydon Hoare
9350d14ecb
add stage3 markers where necessary for dist-snap
2013-03-20 13:48:57 -07:00
Graydon Hoare
bb9e1e2660
core: add Reader, Writer, ReaderUtil, WriterUtil to prelude. Close #4182 .
2013-03-20 13:48:57 -07:00
Patrick Walton
e78f2e2ac5
librustc: Make the compiler ignore purity.
...
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-18 17:21:16 -07:00
Patrick Walton
c4db4faefa
libsyntax: Stop parsing old lifetimes, except for the ones on data type declarations.
2013-03-18 17:21:15 -07:00
Patrick Walton
352c070365
librustc: Convert all uses of old lifetime notation to new lifetime notation. rs=delifetiming
2013-03-18 17:21:14 -07:00
Patrick Walton
b1c699815d
librustc: Don't accept as Trait
anymore; fix all occurrences of it.
2013-03-13 20:07:09 -07:00
Brian Anderson
82f190355b
Remove uses of log
2013-03-11 23:19:42 -07:00
Patrick Walton
d18f785457
librustc: Replace all uses of fn()
with &fn()
. rs=defun
2013-03-11 09:35:58 -07:00
Alex Crichton
62651df2b4
Fix dvec-related fallout in tests
2013-03-08 09:56:52 -05:00
Alex Crichton
7ccb0e63c5
core: Remove uses of DVec in io/repr
2013-03-08 09:53:45 -05:00
Patrick Walton
d7e74b5e91
librustc: Convert all uses of assert
over to fail_unless!
2013-03-07 22:37:57 -08:00
Patrick Walton
fd271adc75
libcore: Remove extern mod { ... }
from libcore. rs=deexterning
2013-03-07 22:32:51 -08:00
Niko Matsakis
3168fe06ff
Add manual &self/ and &static/ and /&self declarations that
...
are currently inferred. New rules are coming that will require
them to be explicit. All add some explicit self declarations.
2013-03-06 15:12:57 -05:00