Commit graph

73995 commits

Author SHA1 Message Date
kennytm
33d175f74d Rollup merge of #47874 - jcowgill:mips-from_raw_os_error, r=dtolnay
std: use more portable error number in from_raw_os_error docs

On MIPS, error number 98 is not `EADDRINUSE` (it is `EPROTOTYPE`). To fix the resulting test failure this causes, use a more portable error number in the example documentation. `EINVAL` shold be more reliable because it was defined in the original Unix as 22 so hopefully most derivatives have defined it the same way.
2018-01-31 16:36:09 +08:00
kennytm
c66c6b7ee7 Rollup merge of #47844 - CAD97:patch-1, r=estebank
Fix regression: account for trait methods in arg count mismatch error

Fixed #47706 (https://github.com/rust-lang/rust/issues/47706#issuecomment-361161495)

Original PR #47747 missed methods on trait definitions.

This edit was done in GitHub. I think I got the signature of the variant right, going by the ICE debug output and the other cases above.
2018-01-31 16:36:08 +08:00
kennytm
0370717296 Rollup merge of #47840 - penpalperson:master, r=bluss
Marked Debug implementations for primitive types as #[inline]

Change for issue #47792.
2018-01-31 16:36:06 +08:00
kennytm
89ea6d2a3e Rollup merge of #47838 - euclio:snakecase-suggestion, r=petrochenkov
use correct casing for rename suggestions

If the original name is uppercase, use camel case. Otherwise, use snake
case.
2018-01-31 16:36:05 +08:00
bors
b8f2674ea4 Auto merge of #46666 - clarcharr:duration_core, r=alexcrichton
Move Duration to libcore

Fixes #46520; should be merged after #46508.
2018-01-31 04:16:12 +00:00
penpalperson
deba3890c5 Changed back inline markings. 2018-01-30 05:31:38 -07:00
James Cowgill
e9d70417ca std: use more portable error number in from_raw_os_error docs
On MIPS, error number 98 is not EADDRINUSE (it is EPROTOTYPE). To fix the
resulting test failure this causes, use a more portable error number in
the example documentation. EINVAL shold be more reliable because it was
defined in the original Unix as 22 so hopefully most derivatives have
defined it the same way.
2018-01-30 11:53:50 +00:00
bors
def3269a71 Auto merge of #47870 - kennytm:rollup, r=kennytm
Rollup of 12 pull requests

- Successful merges: #47515, #47603, #47718, #47732, #47760, #47780, #47822, #47826, #47836, #47839, #47853, #47855
- Failed merges:
2018-01-30 11:10:06 +00:00
kennytm
393a1994af Rollup merge of #47855 - ollie27:rustdoc_hoedown_link_title, r=QuietMisdreavus
rustdoc: Fix link title rendering with hoedown

The link title needs to be HTML escaped.

It was broken by #47046.

r? @QuietMisdreavus
2018-01-30 17:11:00 +08:00
kennytm
b83fb0f2de Rollup merge of #47853 - rust-lang:increase-nested-groups-test-coverage, r=nikomatsakis
Increase test coverage of use_nested_groups

r? @nikomatsakis
2018-01-30 17:10:59 +08:00
kennytm
95572df8eb Rollup merge of #47839 - frewsxcv:frewsxcv-map-index, r=QuietMisdreavus
Document that `Index` ops can panic on `HashMap` & `BTreeMap`.

Fixes https://github.com/rust-lang/rust/issues/47011.
2018-01-30 17:10:58 +08:00
kennytm
e8868bdc56 Rollup merge of #47836 - Mark-Simulacrum:stage-flags, r=alexcrichton
Add per-stage RUSTFLAGS: RUSTFLAGS_STAGE_{0,1,2} and RUSTFLAGS_STAGE_NOT_0

Fixes #47658.

r? @alexcrichton
2018-01-30 17:10:57 +08:00
kennytm
16d3fdb752 Rollup merge of #47826 - gnzlbg:patch-2, r=alexcrichton
Whitelist v7 feature for ARM and AARCH64.

Needed for `v7` features in `coresimd`.

See b2f7be24d5/coresimd/src/arm/v7.rs (L40) which used to work but doesn't anymore.

r? alexcrichton
2018-01-30 17:10:56 +08:00
kennytm
003254e105 Rollup merge of #47822 - gnzlbg:patch-1, r=alexcrichton
Whitelist aes x86 feature flag

Required to fix https://github.com/rust-lang-nursery/stdsimd/issues/295 in stdsimd.

