Commit Graph

62413 Commits

Author SHA1 Message Date
Alex Crichton
993eae1816 rustc: Support auto-retry linking on a segfault
This is a last-ditch attempt to help our pain with dealing with #38878 on the
bots. A new environment variable is added to the compiler,
`RUSTC_RETRY_LINKER_ON_SEGFAULT`, which will instruct the compiler to
automatically retry the final linker invocation if it looks like the linker
segfaulted (up to 2 extra times).

Unfortunately there have been no successful attempts to debug #38878. The only
information seems to be that the linker (e.g. `ld` on OSX) is segfaulting
somewhere in some thread pool implementation. This appears to be spurious as
failed PRs will later merge.

The hope is that this helps the queue keep moving without clogging and delaying
PRs due to #38878.
2017-03-10 09:13:53 -08:00
Petr Hosek
9a8461104e travis: Fuchsia builder
This change introduces a Dockerfile and script which builds a complete
Fuchsia toolchain which can be used to build Rust distribution for
Fuchsia. We only support cross-compiling at the moment, hence only
setting the target.
2017-03-10 08:28:40 -08:00
Oliver Schneider
b959d13648 Allow lints to check Bodys directly 2017-03-10 08:24:43 -08:00
Vadim Petrochenkov
ffdcf74866 resolve: Use path segment spans in smart_resolve_path 2017-03-10 08:21:45 -08:00
Vadim Petrochenkov
32575a0487 Give spans to individual path segments in AST 2017-03-10 08:21:45 -08:00
Nick Cameron
e5d1b9ca39 save-analysis: cope with lack of method data after a type error
Fixes #39957
2017-03-10 08:20:00 -08:00
Vadim Petrochenkov
880262a2bc Update syntax for pub(restricted) 2017-03-10 08:19:20 -08:00
Alex Crichton
5c8aa74d26 rustc: Exit quickly on only --emit dep-info
This commit alters the compiler to exit quickly if the only output being emitted
is `dep-info`, which doesn't need a lot of other information to generate.

Closes #40328
2017-03-10 08:18:24 -08:00
Nick Cameron
5afe784daa Expect macro defs in save-analysis and add expn info to spans for attr proc macros 2017-03-10 08:16:21 -08:00
Niko Matsakis
4d5441fe3d add comments and remove unused code paths 2017-03-10 08:15:13 -08:00
Niko Matsakis
4b6b544d65 isolate dep-graph tasks
A task function is now given as a `fn` pointer to ensure that it carries
no state. Each fn can take two arguments, because that worked out to be
convenient -- these two arguments must be of some type that is
`DepGraphSafe`, a new trait that is intended to prevent "leaking"
information into the task that was derived from tracked state.

This intentionally leaves `DepGraph::in_task()`, the more common form,
alone. Eventually all uses of `DepGraph::in_task()` should be ported
to `with_task()`, but I wanted to start with a smaller subset.

Originally I wanted to use closures bound by an auto trait, but that
approach has some limitations:

- the trait cannot have a `read()` method; since the current method
  is unused, that may not be a problem.
- more importantly, we would want the auto trait to be "undefined" for all types
  *by default* -- that is, this use case doesn't really fit the typical
  auto trait scenario. For example, imagine that there is a `u32` loaded
  out of a `hir::Node` -- we don't really want to be passing that
  `u32` into the task!
2017-03-10 08:15:13 -08:00
Esteban Küber
7b0dd7bdb8 Fix incorrect span label formatting 2017-03-10 08:14:31 -08:00
Ximin Luo
0a55c8e659 Support armhf abi on 64-bit ARM cpus
They report their `uname -m` as armv8l rather than aarch64.

Patch originally by Matthias Klose <doko@debian.org>
2017-03-10 08:13:21 -08:00
Vadzim Dambrouski
1c5584d106 LLVM: Update submodule to include SRet support patch for MSP430. 2017-03-10 08:10:21 -08:00
Simonas Kazlauskas
4ca9c97ace Remove ability for plugins to register a MIR pass
In recent months there have been a few different people investigating how to make a plugin that
registers a MIR-pass – one that isn’t intended to be eventually merged into rustc proper.

