Commit Graph

17049 Commits

Author SHA1 Message Date
Daniel Micay
845465ee24 old_iter: rm the min/max free functions 2013-06-15 22:16:22 -04:00
Daniel Micay
52a38b8097 fix test 2013-06-15 22:16:22 -04:00
Daniel Micay
e097d5eaba rm CopyableOrderedIter
replaced with OrdIterator
2013-06-15 22:16:21 -04:00
Daniel Micay
6c547e42c8 rm vec::uniq_len 2013-06-15 22:16:21 -04:00
Huon Wilson
30973ccb90 std: allow any sort of string to be Added with +. 2013-06-16 10:50:28 +10:00
Huon Wilson
ee25cf8d75 std: test-fixes, remove warnings, syntax highlighting for code examples. 2013-06-16 10:50:28 +10:00
Huon Wilson
4686ed1a1d std: continue improving the comparison trait impls for str.
This moves them all into the traits submodule, and delegates Ord
to the TotalOrd instance. It also deletes the stand-alone lt, gt,
ge and le functions.
2013-06-16 10:50:28 +10:00
Huon Wilson
42974d3bc4 std: simplify the string comparison implementations, using iterators. 2013-06-16 10:50:28 +10:00
Huon Wilson
f1886680e0 std: convert str::to_utf16 to a method. 2013-06-16 10:50:28 +10:00
Huon Wilson
4b18fff2be std: convert str::{map,levdistance,subslice_offset} to methods.
The first two become map_chars and lev_distance. Also, remove a few
allocations in rustdoc.
2013-06-16 10:50:28 +10:00
bors
c989b79127 auto merge of #7132 : thestinger/rust/rpath, r=brson
This is a bad default, because the binaries will point at an absolute
path regardless of where they are moved. This opens up a security issue
for packages, because they will attempt to load libraries from a path
that's often owned by a regular user.

Every Rust binary is currently flagged by Debian, Fedora and Arch lint
checkers as having dangerous rpaths. They don't meet the requirements to
be placed in the repositories without manually stripping this from each
binary.

The relative rpath is still enough to keep the binaries working until
they are moved relative to the crates they're linked against.

http://wiki.debian.org/RpathIssue
https://fedoraproject.org/wiki/Packaging:Guidelines#Beware_of_Rpath
2013-06-15 16:13:09 -07:00
Brian Anderson
069086cdb4 Remove the fuzzer
It is suffering from a bad case of megabitrot.
2013-06-15 16:12:56 -07:00
Brian Anderson
0f9c191d8f std: Remove doc references to reinterpret_cast 2013-06-15 15:22:22 -07:00
Daniel Micay
708395d65d stop using an absolute rpath
This is a bad default, because the binaries will point at an absolute
path regardless of where they are moved. This opens up a security issue
for packages, because they will attempt to load libraries from a path
that's often owned by a regular user.

Every Rust binary is currently flagged by Debian, Fedora and Arch lint
checkers as having dangerous rpaths. They don't meet the requirements to
be placed in the repositories without manually stripping this from each
binary.

The relative rpath is still enough to keep the binaries working until
they are moved relative to the crates they're linked against.

http://wiki.debian.org/RpathIssue
https://fedoraproject.org/wiki/Packaging:Guidelines#Beware_of_Rpath
2013-06-15 18:17:24 -04:00
Daniel Micay
79cd2dbe72 iterator: work around method resolve bug 2013-06-15 18:02:05 -04:00
Daniel Micay
2df66a84cd iterator: add a position adaptor 2013-06-15 17:56:54 -04:00
Daniel Micay
eb5ac84c8e iterator: add a find adaptor 2013-06-15 17:53:12 -04:00
James Miller
f2a7fc69da Fix Merge Fallout 2013-06-16 09:20:40 +12:00
James Miller
cc908b772c Remove @-fields from CrateContext
Remove all the explicit @mut-fields from CrateContext, though many
fields are still @-ptrs.
This required changing every single function call that explicitly
took a @CrateContext, so I took advantage and changed as many as I
could get away with to &-ptrs or &mut ptrs.
2013-06-16 09:20:40 +12:00
Kevin Ballard
9c4f9bb71b Fix terminfo::param %i op 2013-06-15 14:20:34 -07:00
James Miller
01e098aa05 Make CrateContext::new() fn.
Move construction of a CrateContext into a static method on
CrateContext.
2013-06-16 09:17:50 +12:00
James Miller
b1f39ce403 Move CrateContext into it's own file 2013-06-16 09:17:50 +12:00
James Miller
98b1c9e207 Move trans mod items into trans/mod.rs 2013-06-16 09:17:50 +12:00
bors
998e41a11a auto merge of #7154 : dotdash/rust/glue, r=graydon
Currently, when calling glue functions, we cast the function to match
the argument type. This interacts very badly with LLVM and breaks
inlining of the glue code.

