Commit Graph

26862 Commits

Author SHA1 Message Date
Alex Crichton
bbdaf01a5a travis: Use LLVM 3.3 from the official repos
We can be certain that this version of LLVM will not be changing, so we don't
have to worry about API drift over time.
2014-02-26 15:22:50 -08:00
Alex Crichton
1ac5e84e91 rustc: Get rustc compiling with LLVM 3.{3,4} again
The travis builds have been breaking recently because LLVM 3.5 upstream is
changing. This looks like it's likely to continue, so it would be more useful
for us if we could lock ourselves to a system LLVM version that is not changing.

This commit has the support to bring our C++ glue to LLVM back in line with what
was possible back in LLVM 3.{3,4}. I don't think we're going to be able to
reasonably protect against regressions in the future, but this kind of code is a
good sign that we can continue to use the system LLVM for simple-ish things.
Codegen for ARM won't work and it won't have some of the perf improvements we
have, but using the system LLVM should work well enough for development.
2014-02-26 15:01:15 -08:00
bors
b4d923852e auto merge of #12572 : lifthrasiir/rust/owned-ptr-static-bound, r=alexcrichton
This is inspired by the [question](http://www.reddit.com/r/rust/comments/1yy57k/unsolved_question_from_irc/) (re-)posted to /r/rust. The error message in this question correctly states that one should add `'static` to the trait bounds, but does not state which trait bounds. This PR makes that explicit by appending two words.

This also renames `check_durable` to `check_static` and removes the outdated comment as a cleanup.
2014-02-26 12:16:43 -08:00
bors
5737d1f704 auto merge of #12490 : zslayton/rust/doc-fix-12386, r=alexcrichton
Attn: @huonw 

Addresses #12386.
2014-02-26 10:46:36 -08:00
Kang Seonghoon
9083cb24b2 rustc: Explicitly mention type params with missing 'static bounds
Also renames `check_durable` to `check_static` and removes the outdated
comment.
2014-02-27 02:14:46 +09:00
bors
86177dbbcf auto merge of #12570 : kyrias/rust/master, r=cmr
Adds a missing tilde to the end and the start of two .notrust blocks.
2014-02-26 08:36:36 -08:00
bors
05a2d32acd auto merge of #12571 : eddyb/rust/kill-callee-id, r=nikomatsakis
Every method call and overloaded operator had a `callee_id` that was be used to store the method type and type substitutions, that information is now stored in the `method_map`, alongside the method's origin.
2014-02-26 07:16:39 -08:00
Eduard Burtescu
05e4d944a9 Replace callee_id with information stored in method_map. 2014-02-26 16:06:45 +02:00
Eduard Burtescu
7a588ceff2 Rename a few typeck method-related structures to UpperCamelCase. 2014-02-26 16:01:36 +02:00
Johannes Löthberg
3d3dae8fa5 tutorial: Missing tildes around .notrust block
Adds a missing tilde to the end and the start of two .notrust blocks.
2014-02-26 14:48:40 +01:00
Florian Hahn
5d825def29 Mark top level module as a crate in rustdoc, closes #12507 2014-02-26 14:00:00 +01:00
bors
6c41f993d3 auto merge of #12547 : jagtalon/rust/jag/rust/tutorial-freezing, r=pnkfelix
- "Lending an immutable pointer" might be confusing. It was not discussed why borrowed pointers are immutable in the first place.
- Make it clear that the borrowed pointers are immutable even if the variable was declared with `mut`.
- Make it clear that we cannot even assign anything to the variable while its value is being borrowed.

tutorial: change "--" to an em-dash.

tutorial: change instances of "--" to em-dash.
2014-02-25 23:31:35 -08:00
bors
eb86913dcf auto merge of #12505 : alexcrichton/rust/fix-stack-overflow, r=brson
The printing of the error message on stack overflow had two sometimes false
assumptions previously. The first is that a local task was always available (it
called Local::take) and the second is that it used `println!` instead of
manually writing.

The first assumption isn't necessarily true because while stack overflow will
likely only be detected in situations that a local task is available, it's not
guaranteed to always be in TLS. For example, during a `println!` call a task
may be blocking, causing it to be unavailable. By using Local::try_take(), we
can be resilient against these occurrences.

The second assumption could lead to odd behavior because the stdout logger can
be overwritten to run arbitrary code. Currently this should be possible, but the
utility is much diminished because a stack overflow translates to an abort()
instead of a failure.
2014-02-25 19:21:32 -08:00
bors
2e1cfae943 auto merge of #12548 : alexcrichton/rust/up-llvm, r=huonw,brson
Upstream LLVM has changed slightly such that our PassWrapper.cpp no longer
comiles (travis errors). This updates the bundled LLVM to the latest nightly
which will hopefully fix the travis errors we're seeing.
2014-02-25 17:41:32 -08:00
Alex Crichton
4f4d43bf6c std: Tweak stack overflow printing for robustness
The printing of the error message on stack overflow had two sometimes false
assumptions previously. The first is that a local task was always available (it
called Local::take) and the second is that it used println! instead of
manually writing.

The first assumption isn't necessarily true because while stack overflow will
likely only be detected in situations that a local task is available, it's not
guaranteed to always be in TLS. For example, during a println! call a task
may be blocking, causing it to be unavailable. By using Local::try_take(), we
can be resilient against these occurrences.

The second assumption could lead to odd behavior because the stdout logger can
be overwritten to run arbitrary code. Currently this should be possible, but the
utility is much diminished because a stack overflow translates to an abort()
instead of a failure.
2014-02-25 16:51:52 -08:00
bors
3b09469a62 auto merge of #12539 : gmjosack/rust/master, r=alexcrichton
std::condition was removed in 454882dcb7
but there are still links to the guide. Removing them.
2014-02-25 16:26:30 -08:00
bors
c24946e9c6 auto merge of #12493 : eddyb/rust/saner-overloads, r=nikomatsakis
Fixes #12402.
2014-02-25 13:01:42 -08:00
bors
fc1c06d7b1 auto merge of #12457 : alexcrichton/rust/fix-some-tests, r=brson
This updates a number of ignore-test tests, and removes a few completely
outdated tests due to the feature being tested no longer being supported.

This brings a number of bench/shootout tests up to date so they're compiling
again. I make no claims to the performance of these benchmarks, it's just nice
to not have bitrotted code.

Closes #2604
Closes #9407
2014-02-25 11:41:36 -08:00
bors
fd83b2be26 auto merge of #12408 : alexcrichton/rust/manual-crate-map, r=brson
Apparently weak linkage and dlopen aren't quite working out for applications
like servo on android. There appears to be a bug or two in how android loads
dynamic libraries and for some reason libservo.so isn't being found.

As a temporary solution, add an extern "C" function to libstd which can be
called if you have a handle to the crate map manually. When crawling the crate
map, we then check this manual symbol before falling back to the old solutions.

cc #11731
2014-02-25 10:26:37 -08:00
Alex Crichton
294b27d806 Update LLVM
Upstream LLVM has changed slightly such that our PassWrapper.cpp no longer
comiles (travis errors). This updates the bundled LLVM to the latest nightly
which will hopefully fix the travis errors we're seeing.
2014-02-25 09:37:30 -08:00
Jag Talon
82747ed93e tutorial: clearer explanation of freezing.
- "Lending an immutable pointer" might be confusing. It was not discussed why borrowed pointers are immutable in the first place.
- Make it clear that the borrowed pointers are immutable even if the variable was declared with `mut`.
- Make it clear that we cannot even assign anything to the variable while its value is being borrowed.

tutorial: change "--" to an em-dash.

tutorial: change instances of "--" to em-dash.
2014-02-25 12:32:09 -05:00
Alex Crichton
1b3b273f80 Add a method of manually specifying the crate map
Apparently weak linkage and dlopen aren't quite working out for applications
like servo on android. There appears to be a bug or two in how android loads
dynamic libraries and for some reason libservo.so isn't being found.

As a temporary solution, add an extern "C" function to libstd which can be
called if you have a handle to the crate map manually. When crawling the crate
map, we then check this manual symbol before falling back to the old solutions.

cc #11731
2014-02-25 09:22:24 -08:00
Alex Crichton
9cc26cfdf4 test: Clean out the test suite a bit
This updates a number of ignore-test tests, and removes a few completely
outdated tests due to the feature being tested no longer being supported.

This brings a number of bench/shootout tests up to date so they're compiling
again. I make no claims to the performance of these benchmarks, it's just nice
to not have bitrotted code.

Closes #2604
Closes #9407
2014-02-25 09:21:09 -08:00
bors
3276090253 auto merge of #12537 : kballard/rust/add-test-to-doc-index, r=alexcrichton 2014-02-25 09:11:39 -08:00
Eduard Burtescu
39504719b4 resolve: Don't use @RefCell in trait_map, nothing modifies its entries. 2014-02-25 19:08:55 +02:00
Eduard Burtescu
9d5532618f resolve: Remove all the operator overloads from trait_map. 2014-02-25 19:08:55 +02:00
Eduard Burtescu
d096eefd80 Use only the appropriate trait when looking up operator overloads. 2014-02-25 19:08:54 +02:00
Eduard Burtescu
818203e9d2 typeck: Remove old diagnostic that refers to do. 2014-02-25 19:08:54 +02:00
bors
34a224f4a1 auto merge of #12530 : alexcrichton/rust/make-check-no-rpath, r=brson
This involves passing through LD_LIBRARY_PATH through more places, specifically
in the compiletest, run-make, and doctest runners.
2014-02-25 07:56:35 -08:00
bors
25d68366b7 auto merge of #12522 : erickt/rust/hash, r=alexcrichton
This patch series does a couple things:

* replaces manual `Hash` implementations with `#[deriving(Hash)]`
* adds `Hash` back to `std::prelude`
* minor cleanup of whitespace and variable names.
2014-02-25 06:41:36 -08:00
bors
d222f03f42 auto merge of #12525 : eddyb/rust/gate-default-type-param-usage, r=alexcrichton
Also reverted `#[deriving(Hash)]` to implement `Hash` only for `SipState`, until we decide what to do about default type params.
2014-02-25 05:26:36 -08:00
bors
27cc309a7f auto merge of #12473 : bjz/rust/remove-bool, r=alexcrichton
These were never used outside of the tests.
2014-02-25 02:16:39 -08:00
Gary M. Josack
7e85431775 Remove references to guide-conditions
std::condition was removed in 454882dcb7
but there are still links to the guide. Removing them.
2014-02-25 01:01:55 -08:00
Brendan Zabarauskas
6efa3c63d0 Remove std::bool::{Bool, all_values}
These were never used outside of the tests
2014-02-25 19:52:51 +11:00
Kevin Ballard
2003a5eb34 Add link to libtest in doc index 2014-02-24 23:11:23 -08:00
bors
4243cad56b auto merge of #12535 : alexcrichton/rust/rollup, r=alexcrichton
Closes #12474 (rustc: Don't error on the rlib symlinks) r=brson
Closes #12475 (Use lines_any() when parsing output form "ar") r=brson
Closes #12476 (Remove some obsolete ignored tests) r=alexcrichton
Closes #12481 (Make .swap_remove return Option<T>) r=brson
Closes #12485 (Remove some non-essential trait re-exports from the prelude.) r=brson
Closes #12489 (Handle multibyte characters in source files better) r=alexcrichton
Closes #12494 (Mark by-value parameters that are passed on the stack as nocapture) r=nmatsakis
Closes #12497 (syntax: allow stmt/expr macro invocations to be delimited by {}) r=alexcrichton
Closes #12508 (Match binding is assignment) r=nmatsakis
Closes #12513 (Run the travis build as one large command) r=huonw
Closes #12515 (Update source code layout in src/) r=alexcrichton
Closes #12521 (Tutorial: Add std::num::sqrt to the example) r=cmr
Closes #12529 (test: single-variant enum can't be dereferenced) r=huonw
2014-02-24 22:17:02 -08:00
Alex Crichton
7d85546721 Test fixes from rollup 2014-02-24 22:11:43 -08:00
Flavio Percoco
35f2da4063 test: single-variant enum can't be dereferenced
Closes #9814
2014-02-24 21:22:27 -08:00
Jag Talon
7fc7c37763 Tutorial: Add std::num::sqrt to the example.
We should be using the package std::num::sqrt instead of the sqrt function that was defined to return 0.0
2014-02-24 21:22:27 -08:00
George Papanikolaou
54abbda9b4 Update source code layout in src/
with the new modules that moved from extra,
and with other undocumented folders.
also add a note about potential changes.
2014-02-24 21:22:27 -08:00
Alex Crichton
a7b1d65080 Run the travis build as one large command
It appears that travis doesn't stop running script commands after the first one
fails (see https://github.com/travis-ci/travis-ci/issues/1066), so chain all our
commands together with && for now.
2014-02-24 21:22:27 -08:00
Edward Wang
4690ab0ea8 Match binding is assignment
In its first pass, namely gather_loans, the borrow checker tracks the
initialization sites among other things it does. It does so for let
bindings with initializers but not for bindings in match arms, which are
effectively also assignments. This patch does that for borrow checker.

Closes #12452.
2014-02-24 21:22:27 -08:00
Huon Wilson
6757053cff syntax: allow stmt/expr macro invocations to be delimited by {}.
This makes using control-flow-y macros like `spawn! { ... }` more fluent
and natural.

cc #11892.
2014-02-24 21:22:27 -08:00
Björn Steinbrink
0309104cc5 Mark by-value parameters that are passed on the stack as nocapture
The by-value argument is a copy that is only valid for the duration of
the function call, therefore keeping any pointer to it that outlives the
call is illegal.
2014-02-24 21:22:26 -08:00
Huon Wilson
8812e8ad49 syntax: calculate positions of multibyte characters more correctly.
They are still are not completely correct, since it does not handle
graphemes at all, just codepoints, but at least it handles the common
case correctly.

The calculation was previously very wrong (rather than just a little bit
wrong): it wasn't accounting for the fact that every character is 1
byte, and so multibyte characters were pretending to be zero width.

cc #8706
2014-02-24 21:22:26 -08:00
Huon Wilson
ff79a4471c syntax: record multibyte chars' positions absolutely, not relative to
file.

Previously multibyte UTF-8 chars were being recorded as byte offsets
from the start of the file, and then later compared against global byte
positions, resulting in the compiler possibly thinking it had a byte
position pointing inside a multibyte character, if there were multibyte
characters in any non-crate files. (Although, sometimes the byte offsets
line up just right to not ICE, but that was a coincidence.)

Fixes #11136.
Fixes #11178.
2014-02-24 21:22:26 -08:00
Brendan Zabarauskas
dad52cfcb5 Remove std::num::ToStrRadix from the prelude 2014-02-24 21:22:26 -08:00
Brendan Zabarauskas
84a8893f19 Remove std::from_str::FromStr from the prelude 2014-02-24 21:22:26 -08:00
Brendan Zabarauskas
3cc95314c3 Remove std::default::Default from the prelude 2014-02-24 21:22:26 -08:00
Huon Wilson
ac64db94bf std: Add Vec.reserve for rounding-up reservation.
`.reserve_exact` can cause pathological O(n^2) behaviour, so providing a
`.reserve` that ensures that capacity doubles (if you step 1, 2, ..., n)
is more efficient.

cc #11949
2014-02-24 21:22:26 -08:00