The interface to register MIR passes was added primarily for miri (& later was
found to make prototyping of rustc-proper MIR passes a tiny bit faster). Since miri does not use
this interface anymore it seems like a good time to remove this "feature".

For prototyping purposes a similar interface can be added by developers themselves in their custom
rustc build.
2017-03-10 08:09:29 -08:00
Jeffrey Seyfried
8c98996934 Avoid using Mark and Invocation for macro defs. 2017-03-10 08:08:32 -08:00
Jeffrey Seyfried
e839486318 Move resolve_invoc from syntax to resolve. 2017-03-10 08:08:32 -08:00
Jeffrey Seyfried
212b6c2550 Refactor out ast::ItemKind::MacroDef. 2017-03-10 08:08:32 -08:00
Jonas Bushart
db35604792 Move remove_docs_from_attrs into lowering step 2017-03-10 08:02:24 -08:00
Jonas Bushart
203d22762d Store attributes as strings
Remove the AST structure
2017-03-10 08:02:24 -08:00
Jonas Bushart
a07c9a20b7 Export attributes in save-analysis data
Some annotations like the "test" annotations might be of interest for
other projects, especially rls. Export all attributes in a new
attributes item.
2017-03-10 08:02:24 -08:00
Esteban Küber
ac2bc7c570 Point to enclosing block/fn on nested unsafe
When declaring nested unsafe blocks (`unsafe {unsafe {}}`) that trigger
the "unnecessary `unsafe` block" error, point out the enclosing `unsafe
block` or `unsafe fn` that makes it unnecessary.
2017-03-10 07:53:08 -08:00
Alex Crichton
a8cacd3d21 travis: Attempt to debug sccache failures
I can't find anything that'd cause unexpected EOF in the source, so let's try
taking a look at the error logs on failures.
2017-03-10 07:51:14 -08:00
Guillaume Gomez
ea3c82cd96 Fix associated consts display 2017-03-10 16:21:07 +01:00
Guillaume Gomez
a5a3981f1e Add missing example for Display::fmt 2017-03-10 15:00:19 +01:00
bors
f573db4f80 Auto merge of #39518 - alexcrichton:update-cargo, r=arielb1
rustbuild: Use copies instead of hard links

