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.
Tyler Julian [Wed, 11 Jan 2017 03:11:56 +0000 (19:11 -0800)]
libstd/net: Add `peek` APIs to UdpSocket and TcpStream
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.
Zack M. Davis [Fri, 6 Jan 2017 02:55:43 +0000 (18:55 -0800)]
note lint group set on command line triggering individual lint
Previously, the note/message for the source of a lint being the command
line unconditionally named the individual lint, even if the actual
command specified a lint group (e.g., `-D warnings`); here, we take note
of the actual command options so we can be more specific.
Zack M. Davis [Fri, 6 Jan 2017 02:55:36 +0000 (18:55 -0800)]
note individual lint name set via lint group attribute in notes
Warning or error messages set via a lint group attribute
(e.g. `#[deny(warnings)]`) should still make it clear which individual
lint (by name) was triggered, similarly to how we include "on by
default" language for default lints. This—and, while we're here, the
existing "on by default" language—can be tucked into a note rather than
cluttering the main error message. This occasions the slightest of
refactorings (we now have to get the diagnostic-builder with the main
message first, before matching on the lint source).
bors [Sat, 4 Feb 2017 18:38:56 +0000 (18:38 +0000)]
Auto merge of #39424 - nikomatsakis:incr-comp-skip-typeck-3, r=mw
rewrite the predecessors code to create a reduced graph
The old code created a flat listing of "HIR -> WorkProduct" edges.
While perfectly general, this could lead to a lot of repetition if the
same HIR nodes affect many work-products. This is set to be a problem
when we start to skip typeck, since we will be adding a lot more
"work-product"-like nodes.
The newer code uses an alternative strategy: it "reduces" the graph
instead. Basically we walk the dep-graph and convert it to a DAG, where
we only keep intermediate nodes if they are used by multiple
work-products.
This DAG does not contain the same set of nodes as the original graph,
but it is guaranteed that (a) every output node is included in the graph
and (b) the set of input nodes that can reach each output node is
unchanged.
(Input nodes are basically HIR nodes and foreign metadata; output nodes
are nodes that have assocaited state which we will persist to disk in
some way. These are assumed to be disjoint sets.)
bors [Sat, 4 Feb 2017 12:38:13 +0000 (12:38 +0000)]
Auto merge of #39434 - nikomatsakis:incr-comp-skip-typeck-2, r=eddyb
Miscellaneous refactors around how lints and typeck interact
This is preparation for making incr. comp. skip typeck. The main gist of is trying to rationalize the outputs from typeck that are not part of tables:
- one bit of output is the `used_trait_imports` set, which becomes something we track for dependencies
- the other big of output are various lints; we used to store these into a table on sess, but this work stores them into the`TypeckTables`, and then makes the lint pass consult that
- I think it probably makes sense to handle errors similarly, eventually, but that's not necessary now
bors [Sat, 4 Feb 2017 10:04:06 +0000 (10:04 +0000)]
Auto merge of #39440 - F001:SpecializeCow, r=bluss
std: Add ToString trait specialization for Cow<'a, str> and String
There is a specialized version of ToString for str type in std. I think there are other types can also benefit from specialization. `Cow` and `String` are the most obvious one.
est31 [Thu, 2 Feb 2017 21:32:20 +0000 (22:32 +0100)]
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
bors [Fri, 3 Feb 2017 22:55:28 +0000 (22:55 +0000)]
Auto merge of #39463 - alexcrichton:update-bootstrap, r=alexcrichton
Bump version, upgrade bootstrap
This commit updates the version number to 1.17.0 as we're not on that version of
the nightly compiler, and at the same time this updates src/stage0.txt to
bootstrap from freshly minted beta compiler and beta Cargo.
Alex Crichton [Wed, 1 Feb 2017 23:57:50 +0000 (15:57 -0800)]
Bump version, upgrade bootstrap
This commit updates the version number to 1.17.0 as we're not on that version of
the nightly compiler, and at the same time this updates src/stage0.txt to
bootstrap from freshly minted beta compiler and beta Cargo.
bors [Fri, 3 Feb 2017 20:09:36 +0000 (20:09 +0000)]
Auto merge of #39356 - krdln:format-with-capacity, r=aturon
Use `String::with_capacity` in `format!`
Add an `Arguments::estimated_capacity` to estimate the length of formatted text and use it in `std::fmt::format` as the initial capacity of the buffer.
The capacity is calculated based on the literal parts of format string, see the details in the implementation.
bors [Fri, 3 Feb 2017 05:58:09 +0000 (05:58 +0000)]
Auto merge of #39329 - petrochenkov:rb2, r=alexcrichton
rustbuild: Build jemalloc and libbacktrace only once (take 2)
This is a rebase of https://github.com/rust-lang/rust/pull/38583 without any additions, but with implemented @alexcrichton's suggestions.
~~This includes `exists(Makefile)` => `cfg(stage0)` suggestion... but it will break cross-compilation, no? Are `libstd/liballoc_jemalloc` cross-compiled for `target != host` built during `stage0`?~~
bors [Fri, 3 Feb 2017 03:23:35 +0000 (03:23 +0000)]
Auto merge of #39287 - wesleywiser:move_cell, r=aturon
Extend Cell to work with non-Copy types
I'm not sure that I did this right but all of the tests pass.
I also had to move the `new()` function so that `Cell`s with non-`Copy` `T`s could be created. That wasn't in the RFC but I assume it needed to be done?
Niko Matsakis [Sat, 28 Jan 2017 11:34:07 +0000 (06:34 -0500)]
rejigger how we handle used trait imports
The previous way was not friendly to incremental compilation. The new
plan is to compute, for each body, a set of trait imports used in that
body (slightly subtle: for a closure, we assign the trait imports to the
enclosing fn). Then we walk all bodies and union these sets. The reason
we do this is that we can save the individual sets in the incremental
state, and then recompute only those sets that are needed. Before we
were planning to save only the final union, but in that case if some
components are invalidated we have to recompute *all* of them since we
don't have enough information to "partly" invalidate a result.
In truth, this set probably ought to be part of the `TypeckTables`;
however, I opted not to do that because I don't want to have to
save/restore the entire tables in the incremental state yet (since it
contains a lot of `NodeId` references, and removing those is a
significant refactoring).
Jimmy Cuadra [Fri, 3 Feb 2017 01:40:44 +0000 (17:40 -0800)]
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.