Tim Chevalier
7441a90fd9
Comments only: annotate FIXMEs
2012-06-14 18:21:17 -07:00
Tim Chevalier
9e9e280446
annotate FIXME in iter-trait
2012-06-14 17:57:22 -07:00
Tim Chevalier
8945255559
Comments only: Annotate FIXMEs in libcore
2012-06-14 17:56:41 -07:00
Tim Chevalier
ffc9fff720
In dvec, annotate a FIXME and uncomment append_iter
...
I uncommented append_iter and made it compile. I hope it wasn't
horribly flawed in some other way... but if so, there was no comment
explaining how.
2012-06-14 17:56:41 -07:00
Patrick Walton
e38eaed978
Add a Num typeclass
2012-06-14 10:55:49 -07:00
Erick Tryzelaar
48e877a435
Rewrite int/uint helper functions to use refs
...
This lets us pass them to generic functions.
2012-06-12 18:10:19 -07:00
Erick Tryzelaar
4335ce47f3
Convert most str and vec fns to slices
2012-06-12 18:10:18 -07:00
Brian Anderson
07bba397c5
core: More stack walking
2012-06-11 22:44:55 -07:00
Brian Anderson
8fea5260c2
core: Don't deadlock on io streams in run::program_output
...
We can't just read all of stdout before stderr or it will cause
deadlocks for children that want to write a lot to stderr
I could not come up with an obvious cross-platform way to easily
test this.
2012-06-08 23:00:59 -07:00
Brian Anderson
c91d5aa95c
Merge pull request #2560 from bstrie/num
...
Allow multiple `num` impls to be imported at once
2012-06-08 22:59:53 -07:00
Ben Striegel
d14d4155de
Allow multiple num
impls to be imported at once
...
If we import num::num, it gets reexported implicitly and causes collisions if
you try to import (for example) int::num and i8::num at the same time.
2012-06-09 01:36:26 -04:00
Patrick Walton
5a04069042
Merge pull request #2559 from mozilla/incoming
...
Incoming
2012-06-08 20:37:57 -07:00
Brian Anderson
45f2926144
core: Inline unsigned range function
2012-06-08 18:49:50 -07:00
Ben Striegel
89e424d373
Inline range
for all integral types
2012-06-08 21:18:41 -04:00
Patrick Walton
8ce0215f1b
core: "inlune" is not an attribute
2012-06-08 17:57:39 -07:00
Patrick Walton
fbd583bde2
core: Implement string equal natively to save a call into the shape code. Shaves a couple of seconds off rustc.
2012-06-08 17:38:12 -07:00
Brian Anderson
7a74545e97
Convert reinterpret_cast + forget to 'transmute'
2012-06-08 10:58:46 -07:00
Brian Anderson
f12adcbf93
core: Add unsafe::transmute
...
Like reinterpret_cast + forget
2012-06-08 10:58:46 -07:00
Brian Anderson
95b9d538b8
Use #[cfg(unix)] and #[cfg(windows)] everywhere
2012-06-07 22:28:00 -07:00
Brian Anderson
c058f1d992
core: Remove transitional code
2012-06-07 19:12:12 -07:00
Patrick Walton
7571ee85c4
Merge branch 'incoming'
2012-06-07 18:50:42 -07:00
Patrick Walton
e158ce8a9d
Add neg() to the num iface
2012-06-07 18:27:10 -07:00
Patrick Walton
02b7089e15
libcore: Add a num typeclass
2012-06-07 17:25:54 -07:00
Patrick Walton
3d7400f3ac
Add a Num typeclass
2012-06-07 16:08:38 -07:00
Niko Matsakis
3cbd1e221e
mark addr_or and friends pure
2012-06-07 07:18:29 -07:00
Brian Anderson
5f4837ad6a
core: Start on a stack walker
2012-06-06 23:39:56 -07:00
Brian Anderson
2c5a660c99
core: Add os::family. Returns either 'windows' or 'unix'
2012-06-06 23:39:09 -07:00
Niko Matsakis
3b4cfdeee2
Merge remote-tracking branch 'mozilla/incoming'
...
Conflicts:
src/rustc/middle/tstate/auxiliary.rs
2012-06-06 19:00:34 -07:00
Niko Matsakis
0d20717fab
add some purity annotations in dvec/vec, occasional accessor method
2012-06-06 18:37:07 -07:00
Niko Matsakis
b828df93f6
miscellaneous pure annotations and other small changes.
...
it seems that, to be truly useful, pure fns really need the
ability to modify their parameters. alternatively, we could
rewrite the functions that modify their arguments to take/return.
2012-06-06 18:36:54 -07:00
Niko Matsakis
83d290f461
add misc. pure modifiers in core
2012-06-06 18:36:29 -07:00
Niko Matsakis
bede54b14a
misc. copies in core/syntax to please borrowck
2012-06-06 18:36:15 -07:00
Brian Anderson
ef32ffd0b1
core: Remove swappable. Unused
2012-06-06 17:48:45 -07:00
Tim Chevalier
a6c92f0a17
Revert "Revert "Merge pull request #2516 from mozilla/incoming" due to failures"
...
This reverts commit 9fae95860de510f6874810cf43efb83f101246ef.
2012-06-06 15:08:24 -07:00
Patrick Walton
d64ff98311
Revert "core: Remove swappable. Unused" due to test failures
...
This reverts commit ec5cbb4f5e
.
2012-06-06 11:40:04 -07:00
Patrick Walton
055158d051
Revert "Merge pull request #2516 from mozilla/incoming" due to failures
...
This reverts commit adb717b5fa
, reversing
changes made to aabf84cdd8
.
2012-06-06 11:39:19 -07:00
Patrick Walton
d9cdddeb5f
stdlib: Introduce ord and eq interfaces. Make std::sort::quick_sort3 use them. i=#2348
2012-06-05 17:26:52 -07:00
Brian Anderson
ec5cbb4f5e
core: Remove swappable. Unused
2012-06-05 14:47:20 -07:00
Brian Anderson
78fe75a741
rt: Fix iaac_init using wrong type and not seeding correctly
...
This was a result of changing the vector representation to contain
a box header.
2012-06-05 00:21:19 -07:00
Michael Sullivan
6396e2c3c3
Make vecs implicitly copyable for all of our projects.
2012-06-04 19:53:30 -07:00
Eric Holk
1e8f501343
Machine types are different from int/uint, etc (Issue #2187 )
2012-06-04 19:16:47 -07:00
Graydon Hoare
5f904d278f
Shave off one more string append in a rare case.
2012-06-04 19:01:24 -07:00
Graydon Hoare
7803488a43
Implement stack-only variants of int/uint str conversion and output.
2012-06-04 18:06:59 -07:00
Brian Anderson
2d0e7cd272
core: Don't allow radix 1 in uint::to_str
2012-06-04 15:22:40 -07:00
Brian Anderson
6e0085210c
core: Make uint::to_str faster
2012-06-04 14:30:57 -07:00
Niko Matsakis
01b5777c8b
prohibit type parameters in native fns and other minor fixes
...
trans now can safely assert that it never sees a type param
2012-06-03 20:03:08 -07:00
Brian Anderson
8fbd5ac049
core: Add str::is_alphanumeric fn and method
2012-06-02 23:42:20 -07:00
Niko Matsakis
3f6e6532ac
make vec fns/methods take imm slices.
...
this also repairs the unsoundness in typing of unpack_slice,
which was silently converting a const ptr to an imm one.
2012-06-02 19:14:57 -07:00
Kevin Cantu
a7359f5b3b
(float) fix some rounding errors when showing as str
...
This seems to fix issue #1876 , and some of the superficial parts of
issue #1375 . The #fmt macro and the to_str functions will round,
rather than truncate, floats as strings.
Other issues remain, and I wrote more code here than intended, but the
following should pass now.
```
fn x() {
assert "3.1416" == #fmt["%.4f", 3.14159];
assert "3" == #fmt["%.0f", 3.14159];
assert "99" == #fmt["%.0f", 98.5];
assert "7.0000" == #fmt["%.4f", 6.999999999];
assert "3.141590000" == #fmt["%.9f", 3.14159];
}
```
2012-06-02 16:38:18 -07:00
Niko Matsakis
c5f2c1d61e
add some purity annotations in core
2012-06-02 10:08:00 -07:00
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