The original motivation for hard links was to speed up the various stages of
rustbuild, but in the end this is causing problems on Windows (#39504).

This commit tweaks the build system to use copies instead of hard links
unconditionally to ensure that the files accessed by Windows are always
disjoint.

Locally this added .3s to a noop build, so it shouldn't be too much of a
regression hopefully!

Closes #39504
2017-03-10 13:22:12 +00:00
Cengiz Can
889337da06 move related tests to type-check ui test directory 2017-03-10 11:43:34 +03:00
bors
5aaa60611c Auto merge of #39835 - brson:relnotes, r=brson
Release notes for 1.16

[Rendered](https://github.com/brson/rust/blob/relnotes/RELEASES.md)
2017-03-10 07:49:06 +00:00
James Miller
3eb26d1f2b Only run inlining if mir opts are enabled 2017-03-10 03:54:38 +02:00
James Miller
f55e92b2a7 Add dep-graph tasks where needed 2017-03-10 03:54:38 +02:00
James Miller
71d0d921c2 Initial implementation of inlining for MIR
Fairly basic implementation of inlining for MIR. Uses conservative
heuristics for inlining.
2017-03-10 03:54:26 +02:00
James Miller
540b52e145 Fix recursion depth counting in layout 2017-03-10 02:55:39 +02:00
James Miller
d708a4072a Add extra methods to IndexVec and implement TypeFoldable for it
Adds `get`/`get_mut` accessors and `drain`/`drain_enumerated` iterators
to IndexVec.

Implements TypeFoldable for IndexVec.
2017-03-10 02:55:39 +02:00
Cengiz Can
7f19f1f91b fix #40294 obligation cause.body_id is not always a NodeExpr 2017-03-10 02:52:17 +03:00
Joshua Horwitz
e2b4824b88 Removed RustFMT changes 2017-03-09 18:17:45 -05:00
Brian Anderson
23c09eaa77 Release notes for 1.16 2017-03-09 21:35:44 +00:00
Tim Neumann
b95b5db163 update gdbr tests
gdb will now reliably detect the lanugage as rust even before any
code is run.
2017-03-09 22:12:36 +01:00
bors
ec87925325 Auto merge of #40382 - alexcrichton:split-tested-targets, r=brson
travis: Split the linux-tested-targets builder

Travis only gives us 30GB disk space and we don't currently have an option to
increase that. Each musl target generates "hello world" binaries of about 3.5MB
in size, and we're testing two targets in the same image. We have around 3k
run-pass tests and 2 musl targets which works out to around 20GB. That's
dangerously close to the limit and is causing PRs to bounce.

This PR splits up the builder in two, one for x86_64 musl and the other for
i686. Hopefully that'll keep us under the disk limit.

Closes #40359
2017-03-09 20:46:14 +00:00
Alex Crichton
f44801c5ee travis: Split the linux-tested-targets builder
Travis only gives us 30GB disk space and we don't currently have an option to
increase that. Each musl target generates "hello world" binaries of about 3.5MB
in size, and we're testing two targets in the same image. We have around 3k
run-pass tests and 2 musl targets which works out to around 20GB. That's
dangerously close to the limit and is causing PRs to bounce.

This PR splits up the builder in two, one for x86_64 musl and the other for
i686. Hopefully that'll keep us under the disk limit.

Closes #40359
2017-03-09 11:54:24 -08:00
Eduard-Mihai Burtescu
cfb41aedd3 Use subtyping on the target of unsizing coercions. 2017-03-09 21:43:45 +02:00
Eduard-Mihai Burtescu
50aee36d26 Propagate expected type hints through struct literals. 2017-03-09 21:07:56 +02:00
Eduard-Mihai Burtescu
c7db40f232 Rename expected_types_for_fn_args to expected_inputs_for_expected_output. 2017-03-09 21:05:56 +02:00
Guillaume Gomez
4078b25589 Clean up rustdoc css 2017-03-09 19:04:13 +01:00
Simonas Kazlauskas
84d1f6aa82 Do not bother creating StorageLive for TyNever
Keeps MIR cleaner, `StorageLive(_: !)` makes no sense anyway.
2017-03-09 17:54:00 +02:00
Alex Crichton
6f431491d0 rustc: Prefer loading crates in the sysroot
This commit is a random stab in the dark to fix the spurious failures on #39518.
The leading theory of the spurious failures on Windows is that the compiler is
loading a path in the `deps` folder, passing it to `link.exe`, and then this is
racing with Cargo itself updating those paths.

This race, however, has a few unique properties:

* It's isolated to just libstd. Most crates are never passed to the linker and
  simultaneously being worked on by Cargo. Cargo's typical execution of the
  dependency graph never hits this problem.
* The crates are already all located in the sysroot in addition to the `deps`
  folder. This means that the compiler actually has two candidates of crates to
  load, and it's just arbitrarily rejecting one.

Together this means that we shouldn't need to fix this problem "in the large"
and we can instead just fix it in this isolated situation (hopefully). To solve
this the compiler's been updated to prefer crates from the sysroot to leave
Cargo's structure to itself.

We'll see if this actually allows the PR to land...
2017-03-09 07:00:13 -08:00
Alex Crichton
3be02fc410 rustbuild: Use copies instead of hard links
The original motivation for hard links was to speed up the various stages of
rustbuild, but in the end this is causing problems on Windows (#39504).

This commit tweaks the build system to use copies instead of hard links
unconditionally to ensure that the files accessed by Windows are always
disjoint.

Locally this added .3s to a noop build, so it shouldn't be too much of a
regression hopefully!
2017-03-09 07:00:13 -08:00
Charlie Fan
8062cfb372 Implement placement-in protocol for and VecDeque 2017-03-09 22:46:20 +08:00
Robin Kruppe
58ff4f67e3 rustbuild: expose LLVM_PARALLEL_LINK_JOBS
This allows limiting the number of linker jobs to avoid swapping when
linking LLVM with debug info.
2017-03-09 15:07:42 +01:00
Jake Goulding
3e2390ff9c Restore creating the channel-rust-$channel-date.txt files 2017-03-09 08:52:11 -05:00
Jake Goulding
57c989caa1 Fix botched member variable rename 2017-03-09 08:52:11 -05:00