Commit Graph

32045 Commits

Author SHA1 Message Date
Simon Sapin
a049fb98cd Have std::io::TempDir::new and new_in return IoResult
This allows using `try!()`

[breaking-change]

Fixes #16875
2014-08-31 22:06:11 +02:00
bors
5dfb7a6ec1 auto merge of #16809 : nick29581/rust/dst-bug-3, r=alexcrichton
This corrects a rebasing error. Also adds a test so it won't happen again.

r?
2014-08-31 19:55:51 +00:00
Andrew Poelstra
00ff5aac4e Rename RawPtr::to_option() to RawPtr::as_ref()
As outlined in

  https://aturon.github.io/style/naming/conversions.html

`to_` functions names should only be used for expensive operations.
Thus `to_option` is better named `as_option`. Also, putting type
names into method names is considered bad style; what the user is
really trying to get is a reference. This `as_ref` is even better.

Also, we are missing a mutable version of this method. So add a
new trait `RawMutPtr` with a corresponding `as_mut` methode.

Finally, there is a bug in the signature of `to_option` which has
been around since lifetime elision: originally the returned reference
had 'static lifetime, but since the elision changes this become
the lifetime of the raw pointer (which does not make sense, since
the pointer lifetime and referent lifetime are unrelated). Fix
the bug to return a reference with a fresh lifetime (which will
be inferred from the calling context).

[breaking-change]
2014-08-31 13:33:55 -05:00
bors
08176a3561 auto merge of #16894 : alexcrichton/rust/issue-16872, r=huonw
It was previously asserted that each thread received at least one connection,
but this is not guaranteed to always be the case due to scheduling. This test
also deadlocked on failure due to a lingering reference to the sending half of
the channel, so that reference is now also eagerly dropped so the test can fail
properly if something bad happens.

Closes #16872
2014-08-31 17:15:52 +00:00
Joseph Crail
c5f66d8135 Fix whitespace and missing parentheses. 2014-08-31 11:53:16 -04:00
bors
27e8d5bca7 auto merge of #16788 : Manishearth/rust/raw-ptr-syntax-ty, r=huonw
@huonw , r? :)

#16781
2014-08-31 12:50:55 +00:00
bors
db47aa5bdf auto merge of #16895 : alexcrichton/rust/rollup, r=alexcrichton
Let's try this again!
2014-08-31 08:26:30 +00:00
Jorge Aparicio
417e4b41bb &mut [T] now implements Collection. Fixes #16896 2014-08-31 02:28:37 -05:00
Alex Crichton
33029c5ddd rollup merge of #16881 : cmr/guide-typo 2014-08-30 23:49:01 -07:00
Andrew Dunham
5bb6196378 Address review comments, add tests 2014-08-30 23:48:31 -07:00
Alex Crichton
56a029f145 rollup merge of #16852 : steveklabnik/desugar_destructure 2014-08-30 23:48:11 -07:00
Alex Crichton
963861fa40 rollup merge of #16849 : nhowell/patch-1 2014-08-30 23:48:05 -07:00
Alex Crichton
daefa70f99 rollup merge of #16846 : treeman/debug-doc 2014-08-30 23:47:53 -07:00
Alex Crichton
f584392ec9 rollup merge of #16842 : zsiciarz/master 2014-08-30 23:47:38 -07:00
Alex Crichton
1bd0df3fbb rollup merge of #16840 : huonw/feature-has-added 2014-08-30 23:47:33 -07:00
Alex Crichton
d1a5b277a1 rollup merge of #16839 : treeman/issue-15358 2014-08-30 23:47:23 -07:00
Alex Crichton
0bce667249 rollup merge of #16835 : michaelsproul/doc-slice-failure 2014-08-30 23:47:17 -07:00
Alex Crichton
89d1c9c48c rollup merge of #16833 : SebastianZaha/fix-guide-typo 2014-08-30 23:47:12 -07:00
Alex Crichton
c50fffaa9a rollup merge of #16832 : SebastianZaha/fix-inconsistent-version-numbering 2014-08-30 23:47:07 -07:00
Alex Crichton
8acceddb16 rollup merge of #16830 : cgaebel/docfix 2014-08-30 23:47:03 -07:00
Alex Crichton
fe848fcd3b rollup merge of #16828 : steveklabnik/more_pointer_guide 2014-08-30 23:46:46 -07:00
Alex Crichton
c6fd2d31ee rollup merge of #16807 : nham/guide_added_ownership_rule 2014-08-30 23:46:38 -07:00
Alex Crichton
f7f8b20961 rollup merge of #16780 : mdinger/marker_types 2014-08-30 23:46:19 -07:00
Alex Crichton
c638ef6c51 rollup merge of #16778 : jbcrail/fix-issue-15826 2014-08-30 23:46:06 -07:00
Alex Crichton
6b3aa5832f rollup merge of #16769 : rgawdzik/abs_doc_addition 2014-08-30 23:45:52 -07:00
Alex Crichton
e442406dd7 rollup merge of #16726 : tshepang/consistency 2014-08-30 23:45:44 -07:00
Alex Crichton
941b06b0bd rollup merge of #16721 : tshepang/convenience 2014-08-30 23:45:41 -07:00
Alex Crichton
9fc29f1d2e rollup merge of #16716 : tshepang/temp 2014-08-30 23:45:37 -07:00
Alex Crichton
4ddbb0d4b1 test: Fix the tcp-accept-stress test
It was previously asserted that each thread received at least one connection,
but this is not guaranteed to always be the case due to scheduling. This test
also deadlocked on failure due to a lingering reference to the sending half of
the channel, so that reference is now also eagerly dropped so the test can fail
properly if something bad happens.

