Graydon Hoare
6e6798c4e1
Bulk-edit mutable -> mut.
2012-03-26 18:35:18 -07:00
Marijn Haverbeke
87e097a853
Disallow ret inside of block functions
...
Also adds proper checking for cont/break being inside a loop.
Closes #1854
Issue #1619
2012-03-26 12:45:47 +02:00
Niko Matsakis
042c532a08
Implement new inference algorithm.
2012-03-23 21:47:28 -07:00
Marijn Haverbeke
3e7a514521
Fix inconsistent-iteration hazard in map.rs
...
Closes #2049
2012-03-23 13:30:29 +01:00
Brian Anderson
f3fe85dad7
Bump version numbers to 0.2
2012-03-22 15:25:02 -07:00
Niko Matsakis
dc07280b08
make --enforce-mut-vars always on, add mut annotations to remaining files
2012-03-22 09:58:19 -07:00
Niko Matsakis
cce2751461
Adjust arena definition to be compatible with placement new
2012-03-21 05:46:31 -07:00
Patrick Walton
ba39e277e2
stdlib: Implement arenas
2012-03-20 19:08:17 -07:00
Brian Anderson
b181ea415e
core: Rename unsafe::leak to unsafe::forget. Closes #2031
2012-03-20 15:20:37 -07:00
Marijn Haverbeke
cec1a9b859
Properly check kinds when instantiating types
...
Closes #2011
2012-03-19 10:45:29 +01:00
Brian Anderson
47d468f08c
core: Store reexporting result and either. Closes #1997
2012-03-16 15:14:37 -07:00
Erick Tryzelaar
67a1c35264
std: Add a a hashmap_from_vecs function
2012-03-16 17:05:29 +01:00
Marijn Haverbeke
35fc4a4291
Check kind bounds when calling methods
...
Closes #1915
2012-03-16 17:05:29 +01:00
Brian Anderson
7e0fa3f852
std: Swap the argument order of list::foldl to match vec::foldl
2012-03-15 14:15:49 -07:00
Brian Anderson
5e8004d493
std: Follow conventions in bitv
2012-03-15 14:08:47 -07:00
Brian Anderson
3864d6d845
std: Rename the hashmap constructors to conform to new standards
...
Instead of using the new_ prefix just name them after their type
2012-03-14 18:19:08 -07:00
Niko Matsakis
a3d2882ffd
fixup auto_serialize's treatment of nullary variants
2012-03-14 21:05:06 -04:00
Niko Matsakis
e702d20191
allow immut vars to be moved. enforce mut vars after stage0 in std.
2012-03-14 20:46:36 -04:00
Niko Matsakis
6b35875dca
annotate libstd and start enforcing mutability
2012-03-14 20:46:36 -04:00
Niko Matsakis
1600be2c3b
fix auto_serialize for enums with type parameters
2012-03-14 17:19:33 -04:00
Niko Matsakis
ffa187db25
adjust auto_serialize to generate fns named serialize_T()
...
We used to generate a module T with a serialize() and deserialize() fn,
but this was suboptimal for a number of reasons:
- it required moving serialization into core so that uint etc worked
- it was harder to override the serialization behavior locally
(this is now trivial)
2012-03-14 11:49:28 -04:00
Niko Matsakis
b30cb8e43a
implement deserialization, rename mk_mem_buffer() to mem_buffer()
2012-03-13 21:30:07 -04:00
Niko Matsakis
d91742294f
first (functional) version of the auto_serialize syntax ext
2012-03-13 21:30:07 -04:00
Brian Anderson
b968c8e6cd
Name types after their modules instead of 't'
2012-03-13 15:14:17 -07:00
Brian Anderson
cd72b1f848
Overhaul constructor naming in libs
2012-03-13 11:07:22 -07:00
Graydon Hoare
6f5853f5a1
Libc/os/run/rand/io reorganization. Close #1373 . Close #1638 .
...
- Move io, run and rand to core.
- Remove incorrect ctypes module (use libc).
- Remove os-specific modules for os and fs.
- Split fs between core::path and core::os.
2012-03-12 20:08:29 -07:00
Patrick Walton
4571175568
stdlib: Make list::find do what the docs say it does.
...
Talked on #rust about this change, got approval from graydon and brson. Will bring up tomorrow at meeting to verify.
2012-03-12 18:28:16 -07:00
Brian Anderson
d60813146d
std: Sort test failures. Closes #1929
2012-03-12 17:31:17 -07:00
Tim Chevalier
40a5c56345
Fix Windows build breakage
2012-03-10 20:44:10 -08:00
Tim Chevalier
35400e13ad
Use loop instead of while(true) in libraries and compiler itself
...
And remove spurious fails/unreachable() calls.
2012-03-10 20:34:17 -08:00
Brian Anderson
91e5a1c8b3
core: Remove the nearly empty math module
...
This mod only had two functions, all of whose users have been changed
to use the uint module.
2012-03-10 17:43:19 -08:00
Brian Anderson
95521c4084
std: Convert to rustdoc
2012-03-09 22:56:53 -08:00
Tim Chevalier
321fd80219
Add an infinite loop construct
...
Add a loop {} construct for infinite loops, and use it in test
cases. See #1906 for details.
2012-03-09 16:40:58 -08:00
Tim Chevalier
0c5fdc8745
Rename last to last_opt, last_unsafe to last
...
As per discussion on IRC. I am about to file an RFC for further
discussion about the more general issue of whether to enforce
invariants through types, typestate, or dynamic checks, but for now,
removing the misleading name "last_unsafe".
2012-03-08 15:25:56 -08:00
Tim Chevalier
d048a00cf3
Change util::unreachable to core::unreachable
...
Closes #1931
2012-03-08 14:30:01 -08:00
Tim Chevalier
ebc1d3e704
Rename last_total to last_unsafe
...
See Issue 1943 for any discussion (reopen it if necessary).
Closes #1943
2012-03-08 13:07:31 -08:00
Patrick Walton
c9375fed8d
stdlib: Stop incurring vtable dispatch costs when hashmaps are used
...
This required changing almost all users of hashmaps to import the hashmap interface first.
The `size` member in the hashmap structure was renamed to `count` to work around a name conflict.
2012-03-07 17:35:13 -08:00
Patrick Walton
c245d9e980
Revert "stdlib: Stop incurring vtable dispatch costs when hashmaps are used"
...
This reverts commit f0250a23d3
.
2012-03-07 16:56:45 -08:00
Patrick Walton
f0250a23d3
stdlib: Stop incurring vtable dispatch costs when hashmaps are used
...
This required changing almost all users of hashmaps to import the hashmap interface first.
The `size` member in the hashmap structure was renamed to `count` to work around a name conflict.
2012-03-07 16:51:31 -08:00
Brian Anderson
d2135597e9
std: Use util::unreachable
2012-03-05 18:23:01 -08:00
Graydon Hoare
6c87c34277
Remove dead code from rt (debug_obj, rust_obj, rust_closure, rust_box_obj, rust_vtable)
2012-03-05 15:50:11 -08:00
Erick Tryzelaar
faccd4ac92
std: export json::error.
2012-03-05 08:47:21 -08:00
Erick Tryzelaar
6b0c4822c1
std: add a fs::remove_file function.
2012-03-02 19:15:36 -08:00
Erick Tryzelaar
f630ebdb6a
comp/std: rename io::string_reader to io::str_reader.
2012-03-02 19:15:35 -08:00
Erick Tryzelaar
1404a864a4
std: add a io::with_str_reader fn to remove a str copy
2012-03-02 19:15:34 -08:00
Brian Anderson
3ed6f6520f
core: Remove _mut functions from vec
...
Instead, use vec::to_mut/from_mut to transform vectors in place as
needed.
2012-03-02 15:49:49 -08:00
Brian Anderson
77fc4e7ee7
std: vec::to_ptr -> vec::unsafe::to_ptr
2012-03-02 12:29:40 -08:00
Brian Anderson
1471b1f3ff
std: DeCamelCase fs::splitDirnameBasename
2012-02-29 23:45:51 -08:00
Tycho Sci
ecf87c3180
libstd: Skip trailing whitespaces after JSON value
2012-02-29 17:47:17 +09:00
Tycho Sci
0465d5217d
libstd: Skip trailing whitespaces after outer rparen
...
This makes "{ \"foo\": 1 }\n" and "[ 1 ]\n" valid json string
2012-02-29 16:24:28 +09:00
Erick Tryzelaar
012dec5e57
std: rewrite json.rs to fix bugs and use readers/writers
...
Our json implementation did not conform to the spec, and
was missing support for escpaed characters and exponental
numbers. This fixes it, and adds support for reading/writing
json directly from/to a stream.
There are two things left unimplemented. We could use a
"to_json" iface/impl, but that really needs traits to cut
down on code duplication. The other is it wouldn't be that
not that hard to turn this implementation into a event driven
parser like YAJL, but I ran into some type-inference bugs,
so I cut that out. It'd be nice to revisit this in the future
though.
2012-02-28 18:00:50 -08:00
Erick Tryzelaar
6865df2611
core/std: whitespace fixes.
2012-02-28 18:00:50 -08:00
Erick Tryzelaar
ec51d8fd03
std: Add helpers to simplify making str io::writers
2012-02-28 18:00:50 -08:00
Brian Anderson
b9089b5335
std: Ignore uv tests on FreeBSD
2012-02-28 17:56:15 -08:00
Jeff Olson
9831ee3e67
changing rust loop to 1 thread
2012-02-28 17:56:15 -08:00
Jeff Olson
b4c88cdcec
add uv::loop_delete()
...
because of the last change, the loop ptr is no longer cleaned up
when the loop exits. This api call addresses that. Sadly, the loop
ptr is not "reusable" across multiple calls to uv::run().
2012-02-28 17:56:15 -08:00
Jeff Olson
0b3a06ab2c
correcting for libuv behavior that differs between linux & windows
...
net complexity increase :/
2012-02-28 17:56:15 -08:00
Jeff Olson
bb5960aa57
moving new uv stuff into uv.rs and rust_uv.cpp
...
- removing the remains of uvtmp.rs and rust_uvtmp.rs
- removing the displaced, low-level libuv bindings
in uv.rs and rust_uv.cpp
2012-02-28 17:56:15 -08:00
Jeff Olson
828595151c
trailing whitespace fixes
2012-02-28 17:56:15 -08:00
Jeff Olson
1d3e08d8c6
finishing up simple uv_timer impl
...
as it stands, basic async nad timer support is added
2012-02-28 17:56:15 -08:00
Jeff Olson
b68eb507da
cleaning up uv_async stuff and stubbing uv_timer
2012-02-28 17:56:14 -08:00
Jeff Olson
974c23cbeb
removed hello world and added uv_async_*
2012-02-28 17:56:14 -08:00
Jeff Olson
ffad8d7f0c
everything is laid out and working through a basic hw
...
the core impl is there, with a async handle in place
to take incoming operations from user code. No actual
uv handle/operations are implemented yet, though.
2012-02-28 17:56:14 -08:00
Niko Matsakis
5c1338a18e
add ability to run multi-crate tests, run tests with --inline
2012-02-28 06:31:29 -08:00
Niko Matsakis
8cffc6f84c
add debugging mode which emits more verbose info
2012-02-28 06:31:28 -08:00
Brian Anderson
61691c2428
std: Make merge_sort faster
2012-02-27 18:32:45 -08:00
Niko Matsakis
f3ca50c9ca
Encode/decode AST into metadata, re-instantiate inlined items
2012-02-24 20:46:27 -08:00
Marijn Haverbeke
780f8277f4
Finish cleanup of core::str
...
Closes #1849
2012-02-23 17:00:19 +01:00
Marijn Haverbeke
d802c1fbd2
Various cleanups and optimizations in core::str
2012-02-23 17:00:19 +01:00
Kevin Cantu
c3318f29fe
(core::str) rename substr_len_bytes to substr_len, and delete unused byte_index[_from]
2012-02-23 17:00:19 +01:00
Kevin Cantu
7782f5d692
(core::str) remove len_bytes alias
2012-02-23 17:00:19 +01:00
Kevin Cantu
1b957c0942
(core::str) replace uses of unsafe::slice_bytes; replace find[_from]_bytes with find[_from]
2012-02-23 17:00:19 +01:00
Kevin Cantu
6ea3d7935e
(core::str) replace byte_index[_from] with index[_from]
2012-02-23 17:00:19 +01:00
Kevin Cantu
280633a728
(core::str) do some replacements
2012-02-23 17:00:19 +01:00
Kevin Cantu
454b53a7c2
(core::char) rename slice -> slice_chars
2012-02-23 17:00:19 +01:00
Kevin Cantu
1cd5a0945a
(core::str) rename rindex -> rindex_chars
2012-02-23 17:00:19 +01:00
Kevin Cantu
98447f5236
(core::str) mostly rename len -> len_chars
2012-02-23 17:00:19 +01:00
Marijn Haverbeke
ffd50b9cdf
Make the various from_str functions return options
...
So that they can be used with user input without causing task
failures.
Closes #1335
2012-02-22 13:18:15 +01:00
Marijn Haverbeke
ad03761a97
Remove preconditions from libraries
...
Closes #1805
2012-02-22 11:47:47 +01:00
Brian Anderson
4220dcf1e9
core: New task API
2012-02-20 18:58:04 -08:00
Brian Anderson
010f2abc70
core: When running tests sequentially, print the test name before running it
...
Useful for debugging hanging tests
2012-02-18 16:30:09 -08:00
Chris Peterson
3d202d7eae
rt: rename nano_time() builtin to match time::precise_time_ns()
2012-02-18 01:39:42 -08:00
Chris Peterson
b73bc30858
std: Add tests for time module
...
Tested on OSX and Windows.
2012-02-18 01:32:52 -08:00
Chris Peterson
105b5f0be8
std: Expand doc comments for time module
2012-02-18 01:30:12 -08:00
Chris Peterson
94fe5011e2
std: Add some env() and getenv() tests
2012-02-17 08:47:45 +01:00
Chris Peterson
aec76d2515
std: Fix env() assert when an environment variable's value contains a '=' char
2012-02-17 08:47:44 +01:00
Marijn Haverbeke
67cc89f38d
Rewrite exhaustiveness checker
...
Issue #352
Closes #1720
The old checker would happily accept things like 'alt x { @some(a) { a } }'.
It now properly descends into patterns, checks exhaustiveness of booleans,
and complains when number/string patterns aren't exhaustive.
2012-02-15 15:47:42 +01:00
Marijn Haverbeke
4b63826050
Replace some explicit fails with 'alt check' invocations
2012-02-15 15:47:42 +01:00
Brian Anderson
acabd821d2
Merge pull request #1831 from killerswan/str_fixes
...
(core::str) changes to find / find_bytes
2012-02-14 11:22:31 -08:00
Niko Matsakis
3a2f1e1876
add serialization library; convert ebml lib to use u64 internally
2012-02-13 06:50:58 -08:00
Kevin Cantu
c81867474a
(core::str) add find_bytes and export it...
2012-02-13 01:56:58 -08:00
Kevin Cantu
2ba44e24d5
(core::str) rename byte_len_range -> substr_len_bytes and
...
rename char_len_range -> substr_len_chars
2012-02-12 15:30:20 -08:00
Kevin Cantu
2b4f5136a5
(core::str) rename byte_len -> len_bytes and rename char_len -> len
2012-02-12 15:30:20 -08:00
Kevin Cantu
944f5a6598
(core::str) move push_byte, push_bytes, pop_byte, and shift_byte into str::unsafe
2012-02-12 15:30:20 -08:00
Kevin Cantu
e0af23b664
using str::rindex...
2012-02-11 16:39:39 -08:00
Kevin Cantu
27161f4415
using str::index...
2012-02-11 16:39:39 -08:00
Kevin Cantu
a131b430a0
core::str rename [r]index -> [r]index_bytes
2012-02-11 16:39:39 -08:00
Niko Matsakis
e712a47a81
create serialization lib and update serializer to use it
2012-02-10 20:48:29 -08:00
Niko Matsakis
fdddf8f9e1
put serializer into the build and encode full item paths
2012-02-10 20:48:28 -08:00
Niko Matsakis
5d57fa3403
update ebml interface
2012-02-10 20:48:28 -08:00