Commit Graph

61095 Commits

Author SHA1 Message Date
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
bors
fc02736d59 Auto merge of #39408 - ollie27:i128_try_from, r=alexcrichton
Fix TryFrom for i128/u128

Another case of `as` cast silent truncation being error prone.

This also adds a few missing TryFrom tests to libcoretest.

cc #33417
cc #35118
2017-02-05 16:57:29 +00:00
bors
9c8cdb2923 Auto merge of #39563 - frewsxcv:rollup, r=frewsxcv
Rollup of 19 pull requests

- Successful merges: #38518, #38921, #38959, #38983, #39009, #39107, #39193, #39289, #39312, #39393, #39442, #39443, #39453, #39454, #39471, #39477, #39478, #39527, #39552
- Failed merges:
2017-02-05 14:15:18 +00:00
Corey Farwell
0a09274e27 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).
2017-02-05 09:14:57 -05:00
Corey Farwell
94fd315173 Rollup merge of #39527 - king6cong:bootstrap-doc, r=alexcrichton
README path correction
2017-02-05 09:14:56 -05:00
Corey Farwell
403ca55a85 Rollup merge of #39478 - alexcrichton:add-xpy, r=japaric
rustbuild: Add x.py to source tarballs

We should be sure to add our build system entry point!

Closes #39476
2017-02-05 09:14:54 -05:00
Corey Farwell
e06fa7cf07 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.

Context: https://github.com/rust-lang/rust/issues/33417#issuecomment-276933861
2017-02-05 09:14:53 -05:00
Corey Farwell
e7f6c36a78 Rollup merge of #39471 - djc:bootstrap-user, r=alexcrichton
Fix bootstrap.py issues with new rustbuild build system (fixes #39469)
2017-02-05 09:14:51 -05:00
Corey Farwell
296c07e27e Rollup merge of #39454 - abonander:proc_macro_tracking_issue, r=jseyfried
Change tracking issue for `proc_macro` feature to #38356

r? @jseyfried
2017-02-05 09:14:50 -05:00
Corey Farwell
ece9240824 Rollup merge of #39453 - nrc:save-path, r=nikomatsakis
save-analysis: be more paranoid about generated paths

fixes https://github.com/rust-lang-nursery/rls/issues/160
2017-02-05 09:14:49 -05:00
Corey Farwell
cd5c520cc2 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`?
```
2017-02-05 09:14:48 -05:00
Corey Farwell
805a99e6cb Rollup merge of #39442 - keeperofdakeys:expand-derives, r=jseyfried
Expand derive macros in the MacroExpander

This removes the expand_derives function, and sprinkles the functionality throughout the Invocation Collector, Expander and Resolver.

Fixes https://github.com/rust-lang/rust/issues/39326

r? @jseyfried
2017-02-05 09:14:46 -05:00
Corey Farwell
65b24779a9 Rollup merge of #39393 - ollie27:stab_impls, r=alexcrichton
Fix a few impl stability attributes

The versions show up in rustdoc.
2017-02-05 09:14:45 -05:00
Corey Farwell
5cfd5eda97 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.

Fixes #39310
2017-02-05 09:14:44 -05:00
Corey Farwell
76e9ea7382 Rollup merge of #39289 - shahn:option_entry, r=alexcrichton
Provide Entry-like API for Option

This implements #39288.

I am wondering whether to use std::intrinsics::unreachable!() here. Both seems fine to me (the second match optimizes away in release mode).
2017-02-05 09:14:42 -05:00
Corey Farwell
49cd748a07 Rollup merge of #39193 - pepyakin:emcc-strip-panic-rt, r=alexcrichton
Tell emscripten to remove exception handling code when panic=abort

Fixes #36900
2017-02-05 09:14:41 -05:00
Corey Farwell
8163b4b1f2 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).
2017-02-05 09:14:40 -05:00
Corey Farwell
4f8ce9efb9 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.
2017-02-05 09:14:39 -05:00
Corey Farwell
ca202fe181 Rollup merge of #38983 - APTy:udp-peek, r=aturon
Add peek APIs to std::net

Adds "peek" APIs to `std::net` sockets, including:
- `UdpSocket.peek()`
- `UdpSocket.peek_from()`
- `TcpStream.peek()`

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.

Fixes #38980
2017-02-05 09:14:38 -05:00
Corey Farwell
c4c6c49e52 Rollup merge of #38959 - Amanieu:atomic128, r=alexcrichton
Add 128-bit atomics

This is currently only supported on AArch64 since that is the only target which unconditionally supports 128-bit atomic operations.

cc #35118
2017-02-05 09:14:37 -05:00
Corey Farwell
6a4c906f7a 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.
2017-02-05 09:14:36 -05:00
Corey Farwell
001bfb9e56 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.
2017-02-05 09:14:34 -05:00
bors
696f5c1fc6 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.
2017-02-05 05:54:44 +00:00
Zack M. Davis
5e06aeeef0 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.
2017-02-04 21:30:16 -08:00
Josh Driver
a201348775 Update pretty test for derive attributes
Remove attr-variant-data.rs since it relies on quirks
in legacy custom derive resolution (undefined derives
only print a warning).

