Commit graph

33440 commits

Author SHA1 Message Date
Alex Crichton
54647bd317 rollup merge of #18320 : chastell/guide_simplify_formatting 2014-10-27 15:12:29 -07:00
Alex Crichton
9dc9eccf3d rollup merge of #18316 : thestinger/raw 2014-10-27 15:12:29 -07:00
Alex Crichton
abfc2f3b8d rollup merge of #18315 : arielb1/constexpr-addr 2014-10-27 15:12:29 -07:00
Alex Crichton
0c736c7b1d rollup merge of #18309 : cakebaker/fix_off_by_one 2014-10-27 15:12:29 -07:00
Alex Crichton
ee32c04d60 rollup merge of #18303 : cgaebel/make-vec-match-slice 2014-10-27 12:53:02 -07:00
Alex Crichton
dea37d73ca rollup merge of #18266 : nick29581/vtable2.rs 2014-10-27 12:53:02 -07:00
Alex Crichton
dc5a18c6e0 rollup merge of #18265 : jakub-/mailmap 2014-10-27 12:53:02 -07:00
Alex Crichton
ecdb19cc98 rollup merge of #18257 : globin/master 2014-10-27 12:53:02 -07:00
Alex Crichton
2f8ee08f66 rollup merge of #18256 : SimonSapin/view_item_to_string 2014-10-27 12:53:02 -07:00
Alex Crichton
6f65ad1a44 rollup merge of #18251 : steveklabnik/build_module_guide 2014-10-27 12:53:02 -07:00
Alex Crichton
e9537735c1 rollup merge of #18250 : dotdash/fix_aliasing 2014-10-27 12:53:01 -07:00
Alex Crichton
a6883d4054 rollup merge of #18244 : areski/pr-fix-string-doc 2014-10-27 12:53:01 -07:00
Alex Crichton
bb70ce6804 rollup merge of #18239 : msiemens/fix-ice-rename-failed 2014-10-27 12:53:01 -07:00
Alex Crichton
0c756de6c5 rollup merge of #18235 : nikomatsakis/issue-18209 2014-10-27 12:53:01 -07:00
Alex Crichton
da57aa57d4 rollup merge of #18231 : cakebaker/fix_greater_than_forty_two_closure 2014-10-27 12:53:01 -07:00
Alex Crichton
b3c676ed86 rollup merge of #18229 : bjz/ttdelim 2014-10-27 12:53:01 -07:00
Alex Crichton
83e91fb489 rollup merge of #18221 : jkleint/guide-boxes 2014-10-27 12:53:00 -07:00
bors
e05c3b7799 auto merge of #17978 : arielb1/rust/remaining-garbage, r=nikomatsakis
it seems to be some kind of leftover GC-related detritus
2014-10-27 16:57:46 +00:00
Ariel Ben-Yehuda
19faaf1a9e Remove cat_discr
it seems to be some kind of GC-related mess
2014-10-27 19:06:50 +02:00
bors
e2cd4597da auto merge of #17890 : pnkfelix/rust/fsk-fix-issue-17887, r=alexcrichton
Fixes `config.mk` so that it should not contain multiple inconsistent entries for the same option.

Used aforementioned variants to extract options that have explicit `putvar` calls associated with them in the subsequent code.  When the explicit `putvar` call was conditional on some potentially complex condition, moved the `putvar` call out to the main control flow of the script so that it always runs if necessary.

----

