Commit Graph

47075 Commits

Author SHA1 Message Date
Steve Klabnik
8ca14251c9 Rollup merge of #28905 - tshepang:typo, r=steveklabnik 2015-10-08 13:54:04 -04:00
Steve Klabnik
8600610197 Rollup merge of #28904 - panicbit:trpl-derive, r=steveklabnik 2015-10-08 13:54:04 -04:00
Steve Klabnik
ac541d3206 Rollup merge of #28893 - steveklabnik:gh28687, r=nikomatsakis
Fixes #28687
2015-10-08 13:54:03 -04:00
Steve Klabnik
252c3838df Rollup merge of #28872 - iwillspeak:master, r=Manishearth
Currently the explain command line flag requires full error codes, complete with
the leading zeros and the E at the beginning. This commit changes that,
if you don't supply a full error code then the error number is padded
out to the required size and the E is added to the beginning.

This means that where previously you would need to write E0001, you can
now write 0001, 001, 01 or just 1 to refer to the same error.
2015-10-08 13:54:03 -04:00
bors
95285c496f Auto merge of #28621 - tshepang:move-safety, r=steveklabnik 2015-10-08 14:04:41 +00:00
bors
b75fe81055 Auto merge of #28897 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #28836, #28856, #28874, #28876, #28878, #28880, #28882, #28885, #28889, #28896
- Failed merges:
2015-10-08 12:15:47 +00:00
bors
bcd27eb7d5 Auto merge of #28891 - cristicbz:new-nbody, r=alexcrichton
This new version takes inspiration from the C implementation of the benchmark, but instead of explicitly using SIMD operations which can't be done on stable, it instead arranges everything the same way and leaves the actual vectorization up to LLVM.

In addition to the ~20% speed gains (see below), this PR also adds some general niceties which showcase the language a little bit: a `Vec3` type to cut down on `(x, y, z)` repetition,  using `while let` instead of `loop-if-break`, iterator adapters instead of for loops etc.

Here are the times in seconds of 10 runs each on my workstation:

```
before: 6.254, 6.260, 6.263, 6.264, 6.265, 6.267, 6.334, 6.341, 6.441, 6.509
before-min: 6.254
before-median: 6.266
before-max: 6.509

after: 4.823, 4.824, 4.826, 4.827, 4.837, 4.839, 4.881, 4.959, 4.990, 5.377
after-min: 4.823
after-median: 4.838
after-max: 5.377

gcc: 4.674, 4.676, 4.680, 4.682, 4.695, 4.696, 4.701, 4.708, 4.794, 5.297
gcc-min: 4.674
gcc-median: 4.696
gcc-max: 5.297
```

On my i7 laptop the speed up is less impressive, from ~5.4s to ~4.7s, but still significant. On my Vultr VPS the numbers look closer to the workstation results. Surprisingly my laptop beats both office workstation and VPS...
2015-10-08 10:04:12 +00:00
bors
88898e6ca7 Auto merge of #28892 - cristicbz:default-wrapping, r=alexcrichton
It's not very common to store `Wrapping` values, but I kept wrapping and unwrapping a hash value when I taking it out of a struct to do operations on it. I couldn't store the hash as `Wrapping<u64>` because I wanted to be able to `#[derive(Default)]` for the struct.

