Commit graph

18951 commits

Author SHA1 Message Date
Huon Wilson
3ac00a9489 std: remove substr & str::count_*, methodise char_len, implement slice_chars.
The confusing mixture of byte index and character count meant that every
use of .substr was incorrect; replaced by slice_chars which only uses
character indices. The old behaviour of `.substr(start, n)` can be emulated
via `.slice_from(start).slice_chars(0, n)`.
2013-06-12 12:21:04 +10:00
Huon Wilson
9fff8c6eba std: add a test for HashMap::find_equiv. 2013-06-12 12:21:04 +10:00
Huon Wilson
efc71a8bdb std: unify the str -> [u8] functions as 3 methods: .as_bytes() and .as_bytes_with_null[_consume]().
The first acts on &str and is not nul-terminated, the last two act on strings
that are always null terminated (&'static str, ~str and @str).
2013-06-12 12:21:04 +10:00
Huon Wilson
ba4a4778cc std: convert str::{*shift,pop}* to methods. 2013-06-12 12:21:04 +10:00
Huon Wilson
8786bca7e2 std: convert str::repeat to a method. 2013-06-12 12:21:03 +10:00
Huon Wilson
3c23a0a836 std: replace str::append with a method 2013-06-12 12:21:03 +10:00
Huon Wilson
96cd61ad03 std: convert {vec,str}::to_owned to methods. 2013-06-12 12:21:03 +10:00
SiegeLord
d641b0b575 Alter rust.css to make the documentation look more appealing 2013-06-11 20:43:26 -04:00
bors
e06579bc09 auto merge of #7056 : alexcrichton/rust/issue-4727, r=catamorphism
Closes #4727
2013-06-11 17:22:46 -07:00
Ron Dahlgren
37489a67e5 Iterator documentation fixes
Fixes two typos and one incorrect description.
2013-06-11 16:34:03 -07:00
bors
3f900dc7d1 auto merge of #7055 : thestinger/rust/iterator, r=catamorphism
This was a lot more painful than just changing `x.each` to `x.iter().advance` . I ran into my old friend #5898 and had to add underscores to some method names as a temporary workaround.

The borrow checker also had other ideas because rvalues aren't handled very well yet so temporary variables had to be added. However, storing the temporary in a variable led to dynamic `@mut` failures, so those had to be wrapped in blocks except where the scope ends immediately.

Anyway, the ugliness will be fixed as the compiler issues are fixed and this change will amount to `for x.each |x|` becoming `for x.iter |x|` and making all the iterator adaptors available.

I dropped the run-pass tests for `old_iter` because there's not much point in fixing a module that's on the way out in the next week or so.
2013-06-11 16:19:42 -07:00
Daniel Micay
fbae011ad1 fix the docstring for copy_nonoverlapping_memory 2013-06-11 19:06:01 -04:00
Daniel Micay
107e371bf0 fix the ptr::set_memory docstring 2013-06-11 17:48:44 -04:00
bors
1175e94de3 auto merge of #7033 : influenza/rust/rust-7022, r=graydon
This commit fixes #7022 - I've added an additional check to ensure that
stk is not null before dereferencing it to get it's next element,
assigning NULL if it is itself NULL.
2013-06-11 14:40:48 -07:00
bors
da9172af60 auto merge of #7040 : alexcrichton/rust/issue-6511-threadsafe-llvm, r=graydon
This is a reopening of #6570, and almost fixes #6511.

Note that this doesn't actually enable building a threadsafe LLVM, because that will require an LLVM rebuild which will be bundled with the upgrades in #6713.

What this does do, however, is removes all thread-unsafe usage of LLVM from the compiler.
2013-06-11 13:46:54 -07:00
Björn Steinbrink
f526434197 Codegen: Combine two PointerCasts into one
Shaves off a percent or so from the LLVM passes for librustc.
2013-06-11 22:45:13 +02:00
Ron Dahlgren
37c8558895 Replace tabs with spaces 2013-06-11 13:10:41 -07:00
Alex Crichton
78404af882 Ignore the test_package_request_version test for now 2013-06-11 12:40:53 -07:00
Alex Crichton
305f5110a7 Add a finally impl for extern "Rust" fn() 2013-06-11 12:40:40 -07:00
Brian Anderson
48c7bc17c6 rustc: Remove task type defs from trans 2013-06-11 12:36:42 -07:00
Daniel Micay
bbe3d4a9dc fix windows build 2013-06-11 15:00:58 -04:00
Daniel Micay
004816f4c6 option: remove redundant old_iter impls 2013-06-11 14:06:12 -04:00
Daniel Micay
4f2f545ac2 add Iterator implementations for Option 2013-06-11 14:05:27 -04:00
bors
d0b1979004 auto merge of #7035 : influenza/rust/getopts-doc-update, r=bstrie
The documentation was still refering to getopts as though it was in the
std module - I've changed this to refer to extra instead.
2013-06-11 10:46:37 -07:00
Ron Dahlgren
301f9001c0 Assert stk rather than checking null
Given that a big stack is never requested before allocating an initial
stack segment, having a non-null stk member here is an invariant.
2013-06-11 10:11:49 -07:00
bors
d1d855993d auto merge of #7047 : bblum/rust/bug_triage, r=graydon
r? anybody
2013-06-11 09:52:40 -07:00
bors
bf41586a18 auto merge of #7058 : Blei/rust/fix-7048, r=bstrie 2013-06-11 08:01:50 -07:00
Philipp Brüschweiler
3f62f9bccd ty: several small fixes to is_instantiable
* Don't return early, so logging is not skipped
* Remove one allocation
* Indent the match statement correctly
2013-06-11 11:44:53 +02:00
Philipp Brüschweiler
278b3beafe decoder: better error message when failing to look up an id 2013-06-11 11:44:53 +02:00
Philipp Brüschweiler
1ac90bb74b lexer: show correct span on unrecognized token start
Fixes part of #7048.
2013-06-11 11:44:53 +02:00
bors
075da9c3e9 auto merge of #7050 : huonw/rust/extra-complex-work, r=Aatch 2013-06-11 00:22:34 -07:00
bors
6bdd4c8545 auto merge of #7054 : yichoi/rust/after_jemalloc, r=brson
jemalloc searches pthread_atfork
2013-06-10 23:28:34 -07:00
Young-il Choi
febba9f418 rt: dummy function pthread_atfork for android 2013-06-11 14:52:15 +09:00
bors
df5b0c040c auto merge of #7046 : luqmana/rust/issue-7044, r=sanxiyn
Fixes #7044.
2013-06-10 20:52:32 -07:00
Huon Wilson
19c31b6b1a extra: implement .norm(), and Polar conversion functions for complex numbers.
Also, convert complex to use Clone, rather than Copy.

Fixes #5734 and #5735.
2013-06-11 11:37:33 +10:00
Huon Wilson
7e6a5940cb std: convert pow, hypot, atan2, log to take arguments by reference. 2013-06-11 11:36:03 +10:00
bors
37733c7eaf auto merge of #7042 : kballard/rust/terminfo-searcher-paths, r=thestinger
r? @cmr
2013-06-10 16:31:31 -07:00
Kevin Ballard
8f1edd5307 terminfo: Support more terminfo directory structures
OS X's terminfo uses the hex representation of the first character of
the terminal name as the directory name.

Ubuntu seems to use /lib/terminfo instead of /usr/share/terminfo, at
least on the one machine I have access to.
2013-06-10 15:52:10 -07:00
Ben Blum
8081aea3b8 Tag a bunch of destructors that need mutable self with FIXME for #4330. Close #4943. 2013-06-10 18:18:04 -04:00
Luqman Aden
693b9ce4e8 Add test for #7044. 2013-06-10 18:06:56 -04:00
Luqman Aden
a95232a59e librustc: Better errors for duplicate definitions. 2013-06-10 18:00:57 -04:00
Ben Blum
d25fae0e10 Remove 'this could be clearer' FIXME. Looks fine. Close #2618. 2013-06-10 17:51:02 -04:00
Ben Blum
967c7d828a Replace str::raw::buf_as_slice with c_str_to_static_slice. Close #3843. 2013-06-10 17:34:28 -04:00
Luqman Aden
5a3e1cdaec librustc: Don't allow newtype or unit-like structs to shadow other names in the value namespace. 2013-06-10 17:29:48 -04:00
Alex Crichton
5c5095d25e Have JIT execution take ownership of the LLVMContextRef
Also stop leaking the ExecutionEngine created for jit code by forcibly disposing
of it after the JIT code has finished executing
2013-06-10 13:17:04 -07:00
Alex Crichton
779191cd4b Remove all usage of the global LLVMContextRef
This allows parallel usage of the rustc library
2013-06-10 13:17:04 -07:00
bors
1310212c27 auto merge of #7032 : huonw/rust/each-fn-kill, r=thestinger
Continuation of #7015, and #6995.

Rewrites the character-based `each_split` functions in `str` to use an iterator, removes a few redundant methods, and replaces all uses of `len`, `is_empty` and `slice` functions with the methods (and deletes the the functions).

Update: Ok, this has turned into a major makeover for `str`, turning a lot of functions into methods, and removing redundant ones. Each commit is essentially a single such change.

(Unscientific benchmarks suggest that the external `split_iter` is approximately 10% faster than the internal one. I'm not quite sure why this would be true.)

(@thestinger is probably interested in this.)
2013-06-10 12:10:39 -07:00
Huon Wilson
e8782eeb63 fix tests, remove some warnings 2013-06-11 02:34:14 +10:00
Huon Wilson
2fa83c0503 std: replace str::is_{alphanumeric,whitespace} with the methods. 2013-06-11 01:07:52 +10:00
Huon Wilson
838191c40b std: replace str::{starts,ends}_with with the method. 2013-06-11 01:03:24 +10:00