Closes #44544 .

r? @alexcrichton
2018-01-30 17:10:55 +08:00
kennytm
44b964147e Rollup merge of #47780 - varkor:cross-file-errors-line-col, r=estebank
Add line numbers and columns to error messages spanning multiple files

If an error message is emitted that spans several files, only the
primary file currently has line and column data attached. This is
useful information, even in files other than the one in which the error
occurs. We can often work out which line and column the error
corresponds to in other files — in this case it is helpful to add them
(in the case of ambiguity, the first relevant line/column is picked,
which is still helpful than none).
2018-01-30 17:10:54 +08:00
kennytm
4dbfc8ddbf Rollup merge of #47760 - little-dude:master, r=alexcrichton
implement Send for process::Command on unix

closes https://github.com/rust-lang/rust/issues/47751
2018-01-30 17:10:53 +08:00
kennytm
f06a391a40 Rollup merge of #47732 - mark-i-m:markim_comments_0001, r=jseyfried
Run rustfmt and add doc comments to libsyntax/ext/tt/macro_parser.rs

Similar to #47603

cc @theotherphil since you reviewed my other PR 😄

And because they are already assigned on #47603:

r? @arielb1
2018-01-30 17:10:52 +08:00
kennytm
fccc85a0ad Rollup merge of #47718 - malbarbo:env-home-dir, r=nikomatsakis
Make run-pass/env-home-dir.rs test more robust

Remove the assumption that home_dir always returns Some.

