Corey Farwell [Wed, 8 Feb 2017 15:19:50 +0000 (10:19 -0500)]
Rollup merge of #39557 - bjorn3:pp-docs, r=jseyfried
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`
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.
Corey Farwell [Wed, 8 Feb 2017 03:54:25 +0000 (22:54 -0500)]
Rollup merge of #39431 - alexcrichton:no-more-makefiles, r=brson
Delete the makefile build system
This PR deletes the makefile build system in favor of the rustbuild build system. The beta has now been branched so 1.16 will continue to be buildable from the makefiles, but going forward 1.17 will only be buildable with rustbuild.
Rustbuild has been the default build system [since 1.15.0](https://github.com/rust-lang/rust/pull/37817) and the makefiles were [proposed for deletion](https://internals.rust-lang.org/t/proposal-for-promoting-rustbuild-to-official-status/4368) at this time back in November of last year.
And now with the deletion of these makefiles we can start getting those sweet sweet improvements of using crates.io crates in the compiler!
Corey Farwell [Wed, 8 Feb 2017 03:54:23 +0000 (22:54 -0500)]
Rollup merge of #39400 - alexcrichton:arm-cross-test, r=brson
Add support for test suites emulated in QEMU
This commit adds support to the build system to execute test suites that cannot
run natively but can instead run inside of a QEMU emulator. A proof-of-concept
builder was added for the `arm-unknown-linux-gnueabihf` target to show off how
this might work.
In general the architecture is to have a server running inside of the emulator
which a local client connects to. The protocol between the server/client
supports compiling tests on the host and running them on the target inside the
emulator.
Corey Farwell [Wed, 8 Feb 2017 03:54:21 +0000 (22:54 -0500)]
Rollup merge of #39372 - seanmonstar:more-addr-froms, r=alexcrichton
A few ergonomic From impls for SocketAddr/IpAddr
My main motivation is removing things like this: `"127.0.0.1:3000".parse().unwrap()`. Instead, this now works: `SocketAddr::from(([127, 0, 0, 1], 3000))` or even `([127, 0, 0, 1], 3000).into())` when passing to a function.
Corey Farwell [Wed, 8 Feb 2017 03:54:20 +0000 (22:54 -0500)]
Rollup merge of #39361 - cengizIO:master, r=arielb1
Improve error message for uninferrable types #38812
Hello,
I tried to improve the error message for uninferrable types. The error code is `E0282`.
```rust
error[E0282]: type annotations needed
--> /home/cengizIO/issue38812.rs:2:11
|
2 | let x = vec![];
| - ^^^^^^ cannot infer type for `T`
| |
| consider giving `x` a type
|
= note: this error originates in a macro outside of the current crate
```
and
```rust
error[E0282]: type annotations needed
--> /home/cengizIO/issue38812.rs:2:15
|
2 | let (x,) = (vec![],);
| ---- ^^^^^^ cannot infer type for `T`
| |
| consider giving a type to pattern
|
= note: this error originates in a macro outside of the current crate
```
Rust compiler now tries to find uninferred `local`s with type `_` and adds them into the error message.
I'm probably wrong on wording that I used. Please feel free to suggest better alternatives.
bors [Wed, 8 Feb 2017 00:03:42 +0000 (00:03 +0000)]
Auto merge of #39324 - clarcharr:ipv6_u128, r=alexcrichton
Ipv6Addr <-> u128
Because we have `u128` now, it makes sense to add a conversion between `Ipv6Addr` and `u128` in addition to the existing one between `Ipv4Addr` and `u32`.
This shouldn't violate the existing feature gate on `u128` because you can't use the type without the feature gate, but if i have to add something, I can.
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.
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!
bjorn3 [Sun, 5 Feb 2017 08:44:49 +0000 (09:44 +0100)]
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`
Alex Crichton [Fri, 27 Jan 2017 22:48:48 +0000 (14:48 -0800)]
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
bors [Mon, 6 Feb 2017 06:55:10 +0000 (06:55 +0000)]
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.
bors [Sun, 5 Feb 2017 22:53:10 +0000 (22:53 +0000)]
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.
Niko Matsakis [Fri, 6 Jan 2017 19:35:23 +0000 (14:35 -0500)]
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.
Corey Farwell [Sun, 5 Feb 2017 17:45:15 +0000 (12:45 -0500)]
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.
Corey Farwell [Sun, 5 Feb 2017 17:45:14 +0000 (12:45 -0500)]
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).
Corey Farwell [Sun, 5 Feb 2017 17:45:13 +0000 (12:45 -0500)]
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`.
Corey Farwell [Sun, 5 Feb 2017 17:45:04 +0000 (12:45 -0500)]
Rollup merge of #39472 - est31:unadjusted_only_for_win, r=nagisa
Don't use "unadjusted" ABI on non windows platforms
We introduced the unadjusted ABI to work around wrong
(buggy) ABI expectations by LLVM on Windows [1].
Therefore, it should be solely used on Windows and not
on other platforms, like right now is the case.
[1]: see this comment for details https://github.com/rust-lang/rust/pull/38482#issuecomment-269074031
Corey Farwell [Sun, 5 Feb 2017 14:14:57 +0000 (09:14 -0500)]
Rollup merge of #39552 - zackmdavis:more_struct_aliases_stabilization_version, r=petrochenkov
correct version in which more_struct_aliases was/will be stable
The stabilizing commit is 5056a437, which is not in 1.14, but is (at
time of writing) on the 1.16 beta branch. [See discussion](https://github.com/rust-lang/rust/pull/39282#discussion_r99481687).
Corey Farwell [Sun, 5 Feb 2017 14:14:53 +0000 (09:14 -0500)]
Rollup merge of #39477 - jimmycuadra:try-from-parameter-name, r=alexcrichton
Add a name for the parameter to `TryFrom::try_from`.
Although signatures with anonymous parameters may not be deprecated or removed at this point, the team seems to agree that the ability to have an anonymous parameter is unfortunate historical baggage, and that we shouldn't create new code that uses it.
Corey Farwell [Sun, 5 Feb 2017 14:14:48 +0000 (09:14 -0500)]
Rollup merge of #39443 - phungleson:remove-unresolved-things, r=nikomatsakis
Don't suggest to use things which weren't found either
Fixes #38054
The best code I can come up with, suggestions are welcome.
Basically, removing ```. Did you mean to use `DoesntExist1`?``` in the code below, because it is useless.
```rust
error[E0432]: unresolved import `DoesntExist1`
--> src/lib.rs:1:5
|
1 | use DoesntExist1;
| ^^^^^^^^^^^^ no `DoesntExist1` in the root
error[E0432]: unresolved import `DoesntExist2`
--> src/lib.rs:2:5
|
2 | use DoesntExist2;
| ^^^^^^^^^^^^ no `DoesntExist2` in the root. Did you mean to use `DoesntExist1`?
```
Corey Farwell [Sun, 5 Feb 2017 14:14:44 +0000 (09:14 -0500)]
Rollup merge of #39312 - mgattozzi:rustdoc-help-fix, r=alexcrichton
Fix full path being output with `rustdoc -h`
rustdoc would output the full path to the binary when calling it with
the `-h` or `--help` flags. This is undesired behavior. It has been
replaced with a hardcoded string `rustdoc` to fix the issue.
Corey Farwell [Sun, 5 Feb 2017 14:14:40 +0000 (09:14 -0500)]
Rollup merge of #39107 - llogiq:branchless_filter_count, r=alexcrichton
branchless .filter(_).count()
I found that the branchless version is only slower if we have little to no branch misses, which usually isn't the case. I notice speedups between -5% (perfect prediction) and 60% (real world data).
Corey Farwell [Sun, 5 Feb 2017 14:14:39 +0000 (09:14 -0500)]
Rollup merge of #39009 - canndrew:default-unit-warnings, r=nikomatsakis
Add warning for () to ! switch
With feature(never_type) enabled diverging type variables will default to `!` instead of `()`. This can cause breakages where a trait is resolved on such a type.
This PR emits a future-compatibility warning when it sees this happen.
These methods enable socket reads without side-effects. That is, repeated calls to `peek()` return identical data. This is accomplished by providing the POSIX flag `MSG_PEEK` to the underlying socket read operations.
This also moves the current implementation of `recv_from` out of the platform-independent `sys_common` and into respective `sys/windows` and `sys/unix` implementations. This allows for more platform-dependent implementations where necessary.
Corey Farwell [Sun, 5 Feb 2017 14:14:36 +0000 (09:14 -0500)]
Rollup merge of #38921 - chris-morgan:windows-unprivileged-symlink-creation, r=alexcrichton
Support unprivileged symlink creation in Windows
Symlink creation on Windows has in the past basically required admin; it’s being opened up a bit in the Creators Update, so that at least people who have put their computers into Developer Mode will be able to create symlinks without special privileges. (It’s unclear from what Microsoft has said whether Developer Mode will be required in the final Creators Update release, but sadly I expect it still will be, so this *still* won’t be as helpful as I’d like.)
Because of compatibility concerns, they’ve hidden this new functionality behind a new flag in the CreateSymbolicLink dwFlags: `SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE`. So we add this flag in order to join the party.
Sources:
- https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/ is the official announcement (search for CreateSymbolicLink)
- https://news.ycombinator.com/item?id=13096354 on why the new flag.
Corey Farwell [Sun, 5 Feb 2017 14:14:34 +0000 (09:14 -0500)]
Rollup merge of #38518 - nagisa:exec-doc, r=alexcrichton
Expand documentation of process::exit and exec
Show a conventional way to use process::exit when destructors are considered important and also
mention that the same caveats wrt destructors apply to exec as well.
bors [Sun, 5 Feb 2017 05:54:44 +0000 (05:54 +0000)]
Auto merge of #38161 - durka:rustdoc-crate-attrs, r=alexcrichton
rustdoc: fix doctests with non-feature crate attrs
Fixes #38129.
The book says that any top-level crate attributes at the beginning of a doctest are moved outside the generated `fn main`, but it was only checking for `#![feature`, not `#![`.
These attributes previously caused warnings but were then ignored, so in theory this could change the behavior of doctests in the wild.
***Update*** 16 December (new commits):
![lint_group_makeover_party](https://cloud.githubusercontent.com/assets/1076988/21284540/ff1ae2fc-c3d2-11e6-93be-d0689f5fa7a8.png)
bors [Sat, 4 Feb 2017 21:13:07 +0000 (21:13 +0000)]
Auto merge of #38426 - vadimcn:nobundle, r=alexcrichton
Implement kind="static-nobundle" (RFC 1717)
This implements the "static-nobundle" library kind (last item from #37403).
Rustc handles "static-nobundle" libs very similarly to dylibs, except that on Windows, uses of their symbols do not get marked with "dllimport". Which is the whole point of this feature.