Commit Graph

76019 Commits

Author SHA1 Message Date
kennytm
88277f5e4b
Rollup merge of #49254 - Tacklebox:atan2_doc, r=QuietMisdreavus
Fixed clockwise/counter-clockwise in atan2 documentation in f32 and f64 and included that it returns radians

None
2018-03-25 01:26:39 +08:00
kennytm
23967c39c9
Rollup merge of #49235 - topecongiro:run-rustfmt/libtest, r=nrc
Cargo fmt libtest

r? @nrc

Using `rustfmt 0.4.1- (87180d9 2018-03-16)` (`rustfmt --version` is a bit broken).
2018-03-25 01:26:38 +08:00
kennytm
8c1535f115
Rollup merge of #49229 - Centril:doc/format_args_display_debug, r=steveklabnik
Document format_args! / Arguments<'a> behavior wrt. Display and Debug

This is a follow up PR to #49067 , this documents the behavior of `format_args!` (i.e: `Argument<'a>`) wrt. `Display` and `Debug`.

r? @steveklabnik
2018-03-25 01:26:37 +08:00
kennytm
2bd27c9729
Rollup merge of #49203 - Eijebong:lets-cleanup-dependencies, r=Mark-Simulacrum
Bump racer and home

This removes 10 dependencies from the build 🎉
2018-03-25 01:26:36 +08:00
kennytm
e2b89221f1
Rollup merge of #49194 - Zoxc:unsafe-generator, r=cramertj
Make resuming generators unsafe instead of the creation of immovable generators

cc @withoutboats

Fixes #47787
2018-03-25 01:26:34 +08:00
kennytm
311814a1a9
Rollup merge of #49193 - davidtwco:issue-29893, r=alexcrichton
Host compiler documentation

Fixes #29893. Rust Central Station PR: rust-lang/rust-central-station#40

r? @alexcrichton
2018-03-25 01:26:33 +08:00
kennytm
8d57071cbb
Rollup merge of #49162 - tmandry:stabilize-termination-trait, r=nikomatsakis
Stabilize termination_trait, split out termination_trait_test

For #48453.

First time contribution, so I'd really appreciate any feedback on how this PR can be better.

Not sure exactly what kind of documentation update is needed. If there is no PR to update the reference, I can try doing that this week as I have time.
2018-03-25 01:26:32 +08:00
kennytm
c892e68387
Rollup merge of #49122 - scottmcm:z-align-attr, r=cramertj
Add a -Z flag for LLVM align attributes on arguments

LLVM seems to still put the assume calls in when inlining, so this probably isn't in a place where it can be turned on by default, but it's interesting to experiment with.

For example, this makes `mem::swap::<u64x8>` be 8x `vmovaps	ymm` instead of 16x `vmovups	xmm`, on my cpu.
2018-03-25 01:26:30 +08:00
kennytm
adb7984f10
Rollup merge of #49121 - varkor:stabilise-from_utf8_error_as_bytes, r=bluss
Stabilise FromUtf8Error::as_bytes

Closes #40895.
2018-03-25 01:26:29 +08:00
kennytm
c5264a5932
Rollup merge of #49120 - Zoxc:parallel-ci, r=alexcrichton
Add a CI job for parallel rustc using x.py check

r? @alexcrichton
2018-03-25 01:26:28 +08:00
kennytm
23b4bf924f
Rollup merge of #49089 - alexcrichton:fix-timings, r=Mark-Simulacrum
rustbuild: Tweak where timing information goes

This commit tweaks where timing and step information is printed out as part of
the build, ensuring that we do it as close to the location where work happens as
possible. In rustbuild various functions may perform long blocking work as
dependencies are assembled, so if we print out timing information early on we
may accidentally time more than just the step we were intending to time!
2018-03-25 01:26:27 +08:00
kennytm
17d39ed8d5
Rollup merge of #49076 - bobdavelisafrank:filetype-metadata-docfix, r=bluss
Fix Issue #48345, is_file, is_dir, and is_symlink note mutual exclusion

The methods on the structures `fs::FileType` and `fs::Metadata` of (respectively) `is_file`, `is_dir`, and `is_symlink` had some ambiguity in documentation, where it was not noted whether files will pass those tests exclusively or not. It is now written that the tests are mutually exclusive.

Fixes #48345.
2018-03-25 01:26:25 +08:00
kennytm
9c5f372a9a
Rollup merge of #49046 - Zoxc:error-summary, r=michaelwoerister
Always print `aborting due to n previous error(s)`