At any rate, it feels to me that `Wrapping<T>` should implement pretty much everything `T` does. I left out `#[derive(Hash)]` since I'd be hard pressed to find a use case and wanted to avoid the extra generated code, but maybe I should add that too?
2015-10-08 07:39:06 +00:00
Tshepang Lekhonkhobe
88506c2261 reference: fix typos 2015-10-08 07:34:58 +02:00
panicbit
7515514fdc trpl: link to derivable trait's docs 2015-10-08 07:27:26 +02:00
panicbit
4d7eee1817 trpl: mention deriving in traits section 2015-10-08 07:15:39 +02:00
bors
2d405afeb0 Auto merge of #28863 - nagisa:test-16403, r=alexcrichton
Closes #16403
2015-10-08 02:31:46 +00:00
bors
e362679bb6 Auto merge of #28811 - alexcrichton:as-ref-ptrs, r=aturon
These common traits were left off originally by accident from these smart
pointers, and a past attempt (#26008) to add them was later reverted (#26160)
due to unexpected breakge (#26096) occurring. The specific breakage in worry is
the meaning of this return value changed:

    let a: Box<Option<T>> = ...;
    a.as_ref()

Currently this returns `Option<&T>` but after this change it will return
`&Option<T>` because the `AsRef::as_ref` method shares the same name as
`Option::as_ref`. A [crater report][crater] of this change, however, has shown
that the fallout of this change is quite minimal. These trait implementations
are "the right impls to add" to these smart pointers and would enable various
generalizations such as those in #27197.

[crater]: https://gist.github.com/anonymous/0ba4c3512b07641c0f99

This commit is a breaking change for the above reasons mentioned, and the
mitigation strategies look like any of:

    Option::as_ref(&a)
    a.as_ref().as_ref()
    (*a).as_ref()
2015-10-08 00:46:01 +00:00
Steve Klabnik
0fbf7eaf81 Rollup merge of #28896 - mkpankov:core-fmt, r=nrc
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/rust-lang/rust/28896)
<!-- Reviewable:end -->
2015-10-07 18:18:38 -04:00
Steve Klabnik
fb09639d92 Rollup merge of #28889 - JIghtuse:str_doc, r=steveklabnik 2015-10-07 18:18:38 -04:00
Steve Klabnik
c66ff93da7 Rollup merge of #28885 - frewsxcv:patch-25, r=alexcrichton 2015-10-07 18:18:38 -04:00
Steve Klabnik
4c8a0c0578 Rollup merge of #28882 - ykomatsu:trpl, r=steveklabnik 2015-10-07 18:18:37 -04:00
Steve Klabnik
94755b291a Rollup merge of #28880 - Wallacoloo:book-5.14-typo, r=alexcrichton
The diff can hopefully speak for itself. Regardless: this chapter of the book contained a sentence where "the" was mistakenly repeated twice. In this same section, there was a comma separating two sentences where a period should have been. This PR fixes both issues.
2015-10-07 18:18:37 -04:00
Steve Klabnik
5470a1c975 Rollup merge of #28878 - sourcefrog:doc-links, r=steveklabnik 2015-10-07 18:18:37 -04:00
Steve Klabnik
55c2002b2b Rollup merge of #28876 - steveklabnik:oops, r=Gankro
In #28864, @aarzee submitted some whitespace fixes. I r+'d it. But
@retp998 noticed[1] that this file is explicitly a test of this kind of
whitespace, and so I shouldn't have changed it. This restores the old
line endings.

1: https://github.com/rust-lang/rust/pull/28864#discussion_r41332279
2015-10-07 18:18:37 -04:00
Steve Klabnik
4b44296308 Rollup merge of #28874 - GuillaumeGomez:error_code, r=Manishearth
r? @Manishearth
2015-10-07 18:18:36 -04:00
Steve Klabnik
f688c0e711 Rollup merge of #28856 - chills42:master, r=steveklabnik
This is to address issue #28803 by improving some of the references to closures, to explain what they are more clearly, while hopefully still being concise.

r? @steveklabnik
2015-10-07 18:18:36 -04:00
Steve Klabnik
18c66b5aff Rollup merge of #28836 - jackwilsonv:patch-6, r=steveklabnik
r? @steveklabnik
2015-10-07 18:18:36 -04:00
Michael Pankov
11a7773a3a Fix comment gone astray 2015-10-08 01:08:33 +03:00
Michael Pankov
3fbbee6ad5 rustfmt hash submodule 2015-10-08 01:03:52 +03:00
Michael Pankov
17033a62b4 rustfmt part of libcore/fmt
Rest is blocked by https://github.com/nrc/rustfmt/issues/413
2015-10-08 01:02:45 +03:00
bors
e50298f7b5 Auto merge of #28884 - Ms2ger:fmt-mir, r=nikomatsakis
This commit contains some of the changes proposed by a rustfmt invocation,
chosen based on the fairly non-deterministic metric of how much I liked the
change. I expect we will run rustfmt on this crate again later, probably
accepting more of its changes. For now, this is already an improvement over
the status-quo.
2015-10-07 21:25:43 +00:00
Steve Klabnik
bbc2056694 Comment on shadowing with patterns
Fixes #28687
2015-10-07 16:41:15 -04:00
Cristi Cobzarenco
e8021808cb core: Derive Default for Wrapping<T> 2015-10-07 21:31:36 +01:00
Cristi Cobzarenco
49d2441b05 bench: rewrite nbody for better vectorization 2015-10-07 21:05:22 +01:00
bors
babe953e69 Auto merge of #28852 - steveklabnik:doc_char, r=alexcrichton
Mostly adding examples, and reformatting for consistency.
2015-10-07 19:40:03 +00:00
Boris Egorov
1e0fbbd721 trpl: Fix some bad wording in iterators subsection 2015-10-07 23:57:52 +06:00
Boris Egorov
2ba0c48b79 trpl: Use ordered list to release user from counting
Later in text we mention 'step four' and 'step three'. This fix releases user
from counting.
2015-10-07 23:41:20 +06:00
bors
3cee9e20f2 Auto merge of #28873 - dotdash:28339, r=nikomatsakis
Fixes #28839
2015-10-07 16:41:55 +00:00
Björn Steinbrink
4da796f1f4 Fix reborrows of &mut pointers
Fixes #28839
2015-10-07 17:23:51 +02:00
bors
c056cbbe05 Auto merge of #28868 - JIghtuse:str_doc, r=steveklabnik 2015-10-07 13:58:51 +00:00
Corey Farwell
e84461a5c5 Alter formatting for words in Option::cloned doc comment 2015-10-07 09:38:36 -04:00
Ms2ger
c73e78ce64 Partially format librustc_mir with rustfmt.
This commit contains some of the changes proposed by a rustfmt invocation,
chosen based on the fairly non-deterministic metric of how much I liked the
change. I expect we will run rustfmt on this crate again later, probably
accepting more of its changes. For now, this is already an improvement over
the status-quo.
2015-10-07 14:37:45 +02:00
bors
add6b90a3f Auto merge of #28867 - panicbit:german-trpl, r=steveklabnik 2015-10-07 12:13:32 +00:00
Will Speak
5d01556183 Make --explain Handle Partial Error Codes
Currently the explain command requires full erorr codes, complete with
the leading zeros and the E at the beginning. This commit changes that,
if you don't supply a full erorr code then the error number is padded
out to the required size and the E is added to the beginning.

This means that where previously you would need to write E0001, you can
now write 0001, 001, 01 or jsut 1 to refer to the same error.
2015-10-07 11:59:51 +01:00
bors
d454c826f3 Auto merge of #28865 - GuillaumeGomez:patch-1, r=Manishearth
r? @Manishearth
2015-10-07 10:27:31 +00:00
Simonas Kazlauskas
d5dfa87f4d Add a test for #16403 2015-10-07 12:12:13 +03:00
Guillaume Gomez
a94f684129 Add error explanation for E0515 2015-10-07 10:25:46 +02:00
Guillaume Gomez
8fee5480c3 Add new error code 2015-10-07 10:25:45 +02:00
bors
0ea1305fad Auto merge of #28877 - sourcefrog:doc-fuse, r=alexcrichton 2015-10-07 07:41:36 +00:00
Yoshito Komatsu
03dfe89786 Fix a typo
Add musl link
2015-10-07 16:07:42 +09:00
bors
a63b0f045d Auto merge of #28866 - nikomatsakis:remove-hair-trait, r=nrc
As the subject says. This PR also removes the `Hair` trait, which was impeding the ability to build such a map, as described in this thread on internals:

https://internals.rust-lang.org/t/removing-the-hair-trait-from-mir-construction/2732

r? @nrc
2015-10-07 05:11:44 +00:00
Colin Wallace
4119fc2749 Fix "the the" typo and split a run-on sentence 2015-10-06 21:39:18 -07:00
Martin Pool
cbf97c3e65 style guide: suggest manual links to constructors 2015-10-06 19:42:58 -07:00
Martin Pool
22404e1f47 Link from Fuse type docstring to iter.fuse that creates them 2015-10-06 19:29:27 -07:00