Commit Graph

61351 Commits

Author SHA1 Message Date
Gheorghe Anghelescu
ffea076f1b add missing comma 2017-02-07 19:47:48 +02:00
Austin Hicks
c3b64cf702 Refactor layout to use the new ReprOptions 2017-02-07 12:35:06 -05:00
bors
a797b6e2fe Auto merge of #39002 - GuillaumeGomez:debug_libcollections, r=aturon
Add Debug implementations for libcollection structs

Part of #31869.
2017-02-07 17:28:51 +00:00
Michael Woerister
e5396e025e Choose different name for metadata obj-file to avoid clashes with user-chosen names. 2017-02-07 12:24:43 -05:00
Son
2ba0b65c27 Improve fmt float
* Move to a separate float mod
* Add more tests for f64 f32 lower exp upper exp
* Use assert_eq for a clearer error message
2017-02-07 20:58:34 +11:00
Jordi Polo
b74e668ded Change deprecation warning to indicate custom derive support was removed from the current compiler version 2017-02-07 18:17:06 +09:00
Zack M. Davis
65435e14fe improve error message when two-arg assert_eq! receives a trailing comma
Previously, `assert_eq!(left, right,)` (respectively, `assert_ne!(left,
right,)`; note the trailing comma) would result in a confusing "requires
at least a format string argument" error. In reality, a format string is
optional, but the trailing comma puts us into the "match a token tree of
zero or more tokens" branch of the macro (in order to support the
optional format string), and passing the empty token tree into
`format_args!` results in the confusing error. If instead we match a
token tree of one or more tokens, we get a much more sensible
"unexpected end of macro invocation" error.

While we're here, fix up a stray space before a comma in the match
guards.

Resolves #39369.
2017-02-06 22:33:09 -08:00
Jack O'Connor
2a345bbcc1 make Child::try_wait return io::Result<Option<ExitStatus>>
This is much nicer for callers who want to short-circuit real I/O errors
with `?`, because they can write this

    if let Some(status) = foo.try_wait()? {
        ...
    } else {
        ...
    }

instead of this

    match foo.try_wait() {
        Ok(status) => {
            ...
        }
        Err(err) if err.kind() == io::ErrorKind::WouldBlock => {
            ...
        }
        Err(err) => return Err(err),
    }

The original design of `try_wait` was patterned after the `Read` and
`Write` traits, which support both blocking and non-blocking
implementations in a single API. But since `try_wait` is never blocking,
it makes sense to optimize for the non-blocking case.

Tracking issue: https://github.com/rust-lang/rust/issues/38903
2017-02-06 23:04:47 -05:00
Austin Hicks
541aa8a270 Introduce ReprOptions, a struct for holding info from the repr attributes. This effectively deprecates lookup_repr_hints. 2017-02-06 21:13:50 -05:00
Esteban Küber
df73bc9c9d Fix ICE when accessing mutably an immutable enum 2017-02-06 16:59:23 -08:00
est31
ddb0a7855c Unignore u128 test for stage 0,1
Even more SNAP cleanup.
2017-02-07 01:55:17 +01:00
bors
c49d10207a Auto merge of #39591 - alexcrichton:revert-128, r=brson
Revert "Add 128-bit atomics"

This reverts commit 9903975003.