Add a new test which uses a defined proc macro derive,
and tests pretty printing of proc macro derive
attributes.
2017-02-05 12:22:29 +10:30
bors
d7777ae682 Auto merge of #38103 - zackmdavis:lint_errors_resulting_from_lint_groups_or_warnings_meta-lint_obscure_the_original_lint_name, r=nikomatsakis
note individual lint name in messages set via lint group attribute

![lint_errors_resulting_from_lint_groups_obscure](https://cloud.githubusercontent.com/assets/1076988/20783614/c107d5c8-b749-11e6-85de-eada7f67c986.png)

Resolves #36846.

r? @jonathandturner

-----

***Update*** 16 December (new commits):
![lint_group_makeover_party](https://cloud.githubusercontent.com/assets/1076988/21284540/ff1ae2fc-c3d2-11e6-93be-d0689f5fa7a8.png)
2017-02-05 01:22:54 +00:00
Sebastian Hahn
8e02ad0ada Provide Entry-like API for Option
This implements #39288.

Thanks to @steveklabnik and @oli-obk for their review comments :)
2017-02-05 00:48:44 +01:00
Oliver Middleton
a2de6e2285 Fix TryFrom for i128/u128
Another case of `as` cast silent truncation being error prone.

This also adds a few missing TryFrom tests to libcoretest.
2017-02-04 23:10:28 +00:00
Josh Driver
fbdd038866 Move derive macro expansion into the MacroExpander
This removes the expand_derives function, and sprinkles
the functionality throughout the Invocation Collector,
Expander and Resolver.
2017-02-05 09:31:02 +10:30
Josh Driver
0a7380d7fc Rename CustomDerive to ProcMacroDerive for macros 1.1 2017-02-05 09:31:02 +10:30
Josh Driver
0477daf9f0 Make builtin derives a SyntaxExtension
This allows builtin derives to be registered and
resolved, just like other derive types.
2017-02-05 09:31:01 +10:30
bors
ea7a6486a2 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.
2017-02-04 21:13:07 +00:00
Tyler Julian
a40be0857c 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.
2017-02-04 12:00:19 -08:00
Zack M. Davis
72af42e897 note wording: lint implied by lint group, not lint group implies lint 2017-02-04 10:51:11 -08:00
Zack M. Davis
778958f256 make lint-group-style test a UI rather than a compile-fail test
As suggested by Niko Matsakis in review
(https://github.com/rust-lang/rust/pull/38103#discussion_r94460982) regarding
the endeavor prompted by #36846.
2017-02-04 10:51:11 -08:00
Zack M. Davis
93014467f8 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.

This remains in the matter of #36846.
2017-02-04 10:51:11 -08:00
Zack M. Davis
65b0554143 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).

This is in the matter of #36846.
2017-02-04 10:44:22 -08:00
bors
eb5cb9545c 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.)

r? @michaelwoerister

Fixes #39494
2017-02-04 18:38:56 +00:00
bors
8967085617 Auto merge of #39533 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 3 pull requests

- Successful merges: #39486, #39506, #39517
- Failed merges:
2017-02-04 16:04:08 +00:00
Guillaume Gomez
e204987bdb Rollup merge of #39517 - brson:relnotes-151, r=alexcrichton
Update relnotes for 1.15.1

I already checked this into stable, but it needs to be on master/beta too.
2017-02-04 14:41:25 +01:00
Guillaume Gomez
2ce93c1cd2 Rollup merge of #39506 - GuillaumeGomez:hashmap_docs, r=frewsxcv
Add missing urls in HashMap

r? @frewsxcv
2017-02-04 14:41:24 +01:00
Guillaume Gomez
d81b440e92 Rollup merge of #39486 - phungleson:tiny-doc-wording-change, r=alexcrichton
Tiny doc wording change

Fix https://github.com/rust-lang/rust/issues/39366
2017-02-04 14:41:23 +01:00
bors
e4eea73306 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

r? @eddyb

Fixes #39495
2017-02-04 12:38:13 +00:00
Niko Matsakis
b3096e25c0 pacify the mercilous tidy, improve cycle unit test 2017-02-04 06:09:19 -05:00
bors
8568fdc499 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.

r? @bluss
2017-02-04 10:04:06 +00:00
king6cong
b4ef361a8c README path correction 2017-02-04 16:44:23 +08:00
bors
7df5c0f17b Auto merge of #39425 - jakllsch:netbsd-a, r=alexcrichton
Don't build gcc_personality_v0.c on NetBSD either
2017-02-04 07:29:28 +00:00
Andrew Cann
42f3ac5ea6 Expand defaulted unit test 2017-02-04 14:17:58 +08:00
Andrew Cann
7444d07154 Fix test 2017-02-04 14:03:28 +08:00
bors
1b5c7ac833 Auto merge of #39399 - clarcharr:iter_rfind, r=alexcrichton
Add Iterator::rfind.

I found it weird that `Iterator` has `rpostition` but not `rfind`. This adds that method.
2017-02-04 04:53:53 +00:00