Commit Graph

35842 Commits

Author SHA1 Message Date
bors
c06edbad34 auto merge of #20133 : apasel422/rust/binary_heap, r=alexcrichton
Some more tidying up.
2014-12-26 21:51:48 +00:00
Nick Cameron
dbde7419cc Fix fallout 2014-12-27 09:55:25 +13:00
Nick Cameron
df0c6d9385 save-analysis: emit names of items that a glob import actually imports.
There is also some work here to make resolve a bit more stable - it no longer overwrites a specific import with a glob import.

[breaking-change]

Import shadowing of single/list imports by globs is now forbidden. An interesting case is where a glob import imports a re-export (`pub use`) of a single import. This still counts as a single import for the purposes of shadowing .You can usually fix any bustage by re-ordering such imports. A single import may still shadow (override) a glob import or the prelude.
2014-12-27 09:55:25 +13:00
Flavio Percoco
bb315f25f8 Implement RaceBox for StdinReader 2014-12-26 17:26:33 +01:00
Flavio Percoco
52072dec0f Add a Racy type to bench tests 2014-12-26 17:26:33 +01:00
Flavio Percoco
29b3698f7f Implement Sync/Send for ArcInner and Weak 2014-12-26 17:26:33 +01:00
Flavio Percoco
84a6684c65 Impl Sync/Send for Rawlink 2014-12-26 17:26:33 +01:00
Flavio Percoco
d35ebcb483 Make Barrier and Condvar Sync/Send 2014-12-26 17:26:33 +01:00
Flavio Percoco
607f60712c Keep track of the whole error chain 2014-12-26 17:26:33 +01:00
Flavio Percoco
8818693496 Relax Arc bounds don't require Sync+Send
Besides the above making sense, it'll also allow us to make `RacyCell`
private and use UnsafeCell instead.
2014-12-26 17:26:33 +01:00
Flavio Percoco
7df17a2868 Rename UniquePtr to Unique
Mostly following the convention in RFC 356
2014-12-26 17:26:33 +01:00
Flavio Percoco
51d2fefd91 Implement Sync for some windows sys types 2014-12-26 17:26:33 +01:00
Flavio Percoco
e2116c8fba Move RacyCell to std::comm
RacyCell is not exactly what we'd like as a final implementation for
this. Therefore, we're moving it under `std::comm` and also making it
private.
2014-12-26 17:26:33 +01:00
Flavio Percoco
f436f9ca29 Make Send and Sync traits unsafe 2014-12-26 17:26:33 +01:00
Flavio Percoco
686ce664da Rename OwnedPtr to UniquePtr 2014-12-26 17:26:33 +01:00
Flavio Percoco
fb803a8570 Require types to opt-in Sync 2014-12-26 17:26:32 +01:00
Jorge Aparicio
5b0c8acd69 typeck: boxed closures can't capture by value
closes #19141
closes #20193
closes #20228
2014-12-26 11:20:34 -05:00
Seo Sanghyeon
9449161aea Do not resolve labels across function boundary 2014-12-26 20:17:43 +09:00
bors
bd3cf4c05f auto merge of #20218 : alexcrichton/rust/jemalloc-sections, r=luqmana
It's quite possible that small programs don't use all of jemalloc, and building
with -ffunction-sections and -fdata-sections allows the linker (via
--gc-sections) to strip out all unused code at link time. This decreases the
size of a "hello world" executable for me from 716K to 482K with no measurable
impact on link time. After this patch jemalloc is still the largest portion of
our hello world executables, but this helps cut down on the size at least
somewhat!
2014-12-26 06:31:47 +00:00
YawarRaza7349
2fefb22dca Fixed minor typo in docs for Result's err method 2014-12-26 00:31:48 -05:00
Barosl Lee
0bd8534ca7 Prevent Regex::new() from panicking when a non-AST item is repeated
This bug has also affected the regex! macro, which has caused an ICE
when such an invalid expression is provided.

Fixes #20208.
2014-12-26 14:02:51 +09:00
bors
c43efee6de auto merge of #20183 : japaric/rust/doctests, r=alexcrichton
#20075 introduced a bug where unmarked code fences weren't considered as doctests. This PR fixes the logic.

---

This passed `check-stage1-rustdoc`, and I manually checked that:

``` rust
//! ```
//! println!("Hello")
//! ```
//!
//! ``` rust
//! println!("Hello")
//! ```
//!
//! ``` sh
//! println!("Hello")
//! ```
//!
//! ``` ignore
//! println!("Hello")
//! ```
```

Generated:

``` rust
running 3 tests
test _2 ... ignored
test _0 ... ok
test _1 ... ok
```

I'd love to add that as a test, but I have no idea how to do that with our testing infrastructure. If anyone knows how, do let me know!

r? @alexcrichton 
@seanmonstar feedback?
2014-12-26 03:01:42 +00:00
Jared Roesch
d25357c522 Add a test case for issue 18906
Closes issue #18906
2014-12-25 18:17:03 -08:00
Simon Sapin
12e60719c4 Fix up remaining usage of to_ascii. 2014-12-26 01:17:30 +01:00
Nick Cameron
c4640a2a69 Changes to RustDoc 2014-12-26 10:54:24 +13:00
Florian Hahn
eb4b20288e Map EEXIST to PathAlreadyExists error, closes #20226 2014-12-25 22:22:44 +01:00
Bheesham Persaud
9092ebab20 Removed the sharding bit from mk/tests.mk
I forgot to do this in my previous PR. This should close #19145 .

	modified:   mk/tests.mk
2014-12-25 16:22:06 -05:00
Nick Cameron
4688aadfde Update tests to use ?Sized 2014-12-26 10:16:24 +13:00
Nick Cameron
e656081b70 Accept ?Sized as well as Sized?
Includes a bit of refactoring to store `?` unbounds as bounds with a modifier, rather than in their own world, in the AST at least.
2014-12-26 10:16:24 +13:00
bors
5ba6102657 auto merge of #20180 : jroesch/rust/clean-where-predicate, r=alexcrichton
Add support for all variants of ast::WherePredicate in clean/mod.rs. Fixes #20048, but will need modification when EqualityPredicates are fully implemented in #20041.
2014-12-25 18:01:36 +00:00
Marvin Löbel
72c8f3772b Prepared most StrExt pattern using methods for stabilization
Made iterator-returning methods return newtypes
Adjusted some docs to be forwards compatible with a generic pattern API
2014-12-25 17:08:29 +01:00
Simon Sapin
dd0baf7f01 Fix up remaining usage of to_ascii. 2014-12-25 15:26:16 +01:00
bors
f673e9841f auto merge of #20167 : michaelwoerister/rust/for-loop-var, r=alexcrichton
... really this time `:)`

I went for the simpler fix after all since it turned out to become a bit too complicated to extract the current iteration value from its containing `Option` with the different memory layouts it can have. It's also what we already do for match bindings.

I also extended the new test case to include the "simple identifier" case.

Fixes #20127, fixes #19732
2014-12-25 14:21:47 +00:00
Adolfo Ochagavía
7fcd2c2691 Fix typo in std::thread comments 2014-12-25 13:38:50 +01:00
Niko Matsakis
4856456dd7 Move mem-categorization more things to use TYPER for the method origin 2014-12-25 07:04:07 -05:00
Niko Matsakis
a583ba2fa0 Remove McResult from the mem-categorization interface. 2014-12-25 07:04:07 -05:00
Niko Matsakis
8f770f10b2 Extend Typer interface to include expr_ty_adjusted so that we can
remove another direct dependency on tcx from euv.
2014-12-25 07:04:07 -05:00
Niko Matsakis
f3ff084d01 Remove the regionck impl of Typer and just use fcx. This requires
modifying fcx to remove type variables where possible, but that's it.
2014-12-25 07:04:07 -05:00
Niko Matsakis
230d0eb003 Use the typer in ExprUseVisitor and do not hard code to tcx 2014-12-25 07:04:07 -05:00
Simon Sapin
c82e59d774 std::ascii: Use u8 methods rather than the maps directly. 2014-12-25 12:19:37 +01:00
Simon Sapin
3a6ccdc263 Remove Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, IntoBytes, IntoString.
As a replacement, add is_ascii() to AsciiExt, and implement AsciiExt for u8 and char.

[breaking-change]
2014-12-25 12:19:37 +01:00
Jonathan Reem
f1e37f9893 trans: Remove is_lang_item from base::invoke
Removes a FIXME on closed issue #15064. This flag is no
longer needed or used since reflection is gone.
2014-12-24 22:52:47 -08:00
bors
ead198c513 auto merge of #20024 : mneumann/rust/dragonfly-fixes3, r=alexcrichton 2014-12-25 05:11:36 +00:00
Alex Crichton
58d808f988 mk: Build jemalloc with -ffunction-sections
It's quite possible that small programs don't use all of jemalloc, and building
with -ffunction-sections and -fdata-sections allows the linker (via
--gc-sections) to strip out all unused code at link time. This decreases the
size of a "hello world" executable for me from 716K to 482K with no measurable
impact on link time. After this patch jemalloc is still the largest portion of
our hello world executables, but this helps cut down on the size at least
somewhat!
2014-12-24 20:20:01 -08:00
Steven Fackler
e8b151b791 Fix backtrace demangling
Closes #20209
2014-12-24 21:41:09 -05:00
Chase Southwood
625697354d Rename remaining hashmap and hashtable iterators to match naming
conventions.

This is a [breaking-change].
2014-12-24 20:19:48 -06:00
bluss
1114685696 hashmap: Fix the example using derived Hash + Eq
The example derived Hash + Eq on a type that was used as *values* for
a hashmap.. for the example to make sense, we have to use a custom *key*
type.

Write a slightly more involved example, still using Vikings, but this
time as key.

I preferred using String over &str here, since that's the typical usage
and we might want to lead users down that path.
2014-12-25 02:17:48 +01:00
bors
65248c5e05 auto merge of #19934 : tomjakubowski/rust/rustdoc-unboxed-closures-redux, r=alexcrichton
We render HRTB and the unboxed closure trait sugar (the so-called 
"parenthesized" notation) where appropriate. Also address the new
`for` syntax on the old closures.
2014-12-25 01:01:42 +00:00
Tshepang Lekhonkhobe
6ca45c3871 doc: surround with symbols, like it should 2014-12-24 23:53:25 +02:00
bors
7e11b22713 auto merge of #20117 : lfairy/rust/rename-include-bin, r=alexcrichton
According to [RFC 344][], methods that return `&[u8]` should have names ending in `bytes`. Though `include_bin!` is a macro not a method, it seems reasonable to follow the convention anyway.

We keep the old name around for now, but trigger a deprecation warning when it is used.

[RFC 344]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md

[breaking-change]
2014-12-24 20:47:12 +00:00