It's more efficient to use a unified function type for the glue
functions and always cast the function argument instead of the function.

The resulting code for rustc is about 13% faster (measured up to and
including the "trans" pass) and the resulting librustc is about 5%
smaller.
2013-06-15 12:58:06 -07:00
Steven Stewart-Gallus
f22580dd29 Fix up mingw32 case 2013-06-15 11:26:02 -07:00
Philipp Brüschweiler
4ee99a1c0c trans::glue: don't generate struct destructors in the free glue
The free glue shouldn't be called for structs, and the drop glue already
contains the destructor.
2013-06-15 20:13:23 +02:00
gareth
d22f417c74 Add IterBytes impls for float/f32/f64. This allows creating
HashMaps with floats as keys.
2013-06-15 17:58:38 +01:00
Björn Steinbrink
a08d768cd8 Fix inlining of glue code
Currently, when calling glue functions, we cast the function to match
the argument type. This interacts very badly with LLVM and breaks
inlining of the glue code.

It's more efficient to use a unified function type for the glue
functions and always cast the function argument instead of the function.

The resulting code for rustc is about 13% faster (measured up to and
including the "trans" pass) and the resulting librustc is about 5%
smaller.
2013-06-15 18:29:19 +02:00
Philipp Brüschweiler
3f69e20043 trans::glue: don't allocate a pointer variable if it already exists
Removes one alloca and store from the drop glue of @ boxes. This speeds
up the rustc build by 1s (might be noise, though).
2013-06-15 18:21:47 +02:00
bors
eac0200f18 auto merge of #7148 : catamorphism/rust/rustpkg_tests, r=graydon
r? @graydon Automate more tests described in the commands.txt file,
and add infrastructure for running them. Right now, tests shell
out to call rustpkg. This is not ideal.

Goes part of the way towards addressing #5683
2013-06-15 08:12:57 -07:00
bors
82f2e4dc9f auto merge of #7147 : huonw/rust/vec-connect, r=Aatch
This is caused by StrVector having a generic implementation for &[S]
and so #5898 means that method resolution of ~[~[1]].concat() sees that
both StrVector and VectorVector have methods that (superficially) match.

They are now connect_vec and concat_vec, which means that they can actually be
called.
2013-06-15 06:54:59 -07:00
bors
ac6f15417d auto merge of #7130 : huonw/rust/rustdoc-highlight, r=thestinger
This means that type definitions and function signatures have
pretty colours.
2013-06-15 05:49:02 -07:00
bors
6df66c194d auto merge of #7109 : bblum/rust/rwlocks, r=brson
r? @brson

links to issues: #7065 the race that's fixed; #7066 the perf improvement I added. There are also some minor cleanup commits here.

To measure the performance improvement from replacing the exclusive with an atomic uint, I edited the ```msgsend-ring-rw-arcs``` bench test to do a ```write_downgrade``` instead of just a ```write```, so that it stressed the code paths that accessed ```read_count```. (At first I was still using ```write``` and saw no performance difference whatsoever, whoooops.)

The bench test measures how long it takes to send 1,000,000 messages by using rwarcs to emulate pipes. I also measured the performance difference imposed by the fix to the ```access_lock``` race (which involves taking an extra semaphore in the ```cond.wait()``` path). The net result is that fixing the race imposes a 4% to 5% slowdown, but doing the atomic uint optimization gives a 6% to 8% speedup.