Closes #16872
2014-08-30 23:43:20 -07:00
bors
499a40e59f auto merge of #16650 : ruud-v-a/rust/timespec-arithmetic, r=alexcrichton
This changes the `Add` and `Sub` implementations for `Timespec` introduced in #16573 to use `Duration` as the time span type instead of `Timespec` itself, as [suggested](https://github.com/rust-lang/rust/pull/16573#issuecomment-52593408) by @sfackler.

This depends on #16626, because is uses `Duration::seconds(i64)`, whereas currently `Duration::seconds` takes an `i32`.
2014-08-31 06:41:30 +00:00
Andrew Dunham
1c49eaaa55 gensym each test re-export module individually
Fixes #16597
2014-08-30 20:36:16 -07:00
bors
c2564540de auto merge of #16393 : SimonSapin/rust/patch-9, r=steveklabnik 2014-08-30 23:51:25 +00:00
Eduard Burtescu
a9c3109a6a Allow ExprLit expression macros to be used in patterns. 2014-08-31 01:45:11 +03:00
bors
23c1f9b3c2 auto merge of #16873 : alexcrichton/rust/ignore-deadlocks, r=sfackler
This test apparently keeps making no progress and timing out builds on the OSX
builder, so this commit is switching the test to be ignored.

cc #16872
2014-08-30 21:51:25 +00:00
nham
ea888edf63 doc: Add another restriction to the list of ownership rules. 2014-08-30 17:22:29 -04:00
Steve Klabnik
7e4a1459e9 note about ref patterns in pointer guide
Fixes #13602
2014-08-30 16:15:46 -04:00
bors
f297366593 auto merge of #16859 : alexcrichton/rust/snapshots, r=huonw 2014-08-30 19:51:25 +00:00
Tobba
e676b73d64 Defailbloat fail!(string) 2014-08-30 20:38:47 +02:00
Jakub Wieczorek
6f35ede5a4 Remove the branch merging optimisations for slice patterns
They were only correct in the simplest case. Some of the optimisations
are certainly possible but should be introduced carefully and only
when the whole pattern codegen infrastructure is in a better shape.

Fixes #16648.
2014-08-30 19:50:46 +02:00
Corey Richardson
02d96ac612 guide: function -> closure in explanation of closures 2014-08-30 12:39:52 -04:00
Huon Wilson
b79930eeb9 Fix grammar of the accepted feature warning. 2014-08-31 02:25:19 +10:00
bors
cbacdbc5f3 auto merge of #16598 : bkoropoff/rust/import-shadow-name, r=alexcrichton
This partially alleviates the confusing behavior in issue #16597
2014-08-30 12:41:22 +00:00
bors
d398eb76ae auto merge of #16419 : huonw/rust/pretty-expanded-hygiene, r=pnkfelix
Different Identifiers and Names can have identical textual representations, but different internal representations, due to the macro hygiene machinery (syntax contexts and gensyms). This provides a way to see these internals by compiling with `--pretty expanded,hygiene`.

This is useful for debugging & hacking on macros (e.g. diagnosing https://github.com/rust-lang/rust/issues/15750/https://github.com/rust-lang/rust/issues/15962 likely would've been faster with this functionality).

E.g. 

```rust
#![feature(macro_rules)]
// minimal junk
#![no_std]

macro_rules! foo {
    ($x: ident) => { y + $x }
}

fn bar() {
    foo!(x)
}
```
```rust
#![feature(macro_rules)]
// minimal junk
#![no_std]


fn bar /* 61#0 */() { y /* 60#2 */ + x /* 58#3 */ }
```
2014-08-30 10:51:26 +00:00
bors
43c26e6041 auto merge of #16190 : Pythoner6/rust/labeled-while-loop, r=alexcrichton
Fixes #12643

> Say!
> I like labelled breaks/continues!

I will use them with a `for` loop.
And I will use with a `loop` loop.
Say! I will use them ANYWHERE!
… _even_ in a `while` loop.

Because they're now supported there.
2014-08-30 09:01:20 +00:00
Huon Wilson
32e437161d rustc: implement a pretty mode to print ident/name's ctxt & gensyms.
`--pretty expanded,hygiene` is helpful with debugging macro issues,
since two identifiers/names can be textually the same, but different
internally (resulting in weird "undefined variable" errors).
2014-08-30 16:50:38 +10:00
Alex Crichton
e29059f508 test: Ignore a deadlocking test on OSX
This test apparently keeps making no progress and timing out builds on the OSX
builder, so this commit is switching the test to be ignored.

cc #16872
2014-08-29 23:25:35 -07:00
Tshepang Lekhonkhobe
d89b2a5c3d doc: make docs build
Addresses this comment:
https://github.com/rust-lang/rust/pull/16721#issuecomment-53946624
2014-08-30 08:02:40 +02:00
Peter Atashian
0061b36a77 Fix win64 regression introduced by #15773
Signed-off-by: Peter Atashian <retep998@gmail.com>
2014-08-30 02:02:21 -04:00
wickerwaka
d3d14d6a41 Added cfail test
Changed error to 'use of trait `{}` as a struct constructor'
2014-08-29 21:11:34 -07:00
bors
c8e86e977f auto merge of #16322 : michaelwoerister/rust/gdb-pretty, r=alexcrichton
Also extends the autotest framework to let a test case choose if pretty printing should be enabled.
2014-08-30 04:01:24 +00:00