Commit Graph

73071 Commits

Author SHA1 Message Date
Ariel Ben-Yehuda
6aca330149 Handle casts to integer/float variables
These can happen if prior errors disable defaulting.

Fixes #43825.
2017-12-24 11:40:54 +02:00
bors
11a24d9c39 Auto merge of #46888 - cramertj:nested-impl-trait-error, r=nikomatsakis
Add a feature gate for nested uses of `impl Trait`

This allows us to delay stabilization of nested `impl Trait` until we have a plan to solve the problem posed [here](https://github.com/rust-lang/rust/issues/34511#issuecomment-350715858).

r? @nikomatsakis
2017-12-24 07:34:13 +00:00
bors
51b47dc4a1 Auto merge of #46833 - diwic:7c-abort-ffi, r=arielb1
Prevent unwinding past FFI boundaries

Second attempt to write a patch to solve this.

r? @nikomatsakis

~~So, my biggest issue with this patch is the way the patch determines *what* functions should have an abort landing pad (in `construct_fn`). I would ideally have this code match [src/librustc_trans/callee.rs::get_fn](https://github.com/rust-lang/rust/blob/master/src/librustc_trans/callee.rs#L107-L115) but couldn't find an id that returns true for `is_foreign_item`. Also tried `tcx.has_attr("unwind")` with no luck.~~ FIXED

Other issues:

 * llvm.trap is an SIGILL on amd64. Ideally we could use panic-abort's version of aborting which is nicer but we don't want to depend on that library...

 * ~~Mir inlining is a stub currently.~~ FIXED (no-op)

Also, when reviewing please take into account that I'm new to the code and only partially know what I'm doing... and that I've mostly made made matches on `TerminatorKind::Abort` match either `TerminatorKind::Resume` or `TerminatorKind::Unreachable` based on what looked best.
2017-12-24 02:42:15 +00:00
Jonathan S
da9791767b Remove unnecessary assert that unions have only one variant 2017-12-23 20:38:36 -06:00
est31
b03af365fa Fix tests 2017-12-24 03:02:28 +01:00
est31
e5c3aac0b4 Make column macro output 1 based and document it 2017-12-24 02:20:06 +01:00
Alex Crichton
b5361d0d41 rustc: Set release mode cgus to 16 by default
This commit is the next attempt to enable multiple codegen units by default in
release mode, getting some of those sweet, sweet parallelism wins by running
codegen in parallel. Performance should not be lost due to ThinLTO being on by
default as well.

Closes #45320
2017-12-23 16:04:15 -08:00
Matthew Jasper
1a308ba90a Give MIR borrowck a better understanding of inline asm 2017-12-23 23:45:07 +00:00
bors
8d4da4f4c4 Auto merge of #46881 - michaelwoerister:ensure-coherence, r=nikomatsakis
incr.comp.: Cache check_match and use ensure() for coherence-related queries.

Some minor optimizations.

r? @nikomatsakis
2017-12-23 23:06:13 +00:00
Ariel Ben-Yehuda
ce58d965ef Update check::cast::pointer_kind logic to new rustc
Make the match exhaustive, adding handling for anonymous types and
tuple coercions on the way.

Also, exit early when type errors are detected, to avoid error cascades
and the like.
2017-12-23 23:38:09 +02:00
Sam Green
26a9f21acd Update compiler_builtins 2017-12-23 19:03:54 +00:00
Michael Hewson
60e6629045 fix doctests in libcore 2017-12-23 12:36:04 -05:00
Wilco Kusee
d10d389225 Testcase for const-eval array lengths 2017-12-23 11:16:03 +01:00
kennytm
8d76e281bf
Enable IPv6 support in Dockers to workaround travis-ci/travis-ci#8891. 2017-12-23 18:12:01 +08:00
kennytm
2352a888a1
Revert "Temporarily use the old Travis image."
This reverts commit c0c26a649e.
2017-12-23 18:10:36 +08:00
Christopher Durham
056370167a Annotate raw pointer target types
cc https://github.com/rust-lang/rust/issues/46906
cc https://github.com/rust-lang/rust/pull/46914
2017-12-23 03:47:13 -05:00
bors
1699293083 Auto merge of #46864 - estebank:closure-type-err-sp, r=nikomatsakis
Closure type error ui tweak

Do not point at the same span on all notes/help messages, and instead
show them without a span.
2017-12-23 04:40:39 +00:00
bors
565907fefb Auto merge of #46857 - estebank:use-loop-sp, r=nikomatsakis
Point at `while true` span instead of entire block
2017-12-23 02:08:27 +00:00
bors
f0cf23e115 Auto merge of #46842 - michaelwoerister:fingerprint-vec, r=nikomatsakis
incr.comp.: Use an array instead of a hashmap for storing result hashes.

Doing so should result in some of the core tracking components being faster.

r? @nikomatsakis
2017-12-22 23:34:29 +00:00
Michael Hewson
1e2bd7021a fix errors in rustc_data_structures 2017-12-22 18:16:19 -05:00
Michael Hewson
e94b29065f fix some errors in libstd 2017-12-22 12:40:39 -05:00
bors
5165ee9e20 Auto merge of #46838 - pnkfelix:issue-46112-followup, r=estebank
Followup for #46112.

Sorting by crate-num should ensure that we favor `std::foo::bar` over
`any_other_crate::foo::bar`.

Interestingly, *this* change had a much larger impact on our internal
test suite than PR #46708 (which was my original fix to #46112).
2017-12-22 16:02:31 +00:00
David Wood
6710bd8614
Updated existing tests. 2017-12-22 15:48:56 +00:00
David Wood
3dfe256b5f
Added 'move occurs because X is not Copy' note. 2017-12-22 15:01:47 +00:00
David Wood
c428b7d9c1
Converted moves-based-on-type-tuple test and added MIR borrowck comparison. 2017-12-22 15:01:47 +00:00
bors
2c037d5589 Auto merge of #46779 - Zoxc:par-merge-without-sync, r=arielb1
Work towards thread safety in rustc

This PR is split out from https://github.com/rust-lang/rust/pull/45912. It contains changes which do not require the `sync` module.
2017-12-22 12:34:45 +00:00
Michael Hewson
0783db9e0f Convert warning about *const _ to a future-compat lint 2017-12-22 07:05:09 -05:00
Marco A L Barbosa
dc71cab4df Fix process test when using busybox mkdir
busybox mkdir . returns 0
busybox mkdir ./ returns 1
2017-12-22 08:21:05 -02:00
bors
264af16757 Auto merge of #46752 - Yoric:nll, r=arielb1
Issue #46589 - Kill borrows on a local variable whenever we assign ov…

…er this variable

This is a first patch for the issue, handling the simple case while I figure out the data structures involved in the more complex cases.
2017-12-22 09:54:21 +00:00
Ed Schouten
41567525fe Add CloudABI to the list of supported targets.
Backend definitions for these targets are present, meaning we can start
announcing this target. While there, sort the list alphabetically.
2017-12-22 09:39:40 +01:00
Ed Schouten
0e703edf84 Add support for CloudABI targets to the rustc backend.
CloudABI is a sandboxed UNIX-like runtime environment. It is a
programming environment that uses a capability-based security model. In
practice this means that many POSIX interfaces are present, except for
ones that try to access resources out of thin air. For example, open()
is gone, but openat() is present.

Right now I'm at the point where I can compile very basic CloudABI
applications on all four supported architectures (ARM and x86, 32 and 64
bits). The next step will be to get libstd to work. Patches for that are
outside the scope of this change.

More info: https://nuxi.nl/cloudabi/ https://github.com/NuxiNL/cloudlibc/
2017-12-22 09:37:02 +01:00
Scott Abbey
b989428f7d Don't try to statically link libstdc++ on FreeBSD
The code inside this conditional will not work on FreeBSD 10+ because
those versions use clang and libc++ rather than libstdc++.

Since FreeBSD comes with libc++ in the base, presumably all 10+ systems
will have it present.

Searching for libstdc++.a will not work if it is not present.  As a
result, this would previously have set `LLVM_STATIC_STDCPP=libstdc++.a`,
which isn't a valid path and caused problems later on when building
`librustc_llvm`.

This could possibly be updated in the future to look for `libc++.a` on
FreeBSD, by expanding the code inside the conditional.  In one attempt
to run this on x86_64-freebsd, I found that libc++ was not compiled with
PIC, so it failed anyway.
2017-12-22 02:34:13 -06:00
Jed Davis
f7a0dffc78 Re-do the FreeBSD cross-builds to use Clang and libc++. Fixes #44433.
The main goal here is to use FreeBSD's normal libc++, instead of
statically linking the libstdc++ packaged with GCC, because that
libstdc++ has bugs that cause rustc to deadlock inside LLVM.

But the easiest way to use libc++ is to switch the build from GCC to
Clang, and the Clang package in the Ubuntu image already knows how to
cross-compile (given a sysroot and preferably cross-binutils), so the
toolchain script now uses that instead of building a custom compiler.

This also de-duplicates the `build-toolchain.sh` script.
2017-12-22 02:34:09 -06:00
David Alber
4e14a7d724 Fixing Rust Moderation Team link 2017-12-22 00:05:14 -08:00
bors
c2ecab1121 Auto merge of #46732 - estebank:silence-recovered-blocks, r=petrochenkov
Do not emit type errors on recovered blocks

When a parse error occurs on a block, the parser will recover and create
a block with the statements collected until that point. Now a flag
stating that a recovery has been performed in this block is propagated
so that the type checker knows that the type of the block (which will be
identified as `()`) shouldn't be checked against the expectation to
reduce the amount of irrelevant diagnostic errors shown to the user.

Fix #44579.
2017-12-22 07:22:33 +00:00
Clar Charr
ebdd667d40 Make core::f32/f64 docs match std. 2017-12-21 20:32:07 -05:00
Luc Street
8a956e44a8
Clarify docs for split_at_mut
The `&mut` here didn't make immediate sense to me. Keep the docs for this function consistent with the non-mut version.
2017-12-21 15:22:36 -08:00
Esteban Küber
d90d5d19da Mark clippy as broken 2017-12-21 15:09:26 -08:00
bors
ba2741594b Auto merge of #46922 - kennytm:rollup, r=kennytm
Rollup of 14 pull requests

- Successful merges: #46636, #46780, #46784, #46809, #46814, #46820, #46839, #46847, #46858, #46878, #46884, #46890, #46898, #46918
- Failed merges:
2017-12-21 23:01:27 +00:00
varkor
20eece1f77 Correct the return type for x86_mm256_sad_epu8
Fixes #43439.
2017-12-21 22:58:03 +00:00
Esteban Küber
aaf3e318fc Do not emit type errors on recovered blocks
When a parse error occurs on a block, the parser will recover and create
a block with the statements collected until that point. Now a flag
stating that a recovery has been performed in this block is propagated
so that the type checker knows that the type of the block (which will be
identified as `()`) shouldn't be checked against the expectation to
reduce the amount of irrelevant diagnostic errors shown to the user.
2017-12-21 14:57:42 -08:00
kennytm
0787ad9261
Rollup merge of #46918 - alexcrichton:fix-ordering, r=michaelwoerister
rustc: Sort CGUs before merging

This commit fixes some nondeterminism in compilation when using multiple codegen
units. The algorithm for splitting codegen units currently takes the
otherwise-would-be-for-incremental partitioning and then continuously merges the
two smallest codegen units until the desired number of codegen units are
reached.

We want to be sure to merge the same codegen units each time a compilation is
run but there's some subtle reorderings amongst all the items which was causing
this step to be slightly buggy. Notably this step involves sorting codegen units
by size, but if two codegen units had the same size they would appear in
different locations in the list each time.

This commit fixes this issue by sorting codegen units by name before doing the
loop to merge the two smallest. This means that we've got a deterministic
order going in and since we're using a stable sort this should mean that we're
always now getting a deterministic merging of codegen units.

Closes #46846
2017-12-22 05:00:41 +08:00
bors
250b492052 Auto merge of #45930 - jplatte:generics_refactoring, r=eddyb
Generics refactoring (groundwork for const generics)

These changes were suggested by @eddyb.

After this change, the `Generics` contain one `Vec` of an enum for the generic parameters, rather than two separate `Vec`s for lifetime and type parameters. Type params and const params will need to be in a shared `Vec` to preserve their ordering, and moving lifetimes into the same `Vec` should simplify the code that processes `Generics`.
2017-12-21 20:12:13 +00:00
kennytm
b60e6f8285 Rollup merge of #46898 - tspiteri:int-overflow-not-underflow, r=steveklabnik
docs: do not call integer overflows as underflows

In the API docs, integer overflow is sometimes called underflow. Underflow is really when the magnitude of a floating-point number is too small so the number underflows to subnormal or zero. With integers it is always overflow, even if the expected result is less than the minimum number that can be represented.
2017-12-22 02:50:57 +08:00
kennytm
8acc406cf6 Rollup merge of #46890 - arielb1:contributing-improvements, r=steveklabnik
A few small improvements to the contributing docs

r? @steveklabnik
2017-12-22 02:50:56 +08:00
kennytm
7767d84a68 Rollup merge of #46884 - Manishearth:vec-docs, r=steveklabnik
Clarify vec docs on deallocation (fixes #46879)

r? @steveklabnik
2017-12-22 02:50:55 +08:00
kennytm
4802a85392 Rollup merge of #46878 - malbarbo:fix-armv5te, r=alexcrichton
Update compiler_builtins

Fixes https://github.com/rust-lang/rust/issues/46822 (See https://github.com/rust-lang-nursery/compiler-builtins/pull/218)
2017-12-22 02:50:54 +08:00
kennytm
696e951fe9 Rollup merge of #46858 - QuietMisdreavus:external-doc-error, r=estebank
tweaks and fixes for doc(include)

This PR makes a handful of changes around `#[doc(include="file.md")]` (https://github.com/rust-lang/rust/issues/44732):

* Turns errors when loading files into full errors. This matches the original RFC text.
* Makes the `missing_docs` lint check for `#[doc(include="file.md")]` as well as regular `#[doc="text"]` attributes.
* Loads files included by `#[doc(include="file.md")]` into dep-info, mirroring the behavior of `include_str!()` and friends.
* Adds or modifies tests to check for all of these.
2017-12-22 02:50:53 +08:00
kennytm
256bf2be62 Rollup merge of #46847 - GuillaumeGomez:more-sidebar-escape, r=QuietMisdreavus
Escape more items in the sidebar when needed

Fixes #46724.

r? @QuietMisdreavus
2017-12-22 02:50:52 +08:00
kennytm
614e285fa9 Rollup merge of #46839 - michaelwoerister:faster-span-hashing-2, r=nikomatsakis
incr.comp.: Precompute small hash for filenames to save some work.

For each span we hash the filename of the file it points to. Since filenames can be quite long, especially with absolute paths, this PR pre-computes a hash of the filename and we then only hash the hash.

r? @nikomatsakis
2017-12-22 02:50:51 +08:00