This allows the test to be executed with [cross](https://github.com/japaric/cross).
2018-01-30 17:10:51 +08:00
kennytm
3e39180706 Rollup merge of #47603 - mark-i-m:markim_comments_0000, r=jseyfried
Run rustfmt and add doc comments to libsyntax/ext/tt/quoted.rs

I was already going to try to understand this code to try to implement rust-lang/rfcs#2298. I figured I would put that knowledge into comments and share... This PR contains _no changes_ to the code itself -- just formatting and comments.

I'm not sure what the best way to do this is. I plan to make more such PR for other files, but I figured it would have fewer conflicts if I do it file by file...
2018-01-30 17:10:49 +08:00
kennytm
19aac099a5 Rollup merge of #47515 - jimmantooth:patch-1, r=QuietMisdreavus
Punctuation and clarity fixes.
2018-01-30 17:10:48 +08:00
bors
fe7e1a45f3 Auto merge of #45294 - petrochenkov:prioplus, r=nikomatsakis
syntax: Lower priority of `+` in `impl Trait`/`dyn Trait`

Now you have to write `Fn() -> (impl A + B)` instead of `Fn() -> impl A + B`, this is consistent with priority of `+` in trait objects (`Fn() -> A + B` means `(Fn() -> A) + B`).

To make this viable I changed the syntax to also permit `+` in return types in function declarations
```
fn f() -> dyn A + B { ... } // OK, don't have to write `-> (dyn A + B)`

// This is acceptable, because `dyn A + B` here is an isolated type and
// not part of a larger type with various operator priorities in play
// like `dyn A + B` in `Fn() -> dyn A + B` despite syntax similarities.
```
but you still have to use `-> (dyn A + B)` in function types and function-like trait object types (see this PR's tests for examples).

This can be a breaking change for code using `impl Trait` on nightly. The thing that is most likely to break is `&impl A + B`, it needs to be rewritten as `&(impl A + B)`.

cc https://github.com/rust-lang/rust/issues/34511 https://github.com/rust-lang/rust/issues/44662 https://github.com/rust-lang/rfcs/pull/438
2018-01-30 08:23:41 +00:00
Christopher Durham
c06c707fbf Fix regression: account for trait methods in arg count mismatch error 2018-01-29 23:08:16 -05:00
Clar Charr
aab712cbc8 Move time::Duration to libcore 2018-01-29 18:16:43 -05:00
Mark Mansi
576294237b fix typos 2018-01-29 17:08:11 -06:00
Mark Mansi
2184400be7 Update comment 2018-01-29 16:37:57 -06:00
bors
90eb44a589 Auto merge of #47837 - eddyb:going-places, r=nikomatsakis
Replace "lvalue" terminology with "place".

See #46425 for the previous PR (which only changed MIR-related code).

r? @nikomatsakis
2018-01-29 19:47:48 +00:00
Oliver Middleton
ae98f4cac5 rustdoc: Fix link title rendering with hoedown
The link title needs to be HTML escaped.
2018-01-29 19:26:31 +00:00
Niko Matsakis
adeb0aeb4a
move comment right onto the line in question 2018-01-29 13:28:23 -05:00
Marco A L Barbosa
898fdcc3ed Make run-pass/env-home-dir.rs test more robust
Remove the assumption that home_dir always returns Some

This allows the test to be executed with
[cross](https://github.com/japaric/cross).
2018-01-29 15:40:27 -02:00
Pietro Albini
8389b66c18
Increase test coverage of use_nested_groups 2018-01-29 17:11:09 +01:00
Mark Simulacrum
e09a8bd70c Add per-stage RUSTFLAGS: RUSTFLAGS_STAGE_{0,1,2} and RUSTFLAGS_STAGE_NOT_0
Fixes #47658.
2018-01-29 07:02:09 -07:00
bors
70f7d5842f Auto merge of #47766 - spastorino:inference-dirty-list, r=nikomatsakis
Make region inference use a dirty list

r? @nikomatsakis
2018-01-29 10:51:07 +00:00
Eduard-Mihai Burtescu
bba81c975d rustc_borrowck: replace "lvalue" terminology with "place" in docs. 2018-01-29 11:48:17 +02:00
Eduard-Mihai Burtescu
6f8d263e87 tests: replace "lvalue" terminology with "place". 2018-01-29 11:48:12 +02:00
bors
679f30e1aa Auto merge of #47730 - alexcrichton:multitrans, r=Mark-Simulacrum
rustc: Split Emscripten to a separate codegen backend

This commit introduces a separately compiled backend for Emscripten, avoiding
compiling the `JSBackend` target in the main LLVM codegen backend. This builds
on the foundation provided by #47671 to create a new codegen backend dedicated
solely to Emscripten, removing the `JSBackend` of the main codegen backend in
the process.

A new field was added to each target for this commit which specifies the backend
to use for translation, the default being `llvm` which is the main backend that
we use. The Emscripten targets specify an `emscripten` backend instead of the
main `llvm` one.

There's a whole bunch of consequences of this change, but I'll try to enumerate
them here:

* A *second* LLVM submodule was added in this commit. The main LLVM submodule
  will soon start to drift from the Emscripten submodule, but currently they're
  both at the same revision.
* Logic was added to rustbuild to *not* build the Emscripten backend by default.
  This is gated behind a `--enable-emscripten` flag to the configure script. By
  default users should neither check out the emscripten submodule nor compile
  it.
* The `init_repo.sh` script was updated to fetch the Emscripten submodule from
  GitHub the same way we do the main LLVM submodule (a tarball fetch).
* The Emscripten backend, turned off by default, is still turned on for a number
  of targets on CI. We'll only be shipping an Emscripten backend with Tier 1
  platforms, though. All cross-compiled platforms will not be receiving an
  Emscripten backend yet.

This commit means that when you download the `rustc` package in Rustup for Tier
1 platforms you'll be receiving two trans backends, one for Emscripten and one
that's the general LLVM backend. If you never compile for Emscripten you'll
never use the Emscripten backend, so we may update this one day to only download
the Emscripten backend when you add the Emscripten target. For now though it's
just an extra 10MB gzip'd.

Closes #46819
2018-01-29 04:55:47 +00:00
penpalperson
81e49597bf Added inline to fmt for debug implementations of primitives. 2018-01-28 21:55:05 -07:00
Corey Farwell
7b4cbbd12d Document that Index ops can panic on HashMap & BTreeMap.
Fixes https://github.com/rust-lang/rust/issues/47011.
2018-01-28 21:51:33 -05:00
Alex Crichton
c6daea7c9a rustc: Split Emscripten to a separate codegen backend
This commit introduces a separately compiled backend for Emscripten, avoiding
compiling the `JSBackend` target in the main LLVM codegen backend. This builds
on the foundation provided by #47671 to create a new codegen backend dedicated
solely to Emscripten, removing the `JSBackend` of the main codegen backend in
the process.

A new field was added to each target for this commit which specifies the backend
to use for translation, the default being `llvm` which is the main backend that
we use. The Emscripten targets specify an `emscripten` backend instead of the
main `llvm` one.

There's a whole bunch of consequences of this change, but I'll try to enumerate
them here:

* A *second* LLVM submodule was added in this commit. The main LLVM submodule
  will soon start to drift from the Emscripten submodule, but currently they're
  both at the same revision.
* Logic was added to rustbuild to *not* build the Emscripten backend by default.
  This is gated behind a `--enable-emscripten` flag to the configure script. By
  default users should neither check out the emscripten submodule nor compile
  it.
* The `init_repo.sh` script was updated to fetch the Emscripten submodule from
  GitHub the same way we do the main LLVM submodule (a tarball fetch).
* The Emscripten backend, turned off by default, is still turned on for a number
  of targets on CI. We'll only be shipping an Emscripten backend with Tier 1
  platforms, though. All cross-compiled platforms will not be receiving an
  Emscripten backend yet.

This commit means that when you download the `rustc` package in Rustup for Tier
1 platforms you'll be receiving two trans backends, one for Emscripten and one
that's the general LLVM backend. If you never compile for Emscripten you'll
never use the Emscripten backend, so we may update this one day to only download
the Emscripten backend when you add the Emscripten target. For now though it's
just an extra 10MB gzip'd.

Closes #46819
2018-01-28 18:32:45 -08:00
Andy Russell
043d4615f2
use correct casing for rename suggestions
If the original name is uppercase, use camel case. Otherwise, use snake
case.
2018-01-28 20:48:54 -05:00
Eduard-Mihai Burtescu
46a9bdda78 rustc: replace "lvalue" terminology with "place" in the code. 2018-01-29 01:49:29 +02:00
bors
385ef1514c Auto merge of #47663 - malbarbo:mips-crt-static, r=alexcrichton
Do not assume dynamic linking for musl/mips[el] targets

All musl targets except mips[el] assume static linking by default. This can be [confusing](https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084).

When the musl/mips[el] targets was [added](https://github.com/rust-lang/rust/pull/31298), dynamic linking was chosen because of binary size concerns, and probably also because libunwind [didn't](https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084/8) supported mips.

Now that we have `crt-static` target-feature (the user can choose dynamic link for musl targets), and libunwind [6.0](https://github.com/llvm-mirror/libunwind/commits/release_60) add support to mips, we do not need to assume dynamic linking.
2018-01-28 23:30:15 +00:00
Eduard-Mihai Burtescu
06a0e4f7ae rustc: move expr_is_lval to rustc_typeck and rename to is_place_expr. 2018-01-29 01:24:25 +02:00
Eduard-Mihai Burtescu
3f4a489f8f rustc_typeck: rename LvalueOp to PlaceOp. 2018-01-29 01:20:18 +02:00
Eduard-Mihai Burtescu
2c4a75bf09 rustc_typeck: rename LvaluePreference::PreferMutLvalue to Needs::MutPlace. 2018-01-29 00:59:25 +02:00
Eduard-Mihai Burtescu
800166cf96 rustc: remove LvaluePreference argument from Ty::builtin_deref. 2018-01-29 00:42:51 +02:00
bors
21882aad72 Auto merge of #47204 - varkor:unsafecell-into_inner-safe, r=alexcrichton
Make UnsafeCell::into_inner safe

This fixes #35067. It will require a Crater run as discussed in that
issue.
2018-01-28 19:01:51 +00:00
gnzlbg
b32dbbc67e
Whitelist v7 feature for ARM and AARCH64.
Needed for `v7` features in `coresimd`. 

See b2f7be24d5/coresimd/src/arm/v7.rs (L40) which used to work but doesn't anymore.

r? alexcrichton
2018-01-28 18:50:03 +01:00
bors
771873c841 Auto merge of #47800 - Pulkit07:issue47755, r=sfackler
don't mention tasks in stability warnings of #[thread_local] #47755

This is a fix for issue #47755.
2018-01-28 16:17:18 +00:00
bors
5e7fd65419 Auto merge of #47794 - etaoins:fix-ice-on-const-eval-of-union-field, r=eddyb
Fix ICE on const eval of union field

MIR's `Const::get_field()` attempts to retrieve the value for a given field in a constant. In the case of a union constant it was falling through to a generic `const_get_elt` based on the field index. As union fields don't have an index this caused an ICE in `llvm_field_index`.

Fix by simply returning the current value when accessing any field in a union. This works because all union fields start at byte offset 0.

The added test uses `const_fn` it ensure the field is extracted using MIR's const evaluation. The crash is reproducible without it, however.

Fixes #47788

r? @eddyb
2018-01-28 13:24:47 +00:00
gnzlbg
2497d10ff3
Whitelist aes x86 feature flag
Required to fix https://github.com/rust-lang-nursery/stdsimd/issues/295 in stdsimd.

r? @alexcrichton
2018-01-28 13:47:06 +01:00