r? @michaelwoerister
2018-03-25 01:26:24 +08:00
bors
b4aa80dd73 Auto merge of #49251 - nikomatsakis:issue-15872-elision-impl-header, r=cramertj
support elision in impl headers

You can now do things like:

```
impl MyTrait<'_> for &u32 { ... }
```

Each `'_` or elided lifetime is a fresh parameter. `'_` and elision are still not permitted in associated type values. (Plausibly we could support that if there is a single input lifetime.) The original lifetime elision RFC was a bit unclear on this point: [as documented here, I think this is the correct interpretation, both because it fits existing impls and it's most analogous to the behavior in fns](https://github.com/rust-lang/rust/issues/15872#issuecomment-338700138).

We do not support elision with deprecated forms:

```
impl MyTrait for std::cell::Ref<u32> { } // ERROR
```

Builds on the in-band lifetime stuff.

r? @cramertj

Fixes #15872
2018-03-24 13:23:17 +00:00
bors
a0b0f5fba5 Auto merge of #48552 - kennytm:lower-unstable-priority, r=nikomatsakis
Lower the priority of unstable methods when picking a candidate.

Previously, when searching for the impl of a method, we do not consider the stability of the impl. This leads to lots of insta-inference-regressions due to method ambiguity when a popular name is chosen. This has happened multiple times in Rust's history e.g.

* `f64::from_bits` #40470
* `Ord::{min, max}` #42496
* `Ord::clamp` #44095 (eventually got reverted due to these breakages)
* `Iterator::flatten` #48115 (recently added)

This PR changes the probing order so that unstable items are considered last. If a stable item is found, the unstable items will not be considered (but a future-incompatible warning will still be emitted), thus allowing stable code continue to function without using qualified names.

Once the unstable feature is stabilized, the ambiguity error will still be emitted, but the user can also use newly stable std methods, while the current situation is that downstream user is forced to update the code without any immediate benefit.

(I hope that we could bring back `Ord::clamp` if this PR is merged.)
2018-03-24 04:43:24 +00:00
bors
ab0ef145ac Auto merge of #48482 - davidtwco:issue-47184, r=nikomatsakis
NLL should identify and respect the lifetime annotations that the user wrote

Part of #47184.

r? @nikomatsakis
2018-03-24 02:08:22 +00:00
bors
4be5d360cd Auto merge of #49311 - SimonSapin:bootstrap-vs-rustflags-the-return, r=Mark-Simulacrum
Use the same RUSTFLAGS for building and testing `bootstrap`

This avoids recompiling the whole dependency graph twice for every `./x.py test` run.

Fixes #49215
2018-03-23 23:08:13 +00:00
kennytm
17cc3d77d1
Track IsSuggestion in ProbeContext. Don't warn stability for suggestions. 2018-03-24 07:02:36 +08:00
kennytm
db4f3f93bc
Filed a proper tracking issue. 2018-03-24 07:02:35 +08:00
kennytm
28b2bba585
Specialize future-incompatibility warning for UNSTABLE_NAME_COLLISION. 2018-03-24 07:00:48 +08:00
kennytm
023274483e
Changed check_stability to take an Option<NodeId> instead of NodeId.
This clarifies the intent of whether to emit deprecated lint or not.
2018-03-24 06:58:02 +08:00
kennytm
abf4d8babf
When picking a candidate, consider the unstable ones last.
If there is potential ambiguity after stabilizing those candidates, a
warning will be emitted.
2018-03-24 06:58:01 +08:00
kennytm
1731bf8049
Provide a proper span when demanding for the return type of box x. 2018-03-24 06:55:06 +08:00
Simon Sapin
e993e62341 Use the same RUSTFLAGS for building and testing bootstrap
Fixes #49215
2018-03-23 19:55:41 +01:00
bors
c08480fce0 Auto merge of #49308 - alexcrichton:rollup, r=alexcrichton
Rollup of 15 pull requests

- Successful merges: #48265, #48528, #48552, #48624, #48883, #48909, #49028, #49030, #49102, #49160, #49169, #49203, #49262, #49272, #49295
- Failed merges: #48942, #49035
2018-03-23 18:38:16 +00:00
Alex Crichton
0e6cd8b61a Test fixes 2018-03-23 11:37:42 -07:00
David Wood
4161ae7477
Improved comments for UserAssertTy statement. 2018-03-23 17:50:33 +00:00
Alex Crichton
3ebe12eb3e Merge branch '49001_epoch' of https://github.com/klnusbaum/rust into rollup 2018-03-23 10:16:42 -07:00
Alex Crichton
82bb41bdab Merge branch 'master' of https://github.com/Lymia/rust into rollup 2018-03-23 10:16:40 -07:00
Alex Crichton
d58abe75bb Rollup merge of #49295 - csmoe:nll_test_48238, r=alexcrichton
Add test for issue-48238

Fixes #48238
test case made from comments in #48238
2018-03-23 10:16:11 -07:00
Alex Crichton
3624544a53 Rollup merge of #49272 - semarie:cat-and-grep-gnu, r=alexcrichton
Use GNU version of fgrep/egrep tool if available

It is mostly for BSD system. Some tests (run-make/issue-35164 and
run-make/cat-and-grep-sanity-check) are failing with BSD
fgrep, whereas they pass with gnu version (gfgrep).
2018-03-23 10:16:11 -07:00
Alex Crichton
6fd3cc585a Rollup merge of #49262 - oli-obk:fixed_size_array_len, r=estebank
Produce nice array lengths on a best effort basis

fixes #49208

r? @estebank
2018-03-23 10:16:10 -07:00
Alex Crichton
815171b592 Rollup merge of #49169 - sanxiyn:doc-only, r=aturon
Document only-X test header

This was added in #47487 without documentation.
2018-03-23 10:16:10 -07:00
Alex Crichton
401a93096d Rollup merge of #49160 - estebank:issue-47457-missing-fields, r=oli-obk
Reduce the diagnostic spam when multiple fields are missing in pattern

Fix #47457.
2018-03-23 10:16:10 -07:00
Alex Crichton
db2dde9a41 Rollup merge of #49102 - glandium:decimal, r=aturon
Remove core::fmt::num::Decimal

Before ebf9e1aaf6, it was used for Display::fmt, but ebf9e1aaf6 replaced
that with a faster implementation, and nothing else uses it.
2018-03-23 10:16:09 -07:00
Alex Crichton
4b31b5bda7 Rollup merge of #49030 - Zoxc:misc, r=michaelwoerister
Misc changes from my parallel rustc branch

r? @michaelwoerister
2018-03-23 10:16:09 -07:00
Alex Crichton
f74d01cf29 Rollup merge of #49028 - QuietMisdreavus:the-dark-forbidden-corners-of-rustdoc, r=frewsxcv
add an "unstable features" chapter to the rustdoc book

There are several rustdoc features that currently are undocumented, but also don't fit with the rest of the Rustdoc Book since they're also unstable. Some of these have corresponding feature gates and chapters in the Unstable Book, but many don't, and i wanted a place to talk about them officially.

Goal: talk about everything rustdoc can do that needs nightly

- [x] Feature gates (extensions to the doc attribute that can be caught by the compiler)
  - [x] doc(cfg)
  - [x] doc(masked)
  - [x] doc(spotlight)
  - [x] doc(include)
- [x] Command-line flags (features that require a CLI flag to use, where the flag itself is a `-Z` command or otherwise requires `-Z unstable-options` before rustdoc will accept it)
  - [x] markdown-before-content/markdown-after-content
  - [x] playground-url
  - [x] display-warnings
  - [x] crate-version
  - [x] linker
  - [x] sort-modules-by-appearance
  - [x] themes/theme-checker
  - [x] resource-suffix
  - [x] `-Z force-unstable-if-unmarked`
- [x] Nightly-gated functionality (features that are gated by requiring a nightly build without needing a CLI flag or a feature gate to unlock)
  - [x] intra-links
  - [x] error numbers for `compile_fail` doctests
2018-03-23 10:16:08 -07:00
Alex Crichton
7c0c7ef330 Rollup merge of #48909 - RalfJung:type_alias_bounds, r=petrochenkov
Improve lint for type alias bounds

First of all, I learned just today that I was wrong assuming that the bounds in type aliases are entirely ignored: It turns out they are used to resolve associated types in type aliases. So:
```rust
type T1<U: Bound> = U::Assoc; // compiles
type T2<U> = U::Assoc; // fails
type T3<U> = <U as Bound>::Assoc; // "correct" way to write this, maybe?
```
I am sorry for creating this mess.

This PR changes the wording of the lint accordingly. Moreover, since just removing the bound is no longer always a possible fix, I tried to detect cases like `T1` above and show a helpful message to the user:
```
warning: bounds on generic parameters are not enforced in type aliases
  --> $DIR/type-alias-bounds.rs:57:12
   |
LL | type T1<U: Bound> = U::Assoc; //~ WARN not enforced in type aliases
   |            ^^^^^
   |
   = help: the bound will not be checked when the type alias is used, and should be removed
help: use absolute paths (i.e., <T as Trait>::Assoc) to refer to associated types in type aliases
  --> $DIR/type-alias-bounds.rs:57:21
   |
LL | type T1<U: Bound> = U::Assoc; //~ WARN not enforced in type aliases
   |                     ^^^^^^^^
```
I am not sure if I got this entirely right. Ideally, we could provide a suggestion involving the correct trait and type name -- however, while I have access to the HIR in the lint, I do not know how to get access to the resolved name information, like which trait `Assoc` belongs to above. The lint does not even run if that resolution fails, so I assume that information is available *somewhere*...

This is a follow-up for (parts of) https://github.com/rust-lang/rust/pull/48326. Also see https://github.com/rust-lang/rust/issues/21903.

This changes the name of a lint, but that lint was just merged to master yesterday and has never even been on beta.
2018-03-23 10:16:08 -07:00
Alex Crichton
f836ae48e6 Rollup merge of #48883 - alexcrichton:wasm-custom-sections, r=nikomatsakis
rustc: Add a `#[wasm_custom_section]` attribute

This commit is an implementation of adding custom sections to wasm artifacts in
rustc. The intention here is to expose the ability of the wasm binary format to
contain custom sections with arbitrary user-defined data. Currently neither our
version of LLVM nor LLD supports this so the implementation is currently custom
to rustc itself.

The implementation here is to attach a `#[wasm_custom_section = "foo"]`
attribute to any `const` which has a type like `[u8; N]`. Other types of
constants aren't supported yet but may be added one day! This should hopefully
be enough to get off the ground with *some* custom section support.

The current semantics are that any constant tagged with `#[wasm_custom_section]`
section will be *appended* to the corresponding section in the final output wasm
artifact (and this affects dependencies linked in as well, not just the final
crate). This means that whatever is interpreting the contents must be able to
interpret binary-concatenated sections (or each constant needs to be in its own
custom section).

To test this change the existing `run-make` test suite was moved to a
`run-make-fulldeps` folder and a new `run-make` test suite was added which
applies to all targets by default. This test suite currently only has one test
which only runs for the wasm target (using a node.js script to use `WebAssembly`
in JS to parse the wasm output).
2018-03-23 10:16:07 -07:00
Alex Crichton
16eeb10bee Rollup merge of #48624 - bdrewery:freebsd-posix-spawn, r=alexcrichton
Command: Support posix_spawn() on FreeBSD/OSX/GNU Linux
2018-03-23 10:16:07 -07:00
Alex Crichton
7cf4cb5a7b
Rollup merge of #48265 - SimonSapin:nonzero, r=KodrAus
Add 12 num::NonZero* types for primitive integers, deprecate core::nonzero

RFC: https://github.com/rust-lang/rfcs/pull/2307
Tracking issue: ~~https://github.com/rust-lang/rust/issues/27730~~ https://github.com/rust-lang/rust/issues/49137
Fixes https://github.com/rust-lang/rust/issues/27730
2018-03-23 09:27:06 -05:00
David Wood
3a0162b7cb
Fixed issues with incremental tests. 2018-03-23 14:04:08 +00:00
David Wood
03481f19ea
Updated MIR with UserAssertTy in mir-opt tests. 2018-03-23 11:34:06 +00:00
csmoe
ced7687c06 add test for issue-48238 2018-03-23 18:01:05 +08:00
bors
55e1104dd9 Auto merge of #49285 - nrc:update, r=alexcrichton
Update RLS and Rustfmt

Fixes broken RLS tests/build

r? @alexcrichton
2018-03-23 05:43:00 +00:00
David Wood
447ae7612a
Added flag to disable user type assertion. 2018-03-22 22:48:39 +00:00
Niko Matsakis
04aeef8d45
Debug logs for replace_bound_regions_with_nll_infer_vars 2018-03-22 22:40:51 +00:00
Nick Cameron
aa238a3780 Update RLS and Rustfmt
Fixes broken RLS tests/build
2018-03-23 10:34:47 +13:00
David Wood
fc5c4daa88
Temporarily only adding UserAssertTy on binding patterns. 2018-03-22 21:11:03 +00:00
David Wood
e1648bde17
Switched from canonicalize_query to canonicalize_response 2018-03-22 21:11:03 +00:00