Unfortunately 128-bit atomics have broken our nightly builds (#39590) and while we investigate I'm posting a temporary revert of the PR that added them. If we can figure out a solution though before this lands I'd be happy to close!
2017-02-07 00:22:19 +00:00
Clar Charr
550373b1f9 Direct conversions between slices and boxes. 2017-02-06 18:53:13 -05:00
Jean-Sébastien Pédron
235741f150
liblibc: Update to include aarch64-unknown-freebsd support 2017-02-06 23:53:39 +01:00
Alex Crichton
bf126d244e Fix a manifest-generation bug on beta
Right now all Cargo release tarballs are 'nightly', they're not on the standard
channels yet.
2017-02-06 13:33:03 -08:00
Alex Crichton
19bbd855ef Fix branch name Cargo's downloaded from
This landed on beta in #39546 and this is bringing the patch back to master.
2017-02-06 13:29:03 -08:00
Guillaume Gomez
b0803d4aed Display correct filename with --test option 2017-02-06 22:11:03 +01:00
Steve Klabnik
acd84c2f82 Re-write the doc index page
Clarify and reorganize.

Add the section for the bookshelf. More to come here in the near future!

Part of #39588
2017-02-06 15:05:37 -05:00
Marc-Antoine Perennou
4268872807 rustbuild: add verbose to config.toml.example
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-02-06 20:47:04 +01:00
Alex Crichton
bfa264271c Revert "Add 128-bit atomics"
This reverts commit 9903975003.
2017-02-06 10:39:14 -08:00
bjorn3
1ee88e516c A few documentation improvements for syntax::print::pp
* Moved algorithm explanation to module docs
* Added ``` before and after the examples
* Explanation of the `rbox`, `ibox` and `cbox` names
* Added docs about the breaking types to `Breaks`
2017-02-06 19:20:06 +01:00
Oliver Middleton
05eef36fa5 rustdoc: Improve impl disambiguation
* Don't disambiguate if there are multiple impls for the same type.
* Disambiguate for impls of &Foo and &mut Foo.
* Don't try to disambiguate generic types.
2017-02-06 18:11:01 +00:00
Marc-Antoine Perennou
7c2752a95b rustbuild: support setting verbosity in config.toml
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-02-06 18:03:39 +01:00
Alex Crichton
c8e0d04878 compiletest: Add caching of test results
Don't re-run tests in compiletest if all the inputs haven't changed, manage
stamp files in the output directory.
2017-02-06 08:44:27 -08:00
Alex Crichton
9ad13c8d02 rustbuild: Fix a few locations with makefiles gone
* Add version info to channel.rs as main.mk is no longer available
* Update `Makefile.in` used with bootstrap to not try to require `mk/util.mk`
* Update the `dist` target to avoid the makefile pieces
2017-02-06 08:44:27 -08:00
Alex Crichton
ffd3070cc9 Clean our src/etc of old files
Some of these have long since expired, some are no longer in use now that we've
jettisoned the makefiles, but none of them should be needed any more.
2017-02-06 08:43:37 -08:00
Alex Crichton
77c3bfa742 std: Remove cfg(cargobuild) annotations
These are all now no longer needed that we've only got rustbuild in tree.
2017-02-06 08:42:54 -08:00
Alex Crichton
ce4abc3515 Delete Travis/AppVeyor makefile builders
We no longer need these builders as we're no longer testing the old build
system.
2017-02-06 08:42:54 -08:00
Alex Crichton
9b0e6af110 Delete swaths of the configure script
This commit deletes swaths of the configure script related to the old build
system which are now no longer needed when using rustbuild.
2017-02-06 08:42:54 -08:00
Alex Crichton
9ab8090bd4 Delete the mk folder
This commit deletes the old build system located in the `mk` folder as it's now
been obsoleted for two cycles and is replaced by rustbuild.
2017-02-06 08:42:54 -08:00
Niko Matsakis
4f5fc4e242 fix case where some edges can't be recreated by expanding the graph
cc #39569 -- almost certainly a fix for that
2017-02-06 10:20:23 -05:00
Michael Woerister
fa0a728ed6 back: Limit the number of LLVM worker threads. 2017-02-06 10:15:20 -05:00
Jonathan A. Kollasch
78f542b78a Rename i686-unknown-netbsdelf target to i686-unknown-netbsd 2017-02-06 08:49:16 -06:00
Niko Matsakis
b9757863df regr test 2017-02-06 09:37:32 -05:00
bors
324b175174 Auto merge of #39500 - michaelwoerister:fix-ich-testing, r=nikomatsakis
Let the dep-tracking test framework check that all #[rustc_dirty] attrs have been actually checked

r? @nikomatsakis
2017-02-06 14:10:13 +00:00
Son
7c8c45e762 Extract collections benchmarks to libcollections/benches
And libcore/benches
2017-02-06 21:38:47 +11:00
Michael Woerister
ab3c8269f4 Add comment about why the regular unused-attributes infrastructure
is not used for #[rustc_dirty]/#[rustc_clean].
2017-02-06 03:56:58 -05:00
bors
4711ac314c Auto merge of #38436 - bluecereal:patch-1, r=frewsxcv
Update if-let.md

Calling if-let a combination of if and let is confusing, as some may be led to believe that it's a literal combination, instead of syntactic sugar added to the language as a convenience.  What's there to stop someone from thinking if-let is just if and let together?

I do think this article does a good job of implying what's really going on; however, I was only able to notice this after I had begun to understand if/while-let statements, courtesy of the Rust IRC chat.

Basically, this article lacks the clarity and explicitness an inexperienced programmer like me needs in order to understand the contents fully.  This is shown by my inability to understand the if-let concept from this page of the Book alone.

I think convenience, sugar, and (if-let != if + let) should all be made mention of in a clear, explicit manner. I lack confidence in my understanding of this issue, so I wrote just enough to hopefully get my thoughts across.
2017-02-06 06:55:10 +00:00
king6cong
380ba6dbad go back to use // 2017-02-06 10:12:30 +08:00
bluecereal
fb7f211c0c Update if-let.md 2017-02-05 20:20:43 -05:00
Clar Charr
8b2e334e0e Ipv6Addr <-> u128 2017-02-05 18:55:37 -05:00
bors
a3da24bba9 Auto merge of #38897 - nikomatsakis:issue-32330-followup, r=arielb1
make lifetimes that only appear in return type early-bound

This is the full and proper fix for #32330. This also makes some effort to give a nice error message (as evidenced by the `ui` test), sending users over to the tracking issue for a fuller explanation and offering a `--explain` message in some cases.

This needs a crater run before we land.

r? @arielb1
2017-02-05 22:53:10 +00:00
Niko Matsakis
b26120db11 make lifetimes that only appear in return type early-bound
This is the full and proper fix for #32330. This also makes some effort
to give a nice error message (as evidenced by the `ui` test), sending
users over to the tracking issue for a full explanation.
2017-02-05 16:30:03 -05:00
bors
031c1168b9 Auto merge of #39567 - frewsxcv:rollup, r=frewsxcv
Rollup of 12 pull requests

- Successful merges: #39439, #39472, #39481, #39491, #39501, #39509, #39514, #39519, #39526, #39528, #39530, #39538
- Failed merges:
2017-02-05 19:33:55 +00:00
Corey Farwell
a419dd1c01 Rollup merge of #39538 - stjepang:slightly-optimize-sort, r=alexcrichton
Slightly optimize slice::sort

First, get rid of some bound checks.

Second, instead of comparing by ternary `compare` function, use a binary function testing whether an element is less than some other element. This apparently makes it easier for the compiler to reason about the code. I've noticed the same effect with [pdqsort](https://github.com/stjepang/pdqsort) crate.

Benchmark:

```
name                                        before ns/iter        after ns/iter         diff ns/iter   diff %
slice::bench::sort_large_ascending          8,969 (8919 MB/s)     7,410 (10796 MB/s)          -1,559  -17.38%
slice::bench::sort_large_big_ascending      355,640 (3599 MB/s)   359,137 (3564 MB/s)          3,497    0.98%
slice::bench::sort_large_big_descending     427,112 (2996 MB/s)   424,721 (3013 MB/s)         -2,391   -0.56%
slice::bench::sort_large_big_random         2,207,799 (579 MB/s)  2,138,804 (598 MB/s)       -68,995   -3.13%
slice::bench::sort_large_descending         13,694 (5841 MB/s)    13,514 (5919 MB/s)            -180   -1.31%
slice::bench::sort_large_mostly_ascending   239,697 (333 MB/s)    203,542 (393 MB/s)         -36,155  -15.08%
slice::bench::sort_large_mostly_descending  270,102 (296 MB/s)    234,263 (341 MB/s)         -35,839  -13.27%
slice::bench::sort_large_random             513,406 (155 MB/s)    470,084 (170 MB/s)         -43,322   -8.44%
slice::bench::sort_large_random_expensive   23,650,321 (3 MB/s)   23,675,098 (3 MB/s)         24,777    0.10%
slice::bench::sort_medium_ascending         143 (5594 MB/s)       132 (6060 MB/s)                -11   -7.69%
slice::bench::sort_medium_descending        197 (4060 MB/s)       188 (4255 MB/s)                 -9   -4.57%
slice::bench::sort_medium_random            3,358 (238 MB/s)      3,271 (244 MB/s)               -87   -2.59%
slice::bench::sort_small_ascending          32 (2500 MB/s)        32 (2500 MB/s)                   0    0.00%
slice::bench::sort_small_big_ascending      97 (13195 MB/s)       97 (13195 MB/s)                  0    0.00%
slice::bench::sort_small_big_descending     247 (5182 MB/s)       249 (5140 MB/s)                  2    0.81%
slice::bench::sort_small_big_random         502 (2549 MB/s)       498 (2570 MB/s)                 -4   -0.80%
slice::bench::sort_small_descending         55 (1454 MB/s)        61 (1311 MB/s)                   6   10.91%
slice::bench::sort_small_random             358 (223 MB/s)        356 (224 MB/s)                  -2   -0.56%
```
2017-02-05 12:45:15 -05:00
Corey Farwell
70cc1d34fd Rollup merge of #39530 - TimNN:more-gdb, r=alexcrichton
ignore more gdb versions with buggy rust support

This extends the versions of gdb which were ignored in #39039. While just ignoring gdb versions up to 7.12.1 would have been sufficient for now, I believe (after consulting https://sourceware.org/gdb/wiki/Internals%20Versions)  that ignoring versions up to 7.12.9 will prevent the tests failing again for 7.12.2, etc. while still running all tests for the development versions of gdb (which will be >= 7.12.10 as far as I can tell).

This should fix #39522.

cc @Manishearth, @michaelwoerister, #38948
2017-02-05 12:45:14 -05:00
Corey Farwell
3e7ee3535e Rollup merge of #39528 - dylanmckay:llvm-4.0-diglobalvar, r=alexcrichton
[LLVM 4.0] Support a debug info API change for LLVM 4.0

Instead of directly creating a `DIGlobalVariable`, we now have to create
a `DIGlobalVariableExpression` which itself contains a reference to a
'DIGlobalVariable'.

This is a straightforward change.

In the future, we should rename `DIGlobalVariable` in the FFI
bindings, assuming we will only refer to `DIGlobalVariableExpression`
and not `DIGlobalVariable`.
2017-02-05 12:45:13 -05:00
Corey Farwell
4e67bf92e3 Rollup merge of #39526 - canndrew:uninhabited-while-let-fix, r=arielb1
Uninhabited while-let pattern fix

This fix makes it so while-let with an unsatisfiable pattern raises a correct warning rather than an incorrect error.
2017-02-05 12:45:12 -05:00
Corey Farwell
13b8e4b416 Rollup merge of #39519 - nagisa:more-snap, r=alexcrichton
More snap cleanup

r? @alexcrichton
2017-02-05 12:45:11 -05:00
Corey Farwell
d194688c20 Rollup merge of #39514 - tbu-:pr_less_syscalls_fd, r=alexcrichton
Use less syscalls in `FileDesc::set_{nonblocking,cloexec}`

Only set the flags if they differ from what the OS reported, use
`FIONBIO` to atomically set the non-blocking IO flag on Linux.
2017-02-05 12:45:10 -05:00