Commit Graph

35817 Commits

Author SHA1 Message Date
Luqman Aden
e6b6234e66 librustc: Try looking in tuple fields for nullable enum opt. 2014-12-28 19:40:47 -05:00
Luqman Aden
e954fc4385 librustc: Traverse arbitrarily deep for nullable enum opt. 2014-12-28 19:40:46 -05:00
Tamir Duberstein
252423f8b7 Regression test for #17740
Closes #17740.
2014-12-28 09:43:57 -08:00
Tamir Duberstein
2d100212a9 Regression test for #17728
Closes #17728.
2014-12-28 09:43:57 -08:00
Tamir Duberstein
01cdf00c2f Regression test for #16538
Closes #16538.
2014-12-28 09:43:54 -08:00
Alex Crichton
48048419b1 mk: Stop generating docs for deprecated crates
These crates are all deprecated for their rust-lang/$crate equivalents and by
generating docs we're generating broken links. The documentation for these
crates are generated out-of-tree and are managed separately, so we're not losing
the documentation altogether, just the links from the main distribution's docs.

Closes #20096
2014-12-28 09:34:38 -08:00
Tamir Duberstein
d1438f50cf Regression test for #15034
Closes #15034.
2014-12-28 09:22:54 -08:00
Tamir Duberstein
b745a4f944 Regression test for #14227
Closes #14227.
2014-12-28 09:22:54 -08:00
Tamir Duberstein
1fd491c3b4 Regression test for #14386
Closes #14386.
2014-12-28 09:22:53 -08:00
Tamir Duberstein
9cd7864147 Regression tests for #13853
Closes #13853, #14889.
2014-12-28 09:22:53 -08:00
Tamir Duberstein
7a758d188a Regression test for #13808
Closes #13808.
2014-12-28 09:22:53 -08:00
Tamir Duberstein
885d7de975 Regression test for #13665
Closes #13665.
2014-12-28 09:22:53 -08:00
Tamir Duberstein
0579d5846b Regression test for #13655
Closes #13655.
2014-12-28 09:22:53 -08:00
Tamir Duberstein
ee6b97d5af Regression test for simple case of #9197 2014-12-28 09:22:52 -08:00
Tamir Duberstein
dd8fdff4fb Regression test for #8874
Closes #8874.
2014-12-28 09:22:52 -08:00
Tamir Duberstein
5e9a2ab846 Update test for #5543
Closes #5543.
2014-12-28 09:22:52 -08:00
Tamir Duberstein
37250679bc Regression test for #3902
Closes #3902.
2014-12-28 09:22:52 -08:00
bors
6366631721 auto merge of #20185 : csouth3/rust/dlist-deprecate, r=alexcrichton
This PR deprecates the `DList::ListInsertion` trait, in accordance with rust-lang/rfcs#509.  The functions which were previously part of the ListInsertion impl for `DList::IterMut` have been moved to be inherent methods on the iterator itself, and appropriate doctests have been added.
2014-12-28 16:21:58 +00:00
Johannes Hoff
0e2b5d99af Split overly long line 2014-12-28 12:59:19 +01:00
bors
3e6b29f8ad auto merge of #20136 : eddyb/rust/format-args, r=alexcrichton
We have the technology: no longer do you need to write closures to use `format_args!`.
This is a `[breaking-change]`, as it forces you to clean up old hacks - if you had code like this:
```rust
format_args!(fmt::format, "{} {} {}", a, b, c)
format_args!(|args| { w.write_fmt(args) }, "{} {} {}", x, y, z)
```
change it to this: 
```rust
fmt::format(format_args!("{} {} {}", a, b, c))
w.write_fmt(format_args!("{} {} {}", x, y, z))
```
To allow them to be called with `format_args!(...)` directly, several functions were modified to
take `fmt::Arguments` by value instead of by reference. Also, `fmt::Arguments` derives `Copy`
now in order to preserve all usecases that were previously possible.
2014-12-28 03:11:48 +00:00
Eduard Burtescu
647e54d6d1 Fallout of changing format_args!(f, args) to f(format_args!(args)). 2014-12-27 23:57:43 +02:00
Eduard Burtescu
fc3f22bf25 syntax: change format_args! to produce fmt::Arguments instead of calling a function with them. 2014-12-27 23:55:14 +02:00
Eduard Burtescu
3961adcaf0 syntax: use std::string::String unqualified in format. 2014-12-27 23:55:14 +02:00
Eduard Burtescu
68a7f1b5e3 syntax: turn the match-call generated by format_args inside-out. 2014-12-27 23:55:14 +02:00
Eduard Burtescu
17b3c1107a syntax: format: put static arrays in their own blocks to avoid needing a wrapper block. 2014-12-27 23:55:14 +02:00
Eduard Burtescu
22376be754 syntax: format: remove unused method_statics field. 2014-12-27 23:55:14 +02:00
bors
070ab63807 auto merge of #19916 : SimonSapin/rust/ascii-reform, r=sfackler
Implements [RFC 486](https://github.com/rust-lang/rfcs/pull/486). Fixes #19908.

* Rename `to_ascii_{lower,upper}` to `to_ascii_{lower,upper}case`, per #14401
* Remove the `Ascii` type and associated traits: `AsciiCast`, `OwnedAsciiCast`, `AsciiStr`, `IntoBytes`, and `IntoString`.
* As a replacement, add `.is_ascii()` to `AsciiExt`, and implement `AsciiExt` for `u8` and `char`.

[breaking-change]
2014-12-27 21:51:43 +00:00
bors
0201334439 auto merge of #20244 : japaric/rust/bc-no-move, r=nikomatsakis
closes #19141
closes #20193
closes #20228

---

Currently whenever we encounter `let f = || {/* */}`, we *always* type check the RHS as a *boxed* closure. This is wrong when the RHS is `move || {/* */}` (because boxed closures can't capture by value) and generates all sort of badness during trans (see issues above). What we *should* do is always type check `move || {/* */}` as an *unboxed* closure, but ~~I *think* (haven't tried)~~ (2) this is not feasible right now because we have a limited form of kind (`Fn` vs `FnMut` vs `FnOnce`) inference that only works when there is an expected type (1).

In this PR, I've chosen to generate a type error whenever `let f = move || {/* */}` is encountered. The error asks the user to annotate the kind of the unboxed closure (e.g. `move |:| {/* */}`). Once annotated, the compiler will type check the RHS as an unboxed closure which is what the user wants.

r? @nikomatsakis 

(1) AIUI it only triggers in this scenario:

``` rust
fn is_uc<F>(_: F) where F: FnOnce() {}

fn main() {
    is_uc(|| {});  // type checked as unboxed closure with kind `FnOnce`
}
```

(2) I checked, and it's not possible because `check_unboxed_closure` expects a `kind` argument, but we can't supply that argument in this case (i.e. `let f = || {}`, what's the kind?). We could force the `FnOnce` kind in that case, but that's ad hoc. We should try to infer the kind depending on how the closure is used afterwards, but there is no inference mechanism to do that (at least, not right now).
2014-12-27 15:28:36 +00:00
bors
4a4c89c7a4 auto merge of #20119 : FlaPer87/rust/oibit-send-and-friends, r=nikomatsakis
More work on opt-in built in traits. `Send` and `Sync` are not opt-in, `OwnedPtr` renamed to `UniquePtr` and the `Send` and `Sync` traits are now unsafe.

NOTE: This likely needs to be rebased on top of the yet-to-land snapshot.

r? @nikomatsakis 

cc #13231
2014-12-27 13:11:48 +00:00
Flavio Percoco
1a73ccc8db Make trait's impls consistent for unix/windows 2014-12-27 13:00:20 +01:00
Flavio Percoco
11f71ec701 Implement Sync/Send for windows' UnixStream 2014-12-27 12:40:25 +01:00
bors
9be54be15b auto merge of #20238 : barosl/rust/regex-repeater-panic, r=huonw
This bug has also affected the `regex!` macro, which has caused an ICE when such an invalid expression is provided.

Fixes #20208.
2014-12-27 09:21:48 +00:00
bors
16e4fef9bf auto merge of #20158 : nikomatsakis/rust/fn-inference-refactor, r=eddyb
Various refactorings simplifying the mem-categorization and regionck interface. This is working towards an improvement for closure-and-upvar-mode inference.

r? @eddyb
2014-12-27 06:58:35 +00:00
bors
18842f89f0 auto merge of #20143 : csouth3/rust/vecmap-reserve, r=Gankro
Implement `reserve_len` and `reserve_len_exact` for `VecMap` in accordance with rust-lang/rfcs#509.
2014-12-27 04:41:53 +00:00
bors
3c60bc02ce auto merge of #19254 : nick29581/rust/dxr-glob, r=pcwalton
There is also some work here to make resolve a bit more stable - it no longer overwrites a specific import with a glob import.

r?
2014-12-27 00:48:41 +00:00
Nick Cameron
4b92a5a229 Rebasing changes 2014-12-27 12:30:36 +13:00
Flavio Percoco
f5d619caf9 Implement Sync/Send for windows TCP types 2014-12-26 23:01:47 +01:00
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