Commit Graph

684 Commits

Author SHA1 Message Date
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