Commit Graph

74095 Commits

Author SHA1 Message Date
kennytm
2c3e6ac887 Rollup merge of #47886 - alexcrichton:llvm-7-start, r=eddyb
rustc: Add some defines for LLVM 7 compat

I was testing out the tip support to see what's going on with wasm, and this was
I believe the only issue encountered with LLVM 7 support so far.
2018-01-31 16:36:14 +08:00
kennytm
ffb6b466b8 Rollup merge of #47884 - cuviper:run-pass-sse2, r=alexcrichton
Ignore run-pass/sse2 when using system LLVM

This is a test of `target_feature`, which needs a rust-specific patch to
LLVM to add `MCSubtargetInfo::getFeatureTable()`.
2018-01-31 16:36:13 +08:00
kennytm
38587a7bd9 Rollup merge of #47876 - GuillaumeGomez:associated-const-error, r=nikomatsakis
Update associated constants error message

Fixes #47570.
2018-01-31 16:36:11 +08:00
kennytm
6c0d5f5826 Rollup merge of #47875 - jcowgill:mips-clobber-at, r=rkruppe
rustc_trans: clobber $1 (aka $at) on mips

This copies what clang does. There is a long explanation as to why this is needed in the clang source (tools/clang/lib/Basic/Targets/Mips.h).
2018-01-31 16:36:10 +08:00
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
560a2f4faf Auto merge of #45752 - estebank:highlight-primary, r=nikomatsakis
Highlight code on diagnostics when underlined

Highlight the label's span with the respective color:

<img width="692" alt="" src="https://user-images.githubusercontent.com/1606434/32411026-a1842482-c18d-11e7-9933-6510eefbad19.png">

Fix #42112.
2018-01-31 07:53:57 +00: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
Aaron Hill
bc8e11b975
Fix ICE when assigning references to a static mut with NLL
is_unsafe_place only filters out statics in the rhs, not the lhs. Since
it's possible to reach that 'Place::Static', we handle statics the same
way as we do locals.

Fixes #47789
2018-01-30 21:44:35 -05:00
Zack M. Davis
5985b0b035 wherein the parens lint keeps its own counsel re args in nested macros
In #46980 ("in which the unused-parens lint..." (14982db2d6)), the
unused-parens lint was made to check function and method arguments,
which it previously did not (seemingly due to oversight rather than
willful design). However, in #47775 and discussion thereon,
user–developers of Geal/nom and graphql-rust/juniper reported that the
lint was seemingly erroneously triggering on certain complex macros in
those projects. While this doesn't seem like a bug in the lint in the
particular strict sense that the expanded code would, in fact, contain
unncecessary parentheses, it also doesn't seem like the sort of thing
macro authors should have to think about: the spirit of the
unused-parens lint is to prevent needless clutter in code, not to give
macro authors extra heartache in the handling of token trees.

We propose the expediency of declining to lint unused parentheses in
function or method args inside of nested expansions: we believe that
this should eliminate the petty, troublesome lint warnings reported
in the issue, without forgoing the benefits of the lint in simpler
macros.

It seemed like too much duplicated code for the `Call` and `MethodCall`
match arms to duplicate the nested-macro check in addition to each
having their own `for` loop, so this occasioned a slight refactor so
that the function and method cases could share code—hopefully the
overall intent is at least no less clear to the gentle reader.

This is concerning #47775.
2018-01-30 17:47:19 -08:00
varkor
c73925452c Fix ICE when reading non-UTF-8 input from stdin
Fixes #22387.
2018-01-31 00:59:20 +00:00
Diggory Blake
0e6601f630 Add wasm_syscall feature to build system 2018-01-30 23:22:23 +00:00
Diggory Blake
36695a37c5 Implement extensible syscall interface for wasm 2018-01-30 23:22:19 +00:00
Eduard-Mihai Burtescu
973756d715 rustc_trans: keep LLVM types for trait objects anonymous. 2018-01-31 00:23:25 +02:00
Vadzim Dambrouski
1e380cbfdd [MSP430] Don't enable trap_unreachable option by default on msp.
Since MSP430 doesn't meaningfully support faulting on illegal
instructions, LLVM generates a call to abort() function instead
of a trap instruction. Such calls are 4 bytes long, and that is
too much overhead for such small target.
2018-01-31 00:57:30 +03:00
Alex Crichton
a2cc5d68a7 rustc: Add an option to default hidden visibility
This commit adds a new option to target specifictions to specify that symbols
should be "hidden" visibility by default in LLVM. While there are no existing
targets that take advantage of this the `wasm32-unknown-unknown` target will
soon start to use this visibility. The LLD linker currently interprets `hidden`
as "don't export this from the wasm module" which is what we want for 90% of our
functions. While the LLD linker does have a "export this symbol" argument which
is what we use for other linkers, it was also somewhat easier to do this change
instead which'll involve less arguments flying around. Additionally there's no
need for non-`hidden` visibility for most of our symbols!

This change should not immediately impact the wasm targets as-is, but rather
this is laying the foundations for soon integrating LLD as a linker for wasm
code.
2018-01-30 13:41:20 -08:00
Alex Crichton
d492fe0a00 rustc: Add some defines for LLVM 7 compat
I was testing out the tip support to see what's going on with wasm, and this was
I believe the only issue encountered with LLVM 7 support so far.
2018-01-30 12:11:31 -08:00
Niko Matsakis
2fc573945a track intercrate ambiguity only when there is a coherence error 2018-01-30 14:00:25 -05:00
Niko Matsakis
514ae7d917 change overlapping_impls to take a tcx and create the infcx 2018-01-30 14:00:24 -05:00
Niko Matsakis
4c210afb19 make overlapping_impls call closures instead of returning 2018-01-30 13:43:41 -05:00
Josh Stone
eaebfd4420 Ignore run-pass/sse2 when using system LLVM
This is a test of `target_feature`, which needs a rust-specific patch to
LLVM to add `MCSubtargetInfo::getFeatureTable()`.
2018-01-30 10:18:54 -08:00
Guillaume Gomez
f6a6d84031 Update associated constants error message 2018-01-30 18:42:18 +01:00
Santiago Pastorino
b9f756416a Do not ignore lifetime bounds in Copy impls
Closes #29149
2018-01-30 14:00:27 -03:00
penpalperson
deba3890c5 Changed back inline markings. 2018-01-30 05:31:38 -07:00
James Cowgill
d8e4142bd4 rustc_trans: clobber $1 (aka $at) on mips
This copies what clang does. There is a long explanation as to why this
is needed in the clang source (tools/clang/lib/Basic/Targets/Mips.h).
2018-01-30 11:54:52 +00: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
John Kåre Alsaker
6c66e11ff8 The static keyword can now begin expressions 2018-01-30 12:50:42 +01:00
John Kåre Alsaker
56473562c5 Force locals to be live after they are borrowed for immovable generators. Fixes #47736 2018-01-30 12:50:42 +01: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
John Kåre Alsaker
4325c6375e Allow access of the state field before the generator transform. Fixes #47482, #46476 2018-01-30 11:40:39 +01: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