Commit Graph

72977 Commits

Author SHA1 Message Date
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
kennytm
dc00aa4983 Rollup merge of #46820 - nodakai:simplify-int-impl, r=alexcrichton
libcore/num/mod.rs: simplify the int_impl! macro.

We can simply use generic intrinsics since cd1848a1a6 by @alexcrichton

Also, minimize unsafe blocks.
2017-12-22 02:50:50 +08:00
kennytm
0ee069c70a Rollup merge of #46814 - varkor:contrib-7, r=alexcrichton
Prevent rustc overwriting input files

If rustc is invoked on a file that would be overwritten by the
compilation, the compilation now fails, to avoid accidental loss. This
resolves #13019. Kudos to @estebank, whose patch I finished off.
2017-12-22 02:50:49 +08:00
kennytm
d4981e9742 Rollup merge of #46809 - eddyb:issue-46769-optimal, r=arielb1
rustc: do not raise the alignment of optimized enums to the niche's alignment.

This is the improved fix for #46769 that does not increase the size of any types (see also #46808).
2017-12-22 02:50:49 +08:00
kennytm
9341321be4 Rollup merge of #46784 - bjorn3:patch-1, r=pnkfelix
Cleanup for libgraphviz
2017-12-22 02:50:48 +08:00
kennytm
44670448b2 Rollup merge of #46780 - varkor:contrib-5, r=arielb1
Fix ICE when calling non-functions within closures

The visitor for walking function bodies did not previously properly
handle error-cases for function calls. These are now ignored,
preventing the panic. This fixes #46771.
2017-12-22 02:50:47 +08:00
kennytm
71c6d23612 Rollup merge of #46636 - frewsxcv:frewsxcv-fn-box, r=estebank
Replace libtest/lib.rs:FnBox with std::boxed::FnBox.

Fixes https://github.com/rust-lang/rust/issues/41810.
2017-12-22 02:50:45 +08:00
David Henningsson
4910ed2b1e Mir: fixup nits in previous commit (f536143)
As suggested by arielb1.

Closes rust-lang/rust#18510

Signed-off-by: David Henningsson <diwic@ubuntu.com>
2017-12-21 19:36:53 +01:00
John Kåre Alsaker
84ce4f1c10 Add Encodable and Decodable impls for Arc<[T]> 2017-12-21 19:21:40 +01:00
John Kåre Alsaker
30733b3e68 Remove useless Rc 2017-12-21 19:21:40 +01:00
John Kåre Alsaker
30a39ac5ce Make IndexVec implement Send and Sync 2017-12-21 19:21:40 +01:00
John Kåre Alsaker
aa6065bd70 Add a -Z query-threads compiler option 2017-12-21 19:21:40 +01:00
John Kåre Alsaker
f7082dcafb Refactor code so the call to codemap.files() does not deadlock 2017-12-21 19:21:40 +01:00
John Kåre Alsaker
94b712413b Make err_count thread safe 2017-12-21 19:21:39 +01:00
John Kåre Alsaker
70fd306f3c Make mk_attr_id thread safe 2017-12-21 19:21:39 +01:00
John Kåre Alsaker
d81cd38e30 Combine GlobalArenas and DroplessArena into AllArenas 2017-12-21 19:21:39 +01:00
David Teller
fcb10908b0 Issue #46589 - Kill borrows on a local variable whenever we assign over this variable 2017-12-21 18:35:59 +01:00
Taylor Cramer
c026d19baf Add a feature gate for nested uses of impl Trait 2017-12-21 09:28:29 -08:00
Alex Crichton
427e6308bc 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-21 09:06:52 -08:00
bors
b7b52cc8bf Auto merge of #46877 - Deewiant:gh46843, r=eddyb
MIR: terminate unreachable blocks in construct_const

Fixes #46843.

#45821 added unreachable blocks in matches, which were terminated in
construct_fn but not in construct_const, causing a panic due to "no
terminator on block" when constants involved matching on enums.

The "unimplemented expression type" error may go away in the future, the
key is that we see the E0015 about using a non-const function and then
don't ICE.
2017-12-21 16:15:16 +00:00
bors
eff3de0927 Auto merge of #46904 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 5 pull requests

- Successful merges: #46827, #46853, #46860, #46861, #46887
- Failed merges:
2017-12-21 13:34:09 +00:00
Jonas Platte
78493ed21a Add GenericParam, refactor Generics in ast, hir, rustdoc
The Generics now contain one Vec of an enum for the generic parameters,
rather than two separate Vec's for lifetime and type parameters.

Additionally, places that previously used Vec<LifetimeDef> now use
Vec<GenericParam> instead.
2017-12-21 13:38:10 +01:00
Ariel Ben-Yehuda
9be593032d fix debuginfo scoping of let-statements 2017-12-21 14:25:17 +02:00
Guillaume Gomez
bdd3f5b240 Rollup merge of #46887 - pnkfelix:ensure-activations-are-from-assignments-to-locals, r=arielb1
Ensure separate activations only occur for assignments to locals

Ensure separate activations only occur for assignments to locals, not projections.

Fix #46746.

(I didn't make a regression test because we do not really have a good way to directly express the case that we are trying to catch, because we cannot write MIR directly.)
2017-12-21 13:18:21 +01:00
Guillaume Gomez
1219494f6f Rollup merge of #46861 - GuillaumeGomez:fix-ios-sidebar, r=QuietMisdreavus
Fix sidebar on ios

r? @QuietMisdreavus
2017-12-21 13:18:21 +01:00
Guillaume Gomez
2770fdfaaa Rollup merge of #46860 - estebank:candidate-def-sp, r=petrochenkov
Use def span for associated function suggestions
2017-12-21 13:18:20 +01:00
Guillaume Gomez
365f7574b2 Rollup merge of #46853 - GuillaumeGomez:fix-rustdoc-warning, r=QuietMisdreavus
Fix some rustdoc warnings

r? @QuietMisdreavus

cc @steveklabnik
2017-12-21 13:18:19 +01:00
Guillaume Gomez
2917ac6b59 Rollup merge of #46827 - petrochenkov:assocrecov2, r=estebank
syntax: Follow-up to the incorrect qpath recovery PR

cc https://github.com/rust-lang/rust/pull/46788

Add tests checking that "priority" of qpath recovery is higher than priority of unary and binary operators
Fix regressed parsing of paths with fn-like generic arguments
r? @estebank
2017-12-21 13:18:18 +01:00
Guillaume Gomez
d4424d84fb Escape more items in the sidebar when needed 2017-12-21 13:17:15 +01:00
bors
de38f49528 Auto merge of #46772 - alexcrichton:thinlto-passes, r=michaelwoerister
rustc: Work around `DICompileUnit` bugs in LLVM

This commit implements a workaround for #46346 which basically just
avoids triggering the situation that LLVM's bug
https://bugs.llvm.org/show_bug.cgi?id=35562 arises. More details can be
found in the code itself but this commit is also intended to ...

Closes #46346
2017-12-21 10:56:44 +00:00
bors
ab7abfcf34 Auto merge of #46754 - cramertj:refactor-arg-impl, r=nikomatsakis
Refactor argument-position impl Trait

Fixes https://github.com/rust-lang/rust/issues/46685, https://github.com/rust-lang/rust/issues/46470

r? @nikomatsakis
cc @chrisvittal
2017-12-21 08:04:57 +00:00
m4b
990a5cc1e5 dwarf: set dwarf linkage_name for fns and statics to its mangled symbol name 2017-12-20 21:28:10 -08:00