Commit Graph

791 Commits

Author SHA1 Message Date
Tim Chevalier
053db0208b Comment only: fix typo 2012-06-01 20:40:34 -07:00
Brian Anderson
7b862a5278 core: Fix handling of 0-padded floats with precision in #fmt 2012-06-01 16:10:37 -07:00
Graydon Hoare
57f399bd63 Implement 2 kinds of char / str escaping. Use in rustc. Close #2306. 2012-05-31 15:32:29 -07:00
Brian Anderson
1523298bc7 core: Update vec_repr to include the box header 2012-05-30 21:23:34 -07:00
Eric Holk
ad292a8c73 Add xorshift to core::rand, which gave a 3x speedup for graph generation in the bfs code. Also, remove trailing white space. 2012-05-30 17:39:53 -07:00
Niko Matsakis
f90228b8a8 make all arguments modes immutable
note: you can still move from copy/move mode args
2012-05-29 16:22:17 -07:00
Eric Holk
3f0358bc5c Updating comments. 2012-05-29 10:33:04 -07:00
Erick Tryzelaar
e45ed323c9 Add methods iter, iter_err, map, map_err to the result type. 2012-05-28 12:03:25 -07:00
Erick Tryzelaar
46173e98ef Rename result::{iter,map,map2} to add _vec suffix
The result module doesn't follow the standard iter/map pattern
that we use in the rest of the library. So to
2012-05-28 12:03:25 -07:00
Brian Anderson
432c6cbde9 core: Make range follow the for loop protocol 2012-05-26 02:28:00 -07:00
Brian Anderson
5281db2bc2 core: Fix capitalization in docs 2012-05-26 00:16:32 -07:00
Brian Anderson
b4516590e4 core: Add to_str impls for remaining int types 2012-05-25 23:47:02 -07:00
Michael Sullivan
8668d06400 Get rid of many implicit copies as a preliminary to Issue #2448. 2012-05-25 16:39:35 -07:00
Michael Sullivan
842f9d8616 Remove from_const hack from vec.rs. 2012-05-25 15:16:17 -07:00
Niko Matsakis
ccd8d5573e remove dead assignments 2012-05-24 13:35:57 -07:00
Jeff Olson
bb88f772a4 core: doc/err feedback tweeks for result::unwrap 2012-05-22 22:29:17 -07:00
Jeff Olson
082a95a077 core: add result::unwrap() .. patch from @nmatsakis 2012-05-22 22:29:16 -07:00
Eric Holk
0b2f2cabbe Send is no longer a subkind of copy. This allows for sendable, but non-copyable resources. Closes #2420. 2012-05-22 14:10:32 -07:00
Brian Anderson
c492a183d7 core: Fix typos in ignore attrs 2012-05-21 21:30:26 -07:00
Brian Anderson
2bec7eafb1 core: Rework some rand functions to be more consistent
Changed the gen_x_from functions to gen_x_range and made them use the range
[start, end) like other core functions.
2012-05-21 18:57:30 -07:00
Brian Anderson
d18da37c9c core: Ignore another should_fail test on win32 2012-05-21 18:39:31 -07:00
Brian Anderson
1678b6f01f core: Ignore a should_fail test on win32 2012-05-21 18:19:36 -07:00
Brian Anderson
a1b40d5136 core: Fix types in rand mod 2012-05-21 17:38:05 -07:00
Gareth Daniel Smith
c9f8ae02bc add a seeded random number generator so that sequences of random numbers can be easily reproduced (for https://github.com/mozilla/rust/issues/2379) 2012-05-21 17:38:05 -07:00
Gareth Daniel Smith
64130f1589 add a bunch more rand::rng extension methods - one for each primitive type and also some choose/shuffle functions (for https://github.com/mozilla/rust/issues/2379) 2012-05-21 17:38:04 -07:00
Gareth Daniel Smith
11e81951bb separate the rand::rng gen_* methods out into an iface-less-impl so that the gen_* methods can be reused with different rng implementations (for https://github.com/mozilla/rust/issues/2379) 2012-05-21 17:38:04 -07:00
Erick Tryzelaar
9d01c46c07 core: Add iterable functions to io::reader_utils. 2012-05-19 10:08:44 -07:00
Niko Matsakis
d1cde18af3 add more inline directives to dvec 2012-05-18 20:00:51 -07:00
Niko Matsakis
cf6ad6d62a move io over to dvec 2012-05-18 20:00:50 -07:00
Niko Matsakis
da204e1d73 add swappable/dvec modules 2012-05-18 20:00:50 -07:00
Eric Holk
c568cf6099 Added vec::view, for creating subslices. 2012-05-18 16:55:42 -07:00
Eric Holk
0eed37da29 Using const vector slices for more vec functions. 2012-05-18 16:55:42 -07:00
Paul Stansifer
9fe547d3a7 Make extracting syntax extension arguments easier. 2012-05-18 10:05:24 -07:00
Eric Holk
251a0a38d7 Exporting alli. 2012-05-17 12:01:45 -07:00
Eric Holk
aec0b51d9c Added a few more extension methods on vectors, and fixed a pretty printer bug. 2012-05-17 12:00:24 -07:00
Brian Anderson
feb8d60dc7 core: Ignore more tests 2012-05-16 16:58:02 -07:00
Brian Anderson
7c53c2bb16 core: Ignore more tests on more platforms 2012-05-16 16:17:28 -07:00
Brian Anderson
31a6eae4fc core: Ignore int-template::test_parse_buf on windows 2012-05-16 14:33:42 -07:00
Brian Anderson
ce20ed77b2 core: Ignore int-template::test_from_str on windows
Alignment problems
2012-05-16 14:13:07 -07:00
Niko Matsakis
fc8e1cb646 missing import 2012-05-16 06:16:55 -07:00
Niko Matsakis
5cd6bb1ed3 correct long line 2012-05-16 06:12:12 -07:00
Brian Anderson
8cc596ceb6 core: Fix typo 2012-05-16 00:03:57 -07:00
Brian Anderson
2adad1f7cd core: Generalize int-string conversions to all int types
Issue #2239
2012-05-15 23:46:40 -07:00
Brian Anderson
cb6ed42717 core: Generalize uint-string conversions to all uint types
Issue #2239
2012-05-15 22:50:35 -07:00
Brian Anderson
c424b7f847 core: Don't fail during port dtor 2012-05-15 16:13:42 -07:00
Brian Anderson
7277cd7198 core: Add task::unkillable 2012-05-15 16:13:42 -07:00
Eric Holk
97aba0b14f Adding more documentation to vec::each and vec::eachi to better explain the breaking protocol. 2012-05-14 16:55:40 -07:00
Niko Matsakis
63eb8e0e87 move purity checking into borrowck, addresses #1422 2012-05-11 14:05:58 -07:00
Paul Stansifer
5af58e7926 Removed all 4 uses of do ... while in the codebase. 2012-05-10 14:21:04 -07:00
Brian Anderson
4885ffb579 core: Export str::unsafe::from_buf_len/from_c_str_len 2012-05-07 15:56:53 -07:00
Tim Chevalier
1226669172 Comment only: add a FIXME on int::abs 2012-05-07 14:43:31 -07:00
Brian Anderson
1db88e7937 Clarify docs for path::normalize. Closes #2362 2012-05-07 13:38:59 -07:00
Niko Matsakis
50ec6bd2c3 new cap clause syntax 2012-05-04 12:33:08 -07:00
Brian Anderson
c6d33c3d37 core: Add comm::listen 2012-05-03 16:38:16 -07:00
Brian Anderson
13a4b59cc8 core: Add send/recv/peek methods for both ports and chans
Calling peek or recv on channels can fail when the associated port
is dead or unowned.
2012-05-03 16:38:16 -07:00
Brian Anderson
18f898315a core: Reorder declarations in comm so they read well 2012-05-03 16:38:16 -07:00
Brian Anderson
beb1a59f82 core: Add comm::recv_chan to receive from a channel 2012-05-03 16:38:16 -07:00
Niko Matsakis
cfa09d35a3 Revert "allow fn exprs to omit arg types"
This reverts commit 1ba4ca4c4a.
2012-05-03 14:42:34 -07:00
Niko Matsakis
1ba4ca4c4a allow fn exprs to omit arg types
also, avoid using type variables for fn args with omitted types
unless necessary.  This will be important for bound regions in
fn types.

fixes #2093
2012-05-03 14:32:32 -07:00
Niko Matsakis
f4cc5ff226 remove extra type parameter from ptr::is_null() and friends 2012-05-02 21:47:14 -07:00
Brian Anderson
4c54b21a6e core: Ignore 2 busticated getenv tests on windows 2012-05-02 17:50:15 -07:00
Niko Matsakis
2db4259b35 Stop inferring bot/static when types/regions are unconstrained.
Also, some other changes that came up along the way:
- add a 'blk' region for the current block.
- detect unused type/region variables.
2012-04-30 19:53:02 -07:00
Brian Anderson
5b98000279 core: Move global_env mod into os mod 2012-04-30 17:42:41 -07:00
Brian Anderson
46cc11ea88 core: Serialize all access to the environment using a weak global task 2012-04-30 17:34:29 -07:00
Tim Chevalier
85fbfa25d7 Revert "Eliminate a copy in syntax::parse::new_parser_from_file"
This reverts commit 2bb3b63ec4.

(I was confused.)
2012-04-30 11:52:07 -07:00
Tim Chevalier
2bb3b63ec4 Eliminate a copy in syntax::parse::new_parser_from_file
Fixing a FIXME turned out to be pretty involved. I added an io function
that returns a unique boxed string (for the contents of a file) rather than
a string, and went from there. Also made the src field of codemap a unique
boxed string. This doesn't seem to make that much difference in amount of
allocation according to valgrind (disappointingly), but I also had to introduce
a copy somewhere else pending a new snapshot, so maybe that's it.
2012-04-30 10:44:31 -07:00
Niko Matsakis
e348567f77 new, simpler approach to the iter library 2012-04-27 16:57:50 -07:00
Brian Anderson
0be41ce02b rustc: Remove old align_of intrinsic 2012-04-27 15:40:43 -07:00
Brian Anderson
dfc81dfa90 core: Add os::arch. Exposes target_arch string at runtime 2012-04-27 01:36:30 -07:00
Brian Anderson
e4277472d2 core: Split sys::align_of into min_align_of, pref_align_of 2012-04-27 00:12:42 -07:00
Graydon Hoare
753b683939 More slice use in vec, io, str, ebml, metadata encoder and decoder. 2012-04-25 17:19:36 -07:00
Tim Chevalier
f7641286b2 Allow classes to be cast to ifaces that are in the same crate
I had to xfail one existing test case (class-implements-int) because,
I think, of the same bug described in #2272.
2012-04-23 21:15:03 -07:00
Tim Chevalier
1c39fda0ea Rename option::get_or_default to get_default, for consistency 2012-04-23 20:52:50 -07:00
Niko Matsakis
0d3658bb43 rewrite the resolution infrastructure; but it's still grody 2012-04-23 08:02:58 -07:00
Brian Anderson
8688b1b845 core: Add os::walk_dir 2012-04-21 15:45:51 -07:00
Graydon Hoare
43061f3969 Add vec::unpack_slice, expose str::unpack_slice. 2012-04-20 17:37:17 -07:00
Jeff Olson
f06362d5bb exporting priv::weaken_task and adding some debug logging 2012-04-20 15:23:21 -07:00
Tim Chevalier
cdc8722f95 Add a lint pass to check for while true { ... } loops
And suggest changing them to loop { ... }. Had to fix the few
remaining while true loops (in core::io). Closes #1962.
2012-04-19 18:14:38 -07:00
Tim Chevalier
b0074c5a92 Disallow rebinding / matching against consts in alts
As per Issue #1193. Closes #1193.

I had to rename a few variables ("info" and "epsilon") to avoid
clashing with in-scope constants, which is responsible for all the
changes other than resolve and issue-1193.rs.
2012-04-19 16:21:15 -07:00
Brian Anderson
7a1dc76b0f core: Move set_exit_status from sys to os 2012-04-19 01:26:17 -07:00
Brian Anderson
1cad6322c3 core: Move last_os_error from sys to os 2012-04-19 01:23:00 -07:00
Brian Anderson
01e20dd0b3 core: Improve docs 2012-04-19 01:18:37 -07:00
Graydon Hoare
75cf13ec72 Add str/& component accessor and test. 2012-04-18 17:50:58 -07:00
Niko Matsakis
35a93e61d4 rewrite region resolution so it takes place in typeck 2012-04-16 19:48:00 -07:00
Brian Anderson
903cb0e3a5 core: Factor out uint/u8/16/32/64 mods into uint-template 2012-04-16 12:31:34 -07:00
Brian Anderson
6bb181341b core: Factor out int/i8/16/32/64 mods into int-template 2012-04-16 12:31:34 -07:00
Brian Anderson
7a2d7aa5de core: Add extension methods for is_null, is_not_null 2012-04-15 21:46:29 -07:00
Alexander Stavonin
5b308ec24a export buf_len from ptr 2012-04-15 16:40:47 +09:00
Brian Anderson
eb935b8fcb core: Use tilde-fences in docs
Backtick fences don't work for some reason
2012-04-14 17:17:57 -07:00
Grahame Bowland
6b5731e704 add inf/-inf/NaN parsing to float::from_str
add tests for "inf"/"-inf"/"NaN" conversion
add tests for "-0." -> -0., "0." -> 0.
2012-04-15 02:21:57 +08:00
Graydon Hoare
d85e48840d Trivial change to force a doc rebuild. 2012-04-13 19:51:04 -07:00
Niko Matsakis
dfc548ddda add option exec-env to set env variables during test execution 2012-04-13 12:41:37 -07:00
Niko Matsakis
c2fe288900 change to use && mode (can't move from upvar)
relevant to #1965
2012-04-13 10:41:46 -07:00
Tim Chevalier
16eb06c246 Annotate FIXMEs in core::vec 2012-04-12 23:38:53 -07:00
Tim Chevalier
93a1f5e85f Annotate FIXMEs in core::task 2012-04-12 23:38:25 -07:00
Tim Chevalier
a1b305c8e5 Remove or annotate FIXMEs in core::str
Trimmed exports in core::str::unsafe. Annotated other FIXMEs.

Also moved the test for str::unsafe::from_buf_len inside str_unsafe
since it's no longer exported. If it's not good to do that, let me
know.
2012-04-12 23:38:02 -07:00
Tim Chevalier
ea0063788b Add a run-fail test for result::get, get rid of a FIXME. Also some random other tests, mostly xfailed. 2012-04-12 20:24:07 -07:00
Niko Matsakis
e712ad8f73 rewrite lookup_method(), lookup_method_inner(), and lookup_method_inner_() 2012-04-11 17:21:53 -07:00
Graydon Hoare
9fda1578a2 Add ptr::position and ptr::buf_len, close #2183. 2012-04-11 15:46:51 -07:00
Brian Anderson
10236f8cd4 core: Make str::as_bytes handle failure. Closes #2156 2012-04-09 18:57:21 -07:00
Brian Anderson
9e1e42d750 core: Add tests for the string repr of infinity 2012-04-08 14:16:55 -07:00
Brian Anderson
56f09791fe Merge pull request #2164 from grahame/floatinfstr
write out "inf"/"-inf" in float::to_str_common
2012-04-08 13:55:22 -07:00
Grahame Bowland
2bee6132f9 write out "inf"/"-inf" in float::to_str_common 2012-04-09 01:33:36 +08:00
Brian Anderson
01dc4a8b26 core: Add priv::weaken_task 2012-04-07 19:56:41 -07:00
Jesse Ruderman
139420f664 Correctly filter . and .. from the file list. 2012-04-06 19:07:22 -07:00
Brian Anderson
63942c969d core: Add priv::chan_from_global_ptr
This allows singleton, globally accessible tasks to be created
2012-04-06 17:44:26 -07:00
Tim Chevalier
9d274ec5f2 Re-rename option functions
get_with_default (nee from_maybe) => get_default
with_option (nee maybe) => map_default
with_option_do (nee may) => iter

As per discussion of 21be1379d5
2012-04-06 12:20:13 -07:00
Marijn Haverbeke
fc202ca034 Remove support for old-style for
Closes #1619
2012-04-06 20:38:23 +02:00
Marijn Haverbeke
c902eafa14 Convert old-style for loops to new-style
Most could use the each method, but because of the hack used to
disambiguate old- and new-style loops, some had to use vec::each.

(This hack will go away soon.)

Issue #1619
2012-04-06 20:38:23 +02:00
Brian Anderson
ce8023b9ac Merge pull request #2139 from Jonanin/add_str_len
Add len to str extensions
2012-04-05 23:49:55 -07:00
Jon Morton
d621ada003 Add len to str extensions 2012-04-06 01:12:49 -05:00
Brian Anderson
d13c0c77a2 Explicitly use version 0.2 of crates 2012-04-05 20:29:42 -07:00
Niko Matsakis
b91c9f803d simplify typing rule for vector addition: use mutability of LHS 2012-04-05 15:18:26 -07:00
Tim Chevalier
98b07ddc82 Rename task::task_builder to task::builder
Closes #2120.
2012-04-05 14:09:32 -07:00
Graydon Hoare
2577e3eafc Tidy up predicate names in libcore. Should close #1431. 2012-04-04 18:08:55 -07:00
Erick Tryzelaar
72444636d3 std: Flesh out result::extensions. 2012-04-03 22:43:09 -07:00
Erick Tryzelaar
2ad20df40b std: Rename result::methods to result::extensions 2012-04-03 22:43:09 -07:00
Brian Anderson
12d3d4f125 core: Export is_null, is_not_null 2012-04-03 22:32:55 -07:00
Brian Anderson
3b8097dacc core: Add ptr::is_null/is_not_null 2012-04-03 21:56:16 -07:00
Brian Anderson
e325146eb4 Merge remote-tracking branch 'brson/mainthread'
Conflicts:
	src/rt/rust_kernel.cpp
	src/rt/rust_scheduler.cpp
	src/rt/rust_scheduler.h
2012-04-03 20:30:01 -07:00
Brian Anderson
bef72447e7 core: Add a scheduler mode, osmain, to spawn onto the main scheduler 2012-04-03 14:28:30 -07:00
Tim Chevalier
e9ff495942 Merge branch 'issue-1983' of https://github.com/thomaslee/rust into issue-2090
This adds a new os::copy_file function, contributed by Thomas Lee.
I added test cases.
2012-04-02 21:47:20 -07:00
Tim Chevalier
21be1379d5 Rename some core::option functions
from_maybe => get_with_default
maybe => with_option
may => with_option_do

I know these names are kind of ridiculous, but it's the best I could think of.
Feel free to bikeshed. Closes #2081
2012-04-02 16:12:49 -07:00
Brian Anderson
efe4c6af23 core: Use the or binop instead of the double-star binop 2012-04-01 15:05:29 -07:00
Jonathan Sternberg
3a0477c398 Fixing issue 1919. list_dir is the more general version that returns a vector with the contents of the directory. list_dir_path contains the old behavior (as a convenience function). 2012-04-01 11:39:17 -04:00
Brian Anderson
6e8cf935db core: Add each, each_char to str::extensions 2012-03-29 22:30:15 -07:00
Brian Anderson
8641c95221 core: Add str::each_char 2012-03-29 22:28:26 -07:00
Brian Anderson
9bff2f2545 core: Add each, eachi to vec::extensions 2012-03-29 22:17:11 -07:00
Brian Anderson
5d54defce4 core: Add extension methods for vec 2012-03-29 20:56:50 -07:00
Brian Anderson
f65ea0c812 core: Add extension methods for option 2012-03-29 20:56:50 -07:00
Brian Anderson
392d3c8d44 core: Add extension methods for str 2012-03-29 20:56:50 -07:00
Patrick Walton
c2f28e231f stdlib: Remove the now-obsolete vec::alloc_len in favor of vec::capacity 2012-03-29 08:57:34 -07:00
Patrick Walton
1d25594657 rustc: Add a vec::alloc_len and fix arena logic to use it 2012-03-29 08:41:26 -07:00
Brian Anderson
0d5d2e5e14 core: Don't use upcall_vec_grow from str::push_char 2012-03-29 00:20:05 -07:00
Grahame Bowland
7a87258155 Rewrite str::push_char in rust.
Avoid crossing to C to reallocate underlying array when possible,
if we must we now only cross once per char (not once per byte.)
2012-03-29 00:20:05 -07:00
Brian Anderson
b7b66b6cb3 core: Don't call into the runtime to reserve if we have capacity 2012-03-29 00:20:05 -07:00
Brian Anderson
c0a99790cb core: Add str::capacity 2012-03-29 00:20:05 -07:00
Brian Anderson
ad21976fbc core: Add vec::capacity 2012-03-29 00:20:05 -07:00
Brian Anderson
5e42c5cf19 core: Add str::reserve_at_least 2012-03-29 00:20:05 -07:00
Brian Anderson
b3d7823381 core: Add and use vec::reserve_at_least
This reserves in powers of two
2012-03-29 00:20:05 -07:00
Brian Anderson
8e743b2981 core: Improve docs for str::reserve 2012-03-29 00:20:05 -07:00
Brian Anderson
1446534271 core: Clarify docs on vec::reserve 2012-03-29 00:20:05 -07:00
Brian Anderson
8cf44bed57 core: Add int8_t, etc. types to libc::types::common::c99 2012-03-28 16:32:02 -07:00
Graydon Hoare
b37d7e26fe Update crate URLs to point to interesting things. 2012-03-28 13:52:47 -07:00
Brian Anderson
f4ee5582c7 core: Rename iter::to_list to to_vec. Closes #2056 2012-03-27 14:50:33 -07:00
Marijn Haverbeke
b5a4fa9456 Move some code over to iterator-for to see how it performs. 2012-03-27 15:46:33 +02:00
Marijn Haverbeke
eec6383771 Add vec::each, vec::eachi, and list::each
For use with the new for construct.

Issue #1619
2012-03-27 12:53:19 +02:00
Graydon Hoare
6e6798c4e1 Bulk-edit mutable -> mut. 2012-03-26 18:35:18 -07:00
Niko Matsakis
21111660ca Improve type inference to compute LUB/GLB 2012-03-26 10:34:58 -07:00
Niko Matsakis
bf9d714d46 Avoid unifying vars when possible; handle bot (more) correctly 2012-03-24 21:38:43 -07:00
Niko Matsakis
042c532a08 Implement new inference algorithm. 2012-03-23 21:47:28 -07:00
Tim Chevalier
1ffaedac2b Remove unneeded code 2012-03-23 16:25:10 -07:00
Tim Chevalier
17cd9b4308 Remove ctypes -- it's no longer used. 2012-03-23 16:25:10 -07:00
Tim Chevalier
cb0eeed539 Remove a FIXME and workaround that appear to be obsolete 2012-03-23 16:25:10 -07:00
Tim Chevalier
372673b58c Remove char::to_lower, char::to_upper, use libc versions instead
As per Graydon's comments on #1985: remove char::to_lower and
char::to_upper. The str versions of these functions now call
libc::tolower and libc::toupper (using wrappers that cast between
char and c_char). Not sure how much better that is, but it at least
makes it clearer that these functions are Unicode-unsafe.
2012-03-23 16:25:10 -07:00
Marijn Haverbeke
1b81c5112a Remove last vestiges of old-style intrinsics
Closes #2048
2012-03-23 16:08:01 +01:00
Marijn Haverbeke
0545e4a920 Support [rust_stack] annotation on native functions (crudely) 2012-03-23 10:49:47 +01:00
Marijn Haverbeke
894b7469d6 Replace most uses of intrinsics in core with builtins
Issue #1981
2012-03-23 10:49:47 +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
Marijn Haverbeke
bc3f5e7160 rustc: Replace intrinsic vec_len with unsafe Rust code
Preparation for #1981
2012-03-21 15:56:48 +01:00
Niko Matsakis
cfcbec3cc3 Implement an initial version of placement new. 2012-03-20 20:39:40 -07:00
Brian Anderson
b181ea415e core: Rename unsafe::leak to unsafe::forget. Closes #2031 2012-03-20 15:20:37 -07:00
Graydon Hoare
0973bccfe2 Fail when there's an error starting a process. Close #1778. 2012-03-20 12:38:57 -07:00
Graydon Hoare
716dc29ffc Minor io fixlet to account for racing against last_os_error. 2012-03-20 11:59:23 -07:00
Marijn Haverbeke
7a34ac5890 Revert order of arguments to option::maybe and from_maybe
Closes #2019
2012-03-20 14:55:07 +01:00
Brian Anderson
20417ebf31 core: Move unsafe conversions to str::unsafe 2012-03-19 15:47:52 -07:00
Brian Anderson
1a40aa0935 core: Make converting from a C string unsafe 2012-03-19 15:47:52 -07:00
Brian Anderson
bbfa08d947 rustc: Stop generating the flag_none #fmt flag. Issue #1993 2012-03-19 14:28:42 -07:00
Brian Anderson
a0c6ad0c51 core: Remove a FIXME. Closes #1992
This is too vague to ever fix
2012-03-19 14:17:59 -07:00
Brian Anderson
009bbadd92 core: Remove a FIXME. Closes #2002
It works for negative integers
2012-03-19 14:14:49 -07:00
Brian Anderson
0201a03203 core: Rename vec::*_from to _between to match str mod 2012-03-18 17:40:52 -07:00
Brian Anderson
13bcc73625 core: Rename vec::position_elt to position_elem 2012-03-18 17:40:49 -07:00
Brian Anderson
e4af1ca065 core: Add vec::unshift 2012-03-18 16:16:47 -07:00
Brian Anderson
397f33fd35 core: Don't require a copyable T for vec::push 2012-03-18 16:08:37 -07:00
Brian Anderson
b1eb4579c6 core: Improve the docs and signature of vec::iter2 2012-03-18 15:41:03 -07:00
Brian Anderson
d6ded6788d core: vec::filter_map doesn't require a copyable T 2012-03-18 15:26:05 -07:00
Brian Anderson
3ee4a15e5e core: Don't copy elements in filter_map 2012-03-17 18:17:27 -07:00
Brian Anderson
c139b348fe core: Fix signature of call_with_retptr. Closes #1987 2012-03-17 14:57:13 -07:00
Brian Anderson
154a3fdf44 rustc: Unify impl self types in the opposite order so variance is correct 2012-03-16 17:06:15 -07:00
Brian Anderson
3445454e79 core: Resolve and remove some FIXMEs 2012-03-16 16:46:32 -07:00
Brian Anderson
9e9f4a6240 core: Remove str::init_elt
This was added based on my FIXME, but I no longer believe it has a place in
core::str, partly because it doesn't follow current naming conventions, and
partly because it can be immitated with a one liner using str::from_chars and
vec::from_elem. I have replaced the existing uses with said one-liner.
2012-03-16 15:31:53 -07:00
Brian Anderson
47d468f08c core: Store reexporting result and either. Closes #1997 2012-03-16 15:14:37 -07:00
Brian Anderson
f80008f04b core: Add lots of string docs 2012-03-16 14:29:09 -07:00
Brian Anderson
3db8ae0bdc core: Remove extra backslashes from docs 2012-03-16 12:20:38 -07:00
Brian Anderson
a7132eeb1e core: Doc cleanup 2012-03-16 12:12:25 -07:00
Brian Anderson
0d88bf7e43 core: Escape some characters in comments 2012-03-16 11:58:39 -07:00
Erick Tryzelaar
2ddd084631 std: Add a function to iterate over a subset of a vec 2012-03-16 17:05:29 +01:00
Tim Chevalier
c86135e80b Comments only: associate core::libc FIXMEs with issue numbers 2012-03-15 23:12:07 -07:00
Tim Chevalier
2ef7d135a9 Comments only: associate core::iter FIXMEs with issue numbers 2012-03-15 23:12:07 -07:00
Tim Chevalier
f5da4881dc Comments only: issue numbers for FIXMEs 2012-03-15 23:12:06 -07:00
Tim Chevalier
c1c84e92dd Put the OS error in the error string in io::mk_file_writer() 2012-03-15 23:12:06 -07:00
Brian Anderson
389f53c6ff core: Docs 2012-03-15 18:58:30 -07:00
Tim Chevalier
07d0981bbb Comments only: associate FIXMEs with issue numbers in int library 2012-03-15 18:50:26 -07:00
Tim Chevalier
43b457c5d6 Comments only: associate FIXMEs in float libs with issue numbers 2012-03-15 18:46:17 -07:00
Tim Chevalier
20ec72830a Address FIXMEs in extfmt / add issue numbers 2012-03-15 17:50:22 -07:00
Tim Chevalier
ce3f369047 Change ctypes::intptr_t to int 2012-03-15 17:50:22 -07:00
Brian Anderson
bcf44f8cc1 core: Optimize str::unsafe::slice_bytes. Closes #1995 2012-03-15 17:10:39 -07:00
Brian Anderson
041c9a0863 core: Optimize str::bytes
This compiles down to a memmove. Takes about 1/4 of the time of the old
version.
2012-03-15 15:43:01 -07:00
Tim Chevalier
771177a814 Don't pass Unicode to char::is_upper 2012-03-15 15:40:43 -07:00
Tim Chevalier
26b54cc17e Add asserts to char::is_upper and char::is_lower
Add an assert that the argument char is ASCII, as well as adding
issue numbers to FIXMEs
2012-03-15 15:40:43 -07:00
Tim Chevalier
e697456d52 Associate FIXMEs with issue numbers (comments only) 2012-03-15 15:40:43 -07:00
Brian Anderson
844fbd83da core: Make some functions pure 2012-03-15 13:57:26 -07:00
Brian Anderson
561511e628 core: Channels are just port ids 2012-03-15 11:10:53 -07:00
Brian Anderson
1366d65660 rt: Remove remaining uses of rust_kernel::get_task_by_id 2012-03-15 11:10:52 -07:00
Brian Anderson
2a293ed8b8 Convert *u8 native string users to *c_char 2012-03-14 18:20:14 -07:00
Brian Anderson
e5dea87f43 core: Add str::from_c_str, from_c_str_len, as_c_str 2012-03-14 18:19:08 -07:00
Brian Anderson
3a2df84d89 core: Rename str::from_cstr et. al to from_buf 2012-03-14 18:19:08 -07:00
Brian Anderson
9e480708a2 core:: Eliminate str::sbuf. Replace with *u8 2012-03-14 18:19:08 -07: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
7c70d35a10 rewrite unify in a modal style, extend result module 2012-03-13 21:53:14 -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
Niko Matsakis
bdd0c9387b get new decorator extensions working 2012-03-13 21:30:06 -04:00
Brian Anderson
b968c8e6cd Name types after their modules instead of 't' 2012-03-13 15:14:17 -07:00
Brian Anderson
02e9400a82 core: Fix os::self_exe_path on FreeBSD 2012-03-13 13:51:03 -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
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
87d72303ad core: Remove empty bessel mod 2012-03-10 18:04:51 -08:00
Brian Anderson
e8f7bb0db1 core: Cleanup bool module
Instead of defining a type for bool, just use the bool type directly in order
to be more consistent with other modules. Cleanup the comments a bit.
2012-03-10 18:01:01 -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
035197609a core: Formatting 2012-03-10 17:29:58 -08:00
Brian Anderson
6d4fb35912 core Remove vec::enum_chars/uint. Closes #1955 2012-03-10 17:07:23 -08:00
Brian Anderson
e4bb2d707f core: Rename vec::tail_n to vec::tailn to match other fns 2012-03-10 00:44:13 -08:00
Brian Anderson
a0f0a704b0 core: Clean up comments and exports 2012-03-10 00:35:02 -08:00
Brian Anderson
b22556a6f8 core: 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
Graydon Hoare
7f55e7d087 Add a couple more missing pieces to libc and os. 2012-03-09 16:38:23 -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
Niko Matsakis
713006c7b6 add mutability annotations to libcore 2012-03-07 07:47:50 -08:00
Brian Anderson
ae5ea85c36 core: Resolve a FIXME in box::ptr_eq 2012-03-06 19:15:39 -08:00
Graydon Hoare
04e7bd6758 More UTF-16 wrapping on win32. Close #1927. 2012-03-06 18:49:08 -08:00
Graydon Hoare
e9571850da UTF-16-ify the win32 env routines. 2012-03-06 16:03:39 -08:00
Graydon Hoare
0e3dd5a3ee Export os, libc and path from libcore. 2012-03-06 16:03:39 -08:00
Brian Anderson
e9b5f4204a core: Remove some explicit move capture clauses 2012-03-06 13:05:03 -08:00
Brian Anderson
d1c6e34e1c core: Inline a bunch of unsafe functions 2012-03-06 11:20:43 -08:00
Brian Anderson
ee991cae81 rt: Add a hack to fix a port detach bug 2012-03-05 20:02:25 -08:00
Brian Anderson
958c321083 rt: Fix the atomic get_ref_count method to avoid races 2012-03-05 19:39:56 -08:00
Brian Anderson
1347d04bb0 rt: Properly block tasks while waiting for port detach 2012-03-05 19:39:56 -08:00
Brian Anderson
77295c56c5 rt: Simplify the recv interface 2012-03-05 19:39:56 -08:00
Niko Matsakis
3269a4043c rewrite vec to be more unsafe, more inlined 2012-03-05 16:47:52 -08:00
Graydon Hoare
5bf185b499 Port fsync, waitpid and remove_file to core::{os,libc}. 2012-03-05 14:00:44 -08:00
Brian Anderson
2d7750bc30 core: Fix os::load_self types on FreeBSD 2012-03-02 22:43:56 -08:00
Graydon Hoare
5812bebf87 Sadly, vec::init_elt_mut vanished since last (rushed) rebase. 2012-03-02 18:53:06 -08:00
Graydon Hoare
dafd649806 First cut at consolidated core::os module built on core::libc. 2012-03-02 18:46:13 -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
Graydon Hoare
47e7a05a28 Add some utf16 routines for OS API interop. 2012-03-02 15:47:40 -08:00
Niko Matsakis
def72bda47 retool inline encoding to handle methods, fix tests 2012-03-02 06:47:25 -08:00
Brian Anderson
99f231f347 core: Change a number of arguments in vec to const vecs 2012-02-29 18:13:29 -08:00
Niko Matsakis
7d0958f70f add the ability to snag the frame so we can verify that we are inlining 2012-02-29 11:54:47 -08:00
Patrick Walton
362f23641a libcore: Remove vec::to_ptr in favor of vec::unsafe::to_ptr. Closes #1829. 2012-02-28 20:43:39 -08:00
Erick Tryzelaar
8cc23aab6d expose float::pow_with_uint. 2012-02-28 18:00:50 -08:00
Erick Tryzelaar
6865df2611 core/std: whitespace fixes. 2012-02-28 18:00:50 -08:00
Niko Matsakis
e65c39c100 add #[inline] to vec::iter 2012-02-28 06:31:29 -08:00
Graydon Hoare
324ecb58a7 Add libc module to libcore and utility file to help generate it. 2012-02-27 18:34:42 -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
1d2b4b97ed Optimize str::replace 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
Marijn Haverbeke
35e9192762 Make str::pop_char and str::unsafe::pop_byte efficient
O(1) rather than O(string len)
2012-02-23 17:00:19 +01:00
Kevin Cantu
c2984b46b4 (core::str) comments 2012-02-23 17:00:19 +01:00
Kevin Cantu
961b6446b6 (core::str) rename ++ 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
cec053487c (core::str) stop using index_chars 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
2756a61e34 (core::str) add index, index_from, rindex which return byte positions of chars; rename find to find_chars; add fixmes to delete byte_index, byte_index_from 2012-02-23 17:00:19 +01:00
Kevin Cantu
e1d04e0062 (core::str) add a safe byte slice and maybe_slice ++ 2012-02-23 17:00:19 +01:00
Kevin Cantu
7c78b7dfed (core::str) add a safe byte slice and maybe_slice 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
969fdf419c (core::str) rename index -> index_chars 2012-02-23 17:00:19 +01:00
Kevin Cantu
8ea96169ff (core::str) make len an alias for len_bytes ++ 2012-02-23 17:00:19 +01:00
Kevin Cantu
669ff690fd (core::str) make len an alias for len_bytes 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
a3b655f8e3 Fix uint/u64 confusion
Causes a failure on 32-bit platforms
2012-02-22 13:44:55 +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
72373438d2 Add core::to_str module
Provides a central iface for the various stringification
functions.
2012-02-22 13:06:38 +01:00
Marijn Haverbeke
ad03761a97 Remove preconditions from libraries
Closes #1805
2012-02-22 11:47:47 +01:00
Brian Anderson
a896eb326e core: Fix unused variable warning 2012-02-21 14:25:51 -08:00
Brian Anderson
6527fc3925 core: Fix to_str_exact for floats with no decimal component 2012-02-21 14:25:31 -08:00
Brian Anderson
910a32c7c7 core: Add option::unwrap
This function uses some unsafe code to move the value out of an option.
2012-02-21 13:55:50 -08:00
Brian Anderson
9691ce18a2 core: Resolve a FIXME in str module 2012-02-21 01:03:13 -08:00
Brian Anderson
4601810747 core: Remove a useless test from option mod 2012-02-20 22:43:33 -08:00
Brian Anderson
4220dcf1e9 core: New task API 2012-02-20 18:58:04 -08:00
Brian Anderson
6b280c61ce core: Export future mod 2012-02-18 23:03:26 -08:00
Brian Anderson
23d36be1e9 core: Define futures in terms of local functions, of which port::recv is one possibility 2012-02-18 15:23:56 -08:00
Brian Anderson
4370188055 Merge pull request #1860 from erickt/master
add str::find_from_bytes and str::index_from_bytes
2012-02-18 13:17:12 -08:00
Brian Anderson
3411d19369 core: Make vec::push faster
This way makes it equivalent to the compiler's vec push, and is a lot
faster than calling vec::grow.
2012-02-17 18:15:52 -08:00
Marijn Haverbeke
ff42964546 Clean up some of trans using block combinators
`with_scope` and `with_cond` can be used to wrap a piece of code in a
scope block, or conditionalize it on a value, without doing all the
context-creation and jumping by hand.

Also renames @block_ctxt to block to reduce noise.
2012-02-17 23:03:12 +01:00
Graydon Hoare
2796ab6de9 Add a win32-ignore attribute to a should-fail test. 2012-02-17 11:28:18 -08:00
Erick Tryzelaar
23703c0661 core: add str::find_from. 2012-02-16 19:16:08 -08:00
Erick Tryzelaar
042a5222d1 core: rewrite str::byte_index to use vec functions 2012-02-16 18:35:45 -08:00
Erick Tryzelaar
d1c9b160ad core: slim down str.rs by importing some and none. 2012-02-16 17:30:56 -08:00
Brian Anderson
601f7144d8 core: Add comm::select2
Receives on two ports simultaneously
2012-02-16 12:53:18 -08:00