As a driveby fix, captured the error exit when doing the test run of `rustc --version` from `CFG_LOCAL_RUST_ROOT`, and signal explicit configure failure when it did not run successfully.  (If we cannot run `rustc`, we really shouldn't try to keep going.)

----

Fix #17887.
2014-10-27 12:02:42 +00:00
Felix S. Klock II
6f1e627388 config.mk: Added variants of valopt/opt that do not automatically putvar.
Used aforementioned variants to extract options that have explicit
`putvar` calls associated with them in the subsequent code.  When the
explicit `putvar` call was conditional on some potentially complex
condition, moved the `putvar` call out to the main control flow of the
script so that it always runs if necessary.

----

As a driveby fix, captured the error exit when doing the test run of
`rustc --version` from `CFG_LOCAL_RUST_ROOT`, and signal explicit
configure failure when it did not run successfully.  (If we cannot run
`rustc`, we really shouldn't try to keep going.)

----

Finally, in response to review feedback, went through and identified
cases where we had been calling `putvar` manually (and thus my naive
translation used `opt_nosave`/`valopt_nosave`), and then verified
whether a manual `putvar` was necessary (i.e., was each variable in
question manually computed somewhere in the `configure` script).
In cases that did not meet this criteria, I revised the code to use
the `opt`/`valopt` directly and removed the corresponding `putvar`,
cleaning things up a teeny bit.

----

Fix #17887.
2014-10-27 12:17:45 +01:00
bors
a0efafbd85 auto merge of #18348 : michaelwoerister/rust/lldb-test-versioning, r=alexcrichton
Let's try if not running LLDB tests in parallel solves the sporadic deadlocks we've seen since enabling the LLDB test suite. Running the tests in parallel has lead to unstable behaviour in the past (with LLDB versions below 310.x.x). Maybe our new minimum LLDB version isn't quite up to it either.

cc @alexcrichton
2014-10-27 07:52:39 +00:00
bors
a93e9c20f2 auto merge of #18130 : mahkoh/rust/udp, r=alexcrichton
Closes #18111

Note that the non-empty part doesn't matter right now because of #18129.
2014-10-27 03:57:37 +00:00
John Kleint
d257b37608 Guide: motivate Box and Rc pointers with need, uses, benefits, and examples.
Explain that Rust has different pointer types because there is a
tradeoff between flexibility and efficiency. Motivate boxes as
fixed-size containers of variable-sized objects. Clarify that Box and Rc
are pointer types that you deref with * just like references. Stick to
explaining the semantics and avoid implementation details.  Scope isn't
the most accurate framework to think about deallocation (since you
return boxes and otherwise move values out of scopes); it's more "when
the value is done being used," i.e., lifetime. Provide a connection
between Rust's pointer types by locating them on a flexibiltiy /
performance scale. Explain the compiler can't statically analyze
lifetimes with multiple owners; hence the need for (runtime) reference
counting.
2014-10-26 23:41:51 -04:00
Michael Woerister
ca0446d107 debuginfo: Set RUST_TEST_TASKS to 1 again for LLDB tests 2014-10-26 18:09:06 +01:00
bors
f037452447 auto merge of #18143 : mahkoh/rust/reverse_complement, r=alexcrichton
Lots of unsafe code and lots of branches removed. Also multithreaded.

Rust old: 1.208 seconds
Rust new: 0.761 seconds
C: 0.632 seconds
2014-10-26 16:42:33 +00:00
bors
cb943b7d2b auto merge of #18212 : kmcallister/rust/unsafecell, r=thestinger
Fixes #18131.
2014-10-26 06:37:23 +00:00
Brendan Zabarauskas
6598d33bd0 Update parse::test::string_to_tts_1 test 2014-10-26 11:20:32 +11:00
Brendan Zabarauskas
94d6eee335 Add a KleeneOp enum for clarity 2014-10-26 09:53:30 +11:00
Brendan Zabarauskas
34dacb80ce Reduce the size of the TokenTree 2014-10-26 09:53:30 +11:00
Brendan Zabarauskas
dfb4163f83 Use standard capitalisation for TokenTree variants 2014-10-26 09:53:30 +11:00
Brendan Zabarauskas
6a50b4d018 Prevent some vector reallocations 2014-10-26 09:53:30 +11:00
Brendan Zabarauskas
ec3f0201e7 Rename TokenTree variants for clarity
This should be clearer, and fits in better with the `TTNonterminal` variant.

Renames:

- `TTTok` -> `TTToken`
- `TTDelim` -> `TTDelimited`
- `TTSeq` -> `TTSequence`
2014-10-26 09:53:29 +11:00
Brendan Zabarauskas
971d776aa5 Add Span and separate open/close delims to TTDelim
This came up when working [on the gl-rs generator extension](990383de80/src/gl_generator/lib.rs (L135-L146)).

The new definition of  `TTDelim` adds an associated `Span` that covers the whole token tree and enforces the invariant that a delimited sequence of token trees must have an opening and closing delimiter.

A `get_span` method has also been added to `TokenTree` type to make it easier to implement better error messages for syntax extensions.
2014-10-26 09:53:29 +11:00
bors
f168c12c56 auto merge of #18293 : thestinger/rust/heap, r=cmr 2014-10-25 20:57:10 +00:00
Piotr Szotkowski
019a982f51 Guide: drop :d formatting where unnecessary 2014-10-25 22:50:38 +02:00
Daniel Micay
a9e85100cd fix sized deallocation documentation 2014-10-25 14:12:21 -04:00
Daniel Micay
a6426cb43d return the new usable size from reallocate_inplace
The real size is also more useful than just a boolean, and the caller
can easily determine if the operation failed from the real size. In most
cases, the caller is only going to be growing the allocation so a branch
can be avoided.

[breaking-change]
2014-10-25 14:12:21 -04:00
Daniel Micay
2bc4d3ec23 get rid of libc_heap::{malloc_raw, realloc_raw}
The C standard library functions should be used directly. The quirky
NULL / zero-size allocation workaround is no longer necessary and was
adding an extra branch to the allocator code path in a build without
jemalloc. This is a small step towards liballoc being compatible with
handling OOM errors instead of aborting (#18292).

[breaking-change]
2014-10-25 14:12:19 -04:00
Daniel Micay
3942ab92f0 make the core::raw struct representation defined
Closes #18313
2014-10-25 13:28:17 -04:00
Ariel Ben-Yehuda
81b7e62918 Prevent pointer -> int casts in constexprs
These cause issues, as addresses aren't fixed at compile-time.

Fixes #18294
2014-10-25 20:18:32 +03:00
Daniel Micay
6f253bd49e rm unnecessary libc allocator usage 2014-10-25 12:33:27 -04:00
Björn Steinbrink
6c18e508f1 Make MIN_ALIGN a const to allow better optimization
With MIN_ALIGN as a static, other crates don't have access to its value
at compile time, because it is an extern global. That means that the
checks against it can't be optimized out, which is rather unfortunate.
So let's make it a constant instead.
2014-10-25 12:33:27 -04:00
Daniel Hofstetter
122199909d Guide: Fix off-by-one error 2014-10-25 16:22:04 +02:00
bors
80e5fe1a56 auto merge of #18176 : jkleint/rust/guide-borrow-wording, r=steveklabnik
Explain the primary disadvantage of garbage collection is runtime
overhead and unpredictable pauses.  Elucidate where the name "race
condition" comes from.  Emphasize that Rust can guarantee your code is
free of race conditions and other memory errors, with no runtime
overhead.

cc @steveklabnik
2014-10-25 09:17:05 +00:00
Julian Orth
d6dc01e797 Deprecate UdpStream 2014-10-25 09:11:47 +02:00
bors
a34b8dec69 auto merge of #18171 : jakub-/rust/match-typeck, r=pcwalton
Rather than doing it top-down, with a known expected type, we will now simply establish the appropriate constraints between the pattern and the expression it destructures.

Closes #8783.
Closes #10200.
2014-10-25 07:07:08 +00:00
Julian Orth
8adfd02368 Make UdpStream block until the next non-empty msg. 2014-10-25 09:06:35 +02:00
Clark Gaebel
87a5f0ddf4 Make the Vec data structure layout match raw::Slice.
Fixes #18302

r? @thestinger
2014-10-24 20:12:53 -07:00
bors
172b59abe5 auto merge of #18080 : veddan/rust/assume, r=thestinger
Adds an `assume` intrinsic that gets translated to llvm.assume. It is
used on a boolean expression and allows the optimizer to assume that
the expression is true.

This implements #18051.
2014-10-25 00:32:07 +00:00