Note that this speedup will be most visible in read- or downgrade-heavy workloads. If an RWARC's only users are writers, the optimization doesn't matter. All the same, I think this more than justifies the extra complexity I mentioned in #7066.

The raw numbers are:
```
with xadd read count
        before write_cond fix
                4.18 to 4.26 us/message
        with write_cond fix
                4.35 to 4.39 us/message
                
with exclusive read count
        before write_cond fix
                4.41 to 4.47 us/message
        with write_cond fix
                4.65 to 4.76 us/message
```
2013-06-15 04:07:03 -07:00
bors
da42e6b7a0 auto merge of #7133 : kballard/rust/terminfo-parm, r=thestinger
Implement conditional support in terminfo, along with a few other related operators.

Fix implementation of non-commutative arithmetic operators.

Remove all known cases of task failure from `terminfo::parm::expand`, and change the method signature.

Fix some other miscellaneous issues.
2013-06-15 03:07:05 -07:00
Philipp Brueschweiler
c7013ba1fc std::dynamic_lib: start fixing windows implementation
The code compiles and runs under windows now, but I couldn't look up any
symbol from the current executable (dlopen(NULL)), and calling looked
up external function handles doesn't seem to work correctly under windows.
2013-06-15 10:10:49 +02:00
bors
83d44f87e5 auto merge of #7125 : alexcrichton/rust/rusti-issues, r=brson
This un-reverts the reverts of the rusti commits made awhile back. These were reverted for an LLVM failure in rustpkg. I believe that this is not a problem with these commits, but rather that rustc is being used in parallel for rustpkg tests (in-process). This is not working yet (almost! see #7011), so I serialized all the tests to run one after another.

@brson, I'm mainly just guessing as to the cause of the LLVM failures in rustpkg tests. I'm confident that running tests in parallel is more likely to be the problem than those commits I made.

Additionally, this fixes two recently reported issues with rusti.
2013-06-15 01:04:05 -07:00
Steven Stewart-Gallus
5de67f9cc9 Cleaned up driver.rs 2013-06-15 00:43:19 -07:00
bors
7d1065e913 auto merge of #7122 : thestinger/rust/std, r=luqmana 2013-06-14 23:37:08 -07:00
Tim Chevalier
e3c4104d74 rustpkg: Write more automated tests
Automate more tests described in the commands.txt file,
and add infrastructure for running them. Right now, tests shell
out to call rustpkg. This is not ideal.
2013-06-14 22:46:01 -07:00
Tim Chevalier
1adbb4520b rustc: Don't continue to resolve if there's an error in lang_items
This confused me when it happened.
2013-06-14 22:45:43 -07:00
bors
c83bceddbb auto merge of #7121 : huonw/rust/rand-call, r=pnkfelix
r? @pnkfelix
2013-06-14 22:37:13 -07:00
bors
1ba6fa4777 auto merge of #7110 : thestinger/rust/iterator, r=brson 2013-06-14 21:37:27 -07:00
Huon Wilson
18542568a8 std: rename .connect/.concat in VectorVector to avoid conflicting with StrVector.
This is caused by StrVector having a generic implementation for &[S]
and so #5898 means that method resolution of ~[~[1]].concat() sees that
both StrVector and VectorVector have methods that (superficially) match.

They are now connect_vec and concat_vec, which means that they can actually be
called.
2013-06-15 14:15:56 +10:00
bors
1104e659d5 auto merge of #7144 : dotdash/rust/caches, r=graydon
The lookups for these items in external crates currently cause repeated
decoding of the EBML metadata, which is pretty slow. Adding caches to
avoid the repeated decoding reduces the time required for the type
checking of librustc by about 25%.
2013-06-14 20:28:09 -07:00
Daniel Micay
824a6277af rm CopyableNonstrictIter
copies can just be done explicitly: `xs.transform(|x|x.clone())`
2013-06-14 23:15:42 -04:00
Daniel Micay
d68be89e69 rm MutableIter
replaced with mutable implementations of Iterator
2013-06-14 23:15:42 -04:00
Daniel Micay
8111701604 rm ExtendedMutableIter
replaced with `xs.mut_iter().enumerate()`
2013-06-14 23:15:42 -04:00
Daniel Micay
585f5f7f79 add IteratorUtil to the prelude 2013-06-14 23:15:42 -04:00
Björn Steinbrink
a710e61903 Add caches for method and impl metadata
The lookups for these items in external crates currently cause repeated
decoding of the EBML metadata, which is pretty slow. Adding caches to
avoid the repeated decoding reduces the time required for the type
checking of librustc by about 25%.
2013-06-15 04:28:19 +02:00
bors
104e6120b1 auto merge of #7116 : thestinger/rust/whitespace, r=luqmana 2013-06-14 19:25:05 -07:00
Alex Crichton
893c70d7bc Add Zero impls for lots of common types 2013-06-14 19:12:37 -07:00
Alex Crichton
07f5ab1009 Implement a deriving(Zero) attribute 2013-06-14 19:12:37 -07:00
Erick Tryzelaar
ac83f4b732 std: add a fixme to note performance issues in vec::from_elem. 2013-06-14 16:58:55 -07:00
Brian Anderson
38e05747b5 xfail run-pass/auto-encode.rs 2013-06-14 16:50:53 -07:00
Kevin Ballard
da4e614742 Fix line lengths in terminfo 2013-06-14 13:03:42 -07:00
Kevin Ballard
f31767df66 Implement terminfo param conditionals
Implement the %?, %t, %e, and %; operators. Also implement the %<, %=,
%> operators, without which conditionals aren't very useful.

Fix the order of parameters for the arithmetic operators.

Implement the missing %^ operator.
2013-06-14 12:37:54 -07:00
Kevin Ballard
6423548818 Fix a bunch of failure cases in terminfo
Replace all potentially-failing operations with Err returns and add
tests.

Remove the Char parameter type; characters are represented as Numbers.

Fix integer constants to work properly when there are multiple constants
in the same capability string.

Tweak loop to use iterators instead of indexing into cap.
2013-06-14 12:37:54 -07:00
Kevin Ballard
e990239a3a Don't require &mut [Param] with terminfo::parm::expand() 2013-06-14 12:37:53 -07:00
Kevin Ballard
c9e234a1ae Tweak terminfo::parm::expand function signature
Take a new struct Variables instead of two &mut [] vectors for static
and dynamic variables.
2013-06-14 12:37:53 -07:00
Kevin Ballard
9f9e505405 Tweak new terminfo logical operator support 2013-06-14 12:37:53 -07:00
Corey Richardson
821a962feb Various terminfo parameterization changes 2013-06-14 12:37:53 -07:00
Huon Wilson
d361802540 rustdoc: add syntax highlighting to item signatures.
This means that type definitions and function signatures have
pretty colours.

It uses the following template:

~~~ {.rust}
<code>
~~~
2013-06-15 02:19:19 +10:00
Erick Tryzelaar
f7e1daa8e3 std: get std::path tests to work again 2013-06-14 07:13:32 -07:00
Felix S. Klock II
876f6deb4a fixed code to placate new restrictions on form of function/method invocations. 2013-06-14 09:36:03 +02:00
Alex Crichton
9c3b1cbc19 Resolve LLVM crashing in rustpkg tests 2013-06-13 22:53:30 -07:00
Alex Crichton
dc18321ef5 Don't run passes again on JIT code
These passes are already run beforehand, no need to do them twice.
2013-06-13 22:53:10 -07:00
Alex Crichton
079ffa362f Correctly parse commands for rusti
Closes #7120
2013-06-13 21:48:16 -07:00
Alex Crichton
a90fffe367 Revert "Revert "Have JIT execution take ownership of the LLVMContextRef""
This reverts commit 19adece68b.
2013-06-13 21:25:18 -07:00
Alex Crichton
1a3edecbf2 Revert "Revert "Remove all usage of the global LLVMContextRef""
This reverts commit 541c657a73.
2013-06-13 21:25:12 -07:00
Brian Anderson
7755018074 Revert "std: convert {vec,str}::to_owned to methods."
This fixes the strange random crashes in compile-fail tests.

This reverts commit 96cd61ad03.

Conflicts:
	src/librustc/driver/driver.rs
	src/libstd/str.rs
	src/libsyntax/ext/quote.rs
2013-06-13 19:06:47 -07:00
Daniel Micay
2b13606d9f update the libstd docstring for the rename 2013-06-13 21:41:11 -04:00
Huon Wilson
8431e609ea xfail test on windows, because extern mod doesn't work there 2013-06-14 11:12:06 +10:00
Huon Wilson
e6c3e4a000 syntax: revert the uint -> u32 "fix"; make the names/comment match. 2013-06-14 11:12:06 +10:00
Huon Wilson
f93a974558 syntax: correct the Rand::rand call to select enum variants in #[deriving(Rand)].
Previously, this was not a global call, and so when `#[deriving(Rand)]`
was in any module other than the top-level one, it failed (unless there
was a `use std;` in scope).

Also, fix a minor inconsistency between uints and u32s for this piece
of code.
2013-06-14 11:12:06 +10:00
Daniel Micay
ec27644870 automated whitespace fixes 2013-06-13 18:03:08 -04:00
Felix S. Klock II
b03a0b27aa make pp file conform to actual output, noting some oddities along the way. 2013-06-13 23:40:24 +02:00
Felix S. Klock II
0f4d5c2134 checkpoint block-comment-wchar state. 2013-06-13 23:40:24 +02:00
Felix S. Klock II
1deebeef7d Fix #3961 : use char range methods instead of byte offsets to detect whitespace. 2013-06-13 23:40:24 +02:00
Brian Anderson
541c657a73 Revert "Remove all usage of the global LLVMContextRef"
This reverts commit 779191cd4b.

Conflicts:
	src/librustc/middle/trans/base.rs
	src/librustc/middle/trans/common.rs
2013-06-13 13:08:57 -07:00
Brian Anderson
19adece68b Revert "Have JIT execution take ownership of the LLVMContextRef"
This reverts commit 5c5095d25e.

Conflicts:
	src/librusti/rusti.rc
2013-06-13 13:08:57 -07:00
Ben Blum
2ef8774ac5 Improve comments in sync and arc a bit more. 2013-06-13 15:20:38 -04:00
bors
5bff471dde auto merge of #7105 : sstewartgallus/rust/removed_unused_imports, r=sanxiyn
I was able to remove unused imports, and fix the following warnings

src/libstd/hashmap.rs:23:15: 23:23 warning: unused import [-W unused-imports (default)]
src/libstd/task/spawn.rs:95:15: 95:23 warning: unused import [-W unused-imports (default)]
src/libstd/rt/uv/mod.rs:42:0: 42:9 warning: unused import [-W unused-imports (default)]
src/libstd/rt/uv/mod.rs:45:0: 45:9 warning: unused import [-W unused-imports (default)]
src/librustc/middle/trans/meth.rs:26:0: 26:26 warning: unused import [-W unused-imports (default)]
src/librustc/back/link.rs:210:20: 210:25 warning: unused import [-W unused-imports (default)]

I was unable to fix the following unused import warnings. The code
here was weird.

src/libextra/std.rc:40:11: 40:14 warning: unused import [-W unused-imports (default)]
src/libextra/std.rc:40:16: 40:24 warning: unused import [-W unused-imports (default)]
2013-06-13 12:08:05 -07:00
Ben Blum
57cb44dbeb Change sync::RWlock implementation to use atomic uint instead of exclusive, for performance. Close #7066. 2013-06-13 14:45:14 -04:00
Ben Blum
68e8fe9b6e Add a test case for #7065. 2013-06-13 14:41:22 -04:00
Ben Blum
bd019c4c26 Thread order_lock through rwlock condvars for reacquiring access_lock. Fixes #7065. 2013-06-13 14:41:20 -04:00
Steven Stewart-Gallus
d9d50a5bd4 Remove unused imports
I was able to remove unused imports, and fix the following warnings

src/libstd/hashmap.rs:23:15: 23:23 warning: unused import [-W unused-imports (default)]
src/libstd/task/spawn.rs:95:15: 95:23 warning: unused import [-W unused-imports (default)]
src/libstd/rt/uv/mod.rs:42:0: 42:9 warning: unused import [-W unused-imports (default)]
src/libstd/rt/uv/mod.rs:45:0: 45:9 warning: unused import [-W unused-imports (default)]
src/librustc/middle/trans/meth.rs:26:0: 26:26 warning: unused import [-W unused-imports (default)]
src/librustc/back/link.rs:210:20: 210:25 warning: unused import [-W unused-imports (default)]

I was unable to fix the following unused import warnings. The code
here was weird.

src/libextra/std.rc:40:11: 40:14 warning: unused import [-W unused-imports (default)]
src/libextra/std.rc:40:16: 40:24 warning: unused import [-W unused-imports (default)]
2013-06-13 10:46:17 -07:00
bors
a198aad8f3 auto merge of #7100 : thestinger/rust/hashmap, r=pnkfelix
Not much point in leaving these around. They just get in the way when you actually want to log something else.
2013-06-13 03:25:11 -07:00
Daniel Micay
ed7892ac00 hashmap: remove leftover debug!() logging 2013-06-13 03:25:28 -04:00
bors
e6503995ab auto merge of #7096 : huonw/rust/invalid-null-str, r=thestinger
A slice of a 'static str is still 'static, but doesn't necessarily
have the null terminator.
2013-06-12 23:10:15 -07:00
bors
4ec08d8e12 auto merge of #7070 : alexcrichton/rust/rusti++, r=graydon
More descriptive comments can be found throughout the code, but the bulk of this is that it addresses a vast number of issues with the old rusti model.

Closes #6772, #5675, #5469, and #6617
2013-06-12 21:22:11 -07:00
Huon Wilson
abadece3ba std: remove the invalid NullTerminatedStr instance for &'static str.
A slice of a 'static str is still 'static, but doesn't necessarily
have the null terminator.
2013-06-13 14:12:08 +10:00
Alex Crichton
0c47632898 Rewrite rusti 2013-06-12 21:03:17 -07:00
bors
996301331e auto merge of #7079 : thestinger/rust/jemalloc, r=graydon
Minor release, the ChangeLog is included in the update.
2013-06-12 20:25:17 -07:00
bors
6c45160f19 auto merge of #7027 : sstewartgallus/rust/dynamic_lib, r=graydon
I would appreciate if someone could help out with the Windows code on this pull request. I tried to test it using WINE but I couldn't figure out a way to set that up.
2013-06-12 19:07:30 -07:00
Ben Blum
0ca2056e46 Document unstable::atomics fetch_* return values 2013-06-12 20:53:40 -04:00
Ben Blum
d809f54a7c remove bitrotted cant_nest field from RWARC (the #[mutable] tag suffices) 2013-06-12 20:53:40 -04:00
Ben Blum
6b22c090a5 make util::NonCopyable a unit struct instead of a struct with a unit 2013-06-12 20:53:40 -04:00
Huon Wilson
5ebffd46d5 rustc: fix test failures after rebase. 2013-06-13 10:47:33 +10:00
Steven Stewart-Gallus
786ea3ffe6 Prototyped a dynamic library facility interface 2013-06-12 17:32:13 -07:00
Huon Wilson
a30ee0dee1 rustdoc: fix tests for @~str -> @str change. 2013-06-13 10:20:52 +10:00
Huon Wilson
096f6f56a8 Use @str instead of @~str in libsyntax and librustc. Fixes #5048.
This almost removes the StringRef wrapper, since all strings are
Equiv-alent now. Removes a lot of `/* bad */ copy *`'s, and converts
several things to be &'static str (the lint table and the intrinsics
table).

There are many instances of .to_managed(), unfortunately.
2013-06-13 10:20:52 +10:00
Huon Wilson
641910dc13 std: make all strings Equiv-alent to each other, generalise Path.push_many to take any type of string. 2013-06-13 10:19:34 +10:00
bors
84bed9769b auto merge of #7091 : msullivan/rust/default-methods, r=graydon
r? @nikomatsakis
2013-06-12 16:25:34 -07:00
Felix S. Klock II
009a2fdc5e Fix a test-predicated use of the visit.rs api. 2013-06-12 23:31:07 +02:00
Felix S. Klock II
58b4fe6fea Merge branch 'moz-incoming' into fsk-visitor-refactoring 2013-06-12 23:28:38 +02:00
Michael Sullivan
36e3d64c3e Fix a lot of the handling of default methods and type parameters. Closes #4099, #4102. 2013-06-12 13:50:45 -07:00
Michael Sullivan
5835158170 Drop some dead method handling code. 2013-06-12 13:50:45 -07:00
Michael Sullivan
a159f856d5 Properly translate calls to default methods in a number of cases. Closes #4350. 2013-06-12 13:50:15 -07:00
bors
78cddc83a4 auto merge of #7073 : influenza/rust/iterator-doc-fixes, r=catamorphism
This commit fixes two typos and an incorrect description.
2013-06-12 12:13:53 -07:00
Felix S. Klock II
91bced8ae8 Fix linebreak and whitespace issues to placate make tidy. 2013-06-12 19:16:30 +02:00
Felix S. Klock II
ecef9ad75a Visitor refactoring: Step 1, couple (Env, vt<Env>) together in a tuple. 2013-06-12 13:04:37 +02:00
Luqman Aden
aa9a992f3e libsyntax: Remove duplicate methods. 2013-06-12 02:46:38 -04:00
Luqman Aden
47772bcb73 Add tests for duplicate methods on traits/impls. 2013-06-12 02:46:38 -04:00
Luqman Aden
c6f3103006 librustc: Don't allow duplicate methods on impls. 2013-06-12 02:46:38 -04:00
Luqman Aden
8fc14b6e62 librustc: Don't allow duplicate methods on a trait. 2013-06-12 02:46:38 -04:00
bors
4a52ff0786 auto merge of #7072 : thestinger/rust/ptr, r=catamorphism
I don't think this will even show up in the documentation right now.... but it should still be correct :).
2013-06-11 22:31:39 -07:00
bors
cc80652e4a auto merge of #7060 : huonw/rust/more-str, r=thestinger
There are now only half-a-dozen or so functions left `std::str` that should be methods.

Highlights:
- `.substr` was removed, since most of the uses of it in the code base were actually incorrect (it had a weird mixing of a byte index and a unicode character count), adding `.slice_chars` if one wants to handle characters, and the normal `.slice` method to handle bytes.
- Code duplication between the two impls for `connect` and `concat` was removed via a new `Str` trait, that is purely designed to allow an explicit -> `&str` conversion (`.as_slice()`)
- Deconfuse the 5 different functions for converting to `[u8]` (3 of which had actually incorrect documentation: implying that they didn't have the null terminator), into 3: `as_bytes` (all strings), `as_bytes_with_null` (`&'static str`, `@str` and `~str`) and `as_bytes_with_null_consume` (`~str`). None of these allocate, unlike the old versions.

(cc @thestinger)
2013-06-11 21:37:43 -07:00
Daniel Micay
0685c657f0 update jemalloc to 3.4.0 2013-06-12 00:26:15 -04:00
bors
7033dfcf91 auto merge of #7069 : dotdash/rust/cast_combine, r=graydon
Shaves off a percent or so from the LLVM passes for librustc.
2013-06-11 20:43:39 -07:00
Huon Wilson
9f0c85acc9 std: fix windows 2013-06-12 13:42:41 +10:00
Huon Wilson
13460de61c std: fix method renaming. 2013-06-12 13:09:02 +10:00
bors
8761b1fb16 auto merge of #7067 : brson/rust/notasktrans, r=graydon 2013-06-11 19:37:39 -07:00
Huon Wilson
eecbe5556b Silence some warnings. 2013-06-12 12:21:05 +10:00
Huon Wilson
26d7b460a3 std: generalise .trim_chars to use CharEq. 2013-06-12 12:21:05 +10:00
Huon Wilson
073e82fff2 std: create Str trait for DRY. Use it on StrVector.
The Str trait collects the various strings types and provides a method
for coercing to a slice, so that functions and impls can be written for
generic types containing strings (e.g. &[~str], &[&str], ...) without
having to write one for each string type (assuming that the impl only
needs a slice).
2013-06-12 12:21:04 +10:00
Huon Wilson
3a1e13c7a0 std: convert str::escape_* to methods. 2013-06-12 12:21:04 +10:00
Huon Wilson
9e60e2e297 std: convert str::replace to a method. 2013-06-12 12:21:04 +10:00
Huon Wilson
12750c8893 std: methodise str::capacity 2013-06-12 12:21:04 +10:00
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
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
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
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
Huon Wilson
248b6e38b5 std: replace str::substr with the method. 2013-06-11 00:52:47 +10:00
Huon Wilson
ebefe425b9 std: remove str::to_chars 2013-06-11 00:49:19 +10:00
Huon Wilson
8c59d920a1 std: basic documentation for the new str methods 2013-06-11 00:08:57 +10:00
Huon Wilson
ccd0ac59e9 std: remove str::{connect,concat}*. 2013-06-10 23:57:03 +10:00
Huon Wilson
5a711ea7c3 clean-up unused import warnings 2013-06-10 23:15:01 +10:00
Huon Wilson
ead4468249 std: fix tests 2013-06-10 23:02:55 +10:00
Huon Wilson
ec5a028ada std: convert str::char_at* to methods. 2013-06-10 23:02:55 +10:00
Huon Wilson
f632f46614 std: convert str::trim* to methods. 2013-06-10 23:02:55 +10:00
Huon Wilson
1553874149 std: convert str::reserve* to methods, and methodise str::push_*. 2013-06-10 23:02:55 +10:00
Huon Wilson
a64e886e3c std: remove str::contains in favour of the method 2013-06-10 23:02:55 +10:00
Huon Wilson
017450a611 std: replace str::find_str* with a method 2013-06-10 23:02:54 +10:00
Huon Wilson
7281fb948a std: replace str::{any,all}_between with the iterator equivalent. 2013-06-10 23:02:54 +10:00
Huon Wilson
0cfc08d81e std: convert character-based str::find_* to methods. Add .slice_{to,from} methods. 2013-06-10 23:02:54 +10:00
Huon Wilson
76fc9be5a1 std: convert each_split_str to an iterator 2013-06-10 23:02:54 +10:00
Huon Wilson
ee41ad4168 std: fix compile & test 2013-06-10 23:02:54 +10:00
Huon Wilson
c32fb53cf9 std: remove str::{len, slice, is_empty} in favour of methods. 2013-06-10 23:02:54 +10:00
Huon Wilson
b29cd22bce std: replace str::all/any fns and methods with iterators 2013-06-10 23:02:54 +10:00
Huon Wilson
1e8982bdb2 std: replace str::each_split* with an iterator 2013-06-10 23:02:54 +10:00
James Miller
e9c309c0e5 STATIC_PAGE_SHIFT for cross-compiling jemalloc
Sets `STATIC_PAGE_SHIFT` for cross-compiling jemalloc to 12. A
shift of 12 represents a page size of 4k for practically all
platforms.
2013-06-10 18:26:24 +12:00
bors
8f4f0bebe7 auto merge of #7038 : alexcrichton/rust/issue-6935, r=catamorphism
Tracks the `type_target` and `value_target` source imports separately to correctly warn about unused imports.
2013-06-09 21:49:23 -07:00
Alex Crichton
b6cccb3d81 Track the source of the type_target and value_target separately for ImportResolutions 2013-06-09 21:42:57 -07:00
bors
6e5e97fc78 auto merge of #7028 : thestinger/rust/cmp, r=brson 2013-06-09 20:13:23 -07:00
Daniel Micay
86833ea286 cmp: remove duplicate free functions 2013-06-09 20:47:40 -04:00
Ron Dahlgren
9e4beaac9d Fix all issues with sample code
The getopts sample program now compiles and runs. Additionally I made
all of the indentation uniformly four spaces.
2013-06-09 16:13:52 -07:00
Ron Dahlgren
983269e71a Updated documentation to refer to extra module
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-09 15:45:55 -07:00