]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agorustdoc: Add missing src links for generic impls on trait pages
Oliver Middleton [Wed, 27 Dec 2017 23:39:25 +0000 (23:39 +0000)]
rustdoc: Add missing src links for generic impls on trait pages

`implementor2item` would return `None` for generic impls so instead this clones the entire `clean::Item` into the `implementors` map which simplifies some code.

6 years agoAuto merge of #46941 - ScottAbbey:freebsd-build-update, r=alexcrichton
bors [Tue, 26 Dec 2017 11:16:12 +0000 (11:16 +0000)]
Auto merge of #46941 - ScottAbbey:freebsd-build-update, r=alexcrichton

Re-do the FreeBSD cross-builds to use Clang and libc++. Fixes #44433

Reviving #45077, from @jld:

> 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.

#45077 was close but didn't quite make it.  I rebased @jld's work off the current `master` and started with that.

I was able to determine that this Travis error (https://github.com/rust-lang/rust/pull/45077#issuecomment-336029862) was ultimately caused by `src/librustc_llvm/build.rs` attempting to follow a wrong value in `LLVM_STATIC_STDCPP` (https://github.com/rust-lang/rust/pull/45077#issuecomment-352639456).

I looked at the downstream port for FreeBSD (https://svnweb.freebsd.org/ports/head/lang/rust/) and it seems like they do not use `--enable-llvm-static-stdcpp`.

Since `libc++` is included in the FreeBSD 10+ base system, we don't need to statically link it either?

So in b989428f7dec7b52d68bed6a21e9b5b0a8086267 I have set the FreeBSD build to not actually use `LLVM_STATIC_STDCPP`.

I was able to run `./src/ci/docker/run.sh` with both `dist-i686-freebsd` and `dist-x86_64-freebsd` successfully and in about 1 minute of testing it seemed like the dist-x86_64-freebsd results worked on a FreeBSD 11 system.

It should fix #44433, which seems to be affecting many potential users.  Also FreeBSD users should be able to `./x.py build` which should help anyone who wants to upstream fixes for FreeBSD.

Questions:

Does this approach seem to be the right way to go? Do we actually really want to statically link `libc++`? (I tried that here, but it ultimately ran into a roadblock on x86_64: https://github.com/rust-lang/rust/pull/45077#issuecomment-353293414)

Can we rewrite the comment here to be more clear about why some systems aren't going to actually use this option:
https://github.com/rust-lang/rust/blob/b989428f7dec7b52d68bed6a21e9b5b0a8086267/src/bootstrap/compile.rs#L550-L553

How does this affect users of older FreeBSD systems? It seemed like no one was complaining about using a 10.3 base version in the thread for #45077.  FreeBSD seems to only officially support 10.3, 10.4, and 11.x right now, do we have to consider older users? The `libc++` stuff came in for FreeBSD 10, older FreeBSD used `libstdc++`.

Looks like @alexcrichton was leading the discussion on the previous issue:

r? @alexcrichton

Let me know what I can do to help get this through.

6 years agoAuto merge of #47012 - kennytm:rollup, r=kennytm
bors [Tue, 26 Dec 2017 08:33:23 +0000 (08:33 +0000)]
Auto merge of #47012 - kennytm:rollup, r=kennytm

Rollup of 8 pull requests

- Successful merges: #46928, #46930, #46933, #46939, #46940, #46943, #46979, #46986
- Failed merges:

6 years agoRollup merge of #46986 - nvzqz:basic-usage, r=steveklabnik
kennytm [Tue, 26 Dec 2017 07:19:00 +0000 (15:19 +0800)]
Rollup merge of #46986 - nvzqz:basic-usage, r=steveklabnik

Add "Basic Usage" to int min_value and max_value docs

This adds "Basic Usage:" to the docs of `min_value` and `max_value`, which makes it consistent with docs of other integer methods.

6 years agoRollup merge of #46979 - clarcharr:rustc_docs, r=arielb1
kennytm [Tue, 26 Dec 2017 07:18:59 +0000 (15:18 +0800)]
Rollup merge of #46979 - clarcharr:rustc_docs, r=arielb1

Make internal docs build properly.

`'1` isn't a valid lifetime and resulted in a syntax error.

6 years agoRollup merge of #46943 - malbarbo:process-test-busybox, r=alexcrichton
kennytm [Tue, 26 Dec 2017 07:18:59 +0000 (15:18 +0800)]
Rollup merge of #46943 - malbarbo:process-test-busybox, r=alexcrichton

Fix process test when using busybox mkdir

busybox mkdir . returns 0
busybox mkdir ./ returns 1

6 years agoRollup merge of #46940 - EdSchouten:cloudabi, r=alexcrichton
kennytm [Tue, 26 Dec 2017 07:18:58 +0000 (15:18 +0800)]
Rollup merge of #46940 - EdSchouten:cloudabi, r=alexcrichton

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/

6 years agoRollup merge of #46939 - davidalber:code-of-conduct-mod-team-link, r=kennytm
kennytm [Tue, 26 Dec 2017 07:18:57 +0000 (15:18 +0800)]
Rollup merge of #46939 - davidalber:code-of-conduct-mod-team-link, r=kennytm

Fixing Rust Moderation Team link in Code of Conduct

The [Code of Conduct](https://github.com/rust-lang/rust/blob/master/CODE_OF_CONDUCT.md) has two broken links to the Rust Moderation Team.
- The current link is https://github.com/rust-lang/rust/blob/master/team.html#Moderation. That happened because the link is relative.
- The link in this PR is https://www.rust-lang.org/team.html#Moderation-team. Note: at the moment this is redirected client-side to a language-specific page and loses the fragment identifier. rust-lang/rust-www#992 aims to correct that.

6 years agoRollup merge of #46933 - clarcharr:float_docs, r=steveklabnik
kennytm [Tue, 26 Dec 2017 07:18:56 +0000 (15:18 +0800)]
Rollup merge of #46933 - clarcharr:float_docs, r=steveklabnik

Make core::f32/f64 docs match std.

For some reason these weren't in sync.

6 years agoRollup merge of #46930 - lucis-fluxum:patch-1, r=QuietMisdreavus
kennytm [Tue, 26 Dec 2017 07:18:55 +0000 (15:18 +0800)]
Rollup merge of #46930 - lucis-fluxum:patch-1, r=QuietMisdreavus

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.

6 years agoRollup merge of #46928 - varkor:contrib-10, r=alexcrichton
kennytm [Tue, 26 Dec 2017 07:18:53 +0000 (15:18 +0800)]
Rollup merge of #46928 - varkor:contrib-10, r=alexcrichton

Correct the return type for `x86_mm256_sad_epu8`

Fixes #43439.

6 years agoAuto merge of #47000 - kennytm:follow-up-46924, r=arielb1
bors [Tue, 26 Dec 2017 05:46:11 +0000 (05:46 +0000)]
Auto merge of #47000 - kennytm:follow-up-46924, r=arielb1

Follow up to #46924, fix massive spurious failure when starting docker

It seems using `fe80::/64` causes `docker start` to fail with "Address already in use". Try to change to a unique local address range instead.

`fe80::/64` is a link-local address (similar to `169.254.0.0/16` in IPv4). Let's try to use a random "private network" address to see whether that fixes things.

cc #47002

r? @aidanhs

6 years agoMake internal docs build properly.
Clar Charr [Sun, 24 Dec 2017 03:03:04 +0000 (22:03 -0500)]
Make internal docs build properly.

6 years agoAuto merge of #46973 - arielb1:tuple-casting, r=estebank
bors [Mon, 25 Dec 2017 23:00:39 +0000 (23:00 +0000)]
Auto merge of #46973 - arielb1:tuple-casting, r=estebank

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.

Fixes #33690.
Fixes #46365.
Fixes #46880.

6 years agoFollow up to #46924
kennytm [Mon, 25 Dec 2017 18:36:17 +0000 (02:36 +0800)]
Follow up to #46924

It seems using `fe80::/64` causes `docker start` to fail with "Address
already in use". Try to change to a unique local address range instead.

6 years agoAuto merge of #46971 - green-s:master, r=alexcrichton
bors [Mon, 25 Dec 2017 12:55:52 +0000 (12:55 +0000)]
Auto merge of #46971 - green-s:master, r=alexcrichton

Update compiler_builtins

Fixes #46822 (see https://github.com/rust-lang-nursery/compiler-builtins/pull/219)

6 years agoAuto merge of #46949 - davidtwco:issue-46631, r=arielb1
bors [Mon, 25 Dec 2017 10:07:28 +0000 (10:07 +0000)]
Auto merge of #46949 - davidtwco:issue-46631, r=arielb1

MIR borrowck: no "move occurs because `X` is not Copy` error

Fixes #46631.

r? @arielb1

6 years agoAuto merge of #46924 - kennytm:revert-46694, r=aidanhs
bors [Mon, 25 Dec 2017 07:29:16 +0000 (07:29 +0000)]
Auto merge of #46924 - kennytm:revert-46694, r=aidanhs

Revert #46694 (Temporarily use the old Travis image)

This PR reverts #46694, and applies the solution recommended in https://github.com/travis-ci/travis-ci/issues/8891#issuecomment-353403729.

r? @aidanhs

6 years agoAuto merge of #46914 - mikeyhew:raw_pointer_self, r=arielb1
bors [Mon, 25 Dec 2017 04:55:57 +0000 (04:55 +0000)]
Auto merge of #46914 - mikeyhew:raw_pointer_self, r=arielb1

Convert warning about `*const _` to a future-compat lint

#46664 was merged before I could convert the soft warning about method lookup on `*const _` into a future-compatibility lint. This PR makes that change.

fixes #46837
tracking issue for the future-compatibility lint: #46906

r? @arielb1

6 years agoAuto merge of #46910 - alexcrichton:thinlto-default, r=michaelwoerister
bors [Mon, 25 Dec 2017 02:14:35 +0000 (02:14 +0000)]
Auto merge of #46910 - alexcrichton:thinlto-default, r=michaelwoerister

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

6 years agoAuto merge of #46899 - m4b:linkage_name_equals_symbol_name, r=michaelwoerister
bors [Sun, 24 Dec 2017 23:35:19 +0000 (23:35 +0000)]
Auto merge of #46899 - m4b:linkage_name_equals_symbol_name, r=michaelwoerister

Set the dwarf linkage_name to the mangled name

ref #46453

@michaelwoerister or anyone else who knows, i'm not sure if this is the correct instance to pass here (or how to get the correct one precisely): https://github.com//m4b/rust/blob/5a94a48678ec0a20ea6a63a783e63546bf9459b1/src/librustc_trans/debuginfo/namespace.rs#L36

So don't merge this yet, I'd like to learn about correct instance first; however, I think this already fixes a bunch of weirdness i'm seeing debugging from time to time, not to mention backtraces in gdb via `bt` are now ~readable~ meaningful :tada:

E.g.:

new:
```
(gdb) bt
#0  <inline::Foo as core::convert::From<()>>::from () at /home/m4b/tmp/bad_debug/inline.rs:11
#1  0x000055555555a35d in inline::deadbeef () at /home/m4b/tmp/bad_debug/inline.rs:16
#2  0x000055555555a380 in inline::main () at /home/m4b/tmp/bad_debug/inline.rs:20
```

old:
```
(gdb) bt
#0  inline::{{impl}}::from () at /home/m4b/tmp/bad_debug/inline.rs:11
#1  0x000055555555b0ed in inline::deadbeef () at /home/m4b/tmp/bad_debug/inline.rs:16
#2  0x000055555555b120 in inline::main () at /home/m4b/tmp/bad_debug/inline.rs:20
```

6 years agoAuto merge of #46789 - Diggsey:command-env-capture, r=dtolnay
bors [Sun, 24 Dec 2017 20:57:20 +0000 (20:57 +0000)]
Auto merge of #46789 - Diggsey:command-env-capture, r=dtolnay

Capture `Command` environment at spawn

Fixes #28975

This tracks a set of changes to the environment and then replays them at spawn time.

6 years agoAdd "Basic Usage" to int min_value, max_value docs
Nikolai Vazquez [Sun, 24 Dec 2017 19:01:48 +0000 (14:01 -0500)]
Add "Basic Usage" to int min_value, max_value docs

6 years agoAuto merge of #46630 - alexcrichton:update-git2, r=nikomatsakis
bors [Sun, 24 Dec 2017 18:05:00 +0000 (18:05 +0000)]
Auto merge of #46630 - alexcrichton:update-git2, r=nikomatsakis

Update Cargo and its dependencies

Just a routine update!

6 years agoUpdate Cargo and its dependencies
Alex Crichton [Sun, 10 Dec 2017 17:42:49 +0000 (09:42 -0800)]
Update Cargo and its dependencies

Just a routine update!

6 years agoAuto merge of #46896 - arielb1:shadow-scope, r=eddyb
bors [Sun, 24 Dec 2017 15:26:17 +0000 (15:26 +0000)]
Auto merge of #46896 - arielb1:shadow-scope, r=eddyb

fix debuginfo scoping of let-statements

r? @eddyb

6 years agoCapture environment at spawn
Diggory Blake [Sun, 17 Dec 2017 15:21:47 +0000 (15:21 +0000)]
Capture environment at spawn

6 years agoAuto merge of #46894 - detrumi:fix-const-eval-trait, r=eddyb
bors [Sun, 24 Dec 2017 12:48:57 +0000 (12:48 +0000)]
Auto merge of #46894 - detrumi:fix-const-eval-trait, r=eddyb

Const-eval array lengths in rustdoc.

Fixes #46727
r? @eddyb

Big thanks to @eddyb for helping me figure this out.

6 years agoAuto merge of #46859 - gereeter:uninhabited-unions, r=eddyb
bors [Sun, 24 Dec 2017 10:07:22 +0000 (10:07 +0000)]
Auto merge of #46859 - gereeter:uninhabited-unions, r=eddyb

Only mark unions as uninhabited if all of their fields are uninhabited

Fixes #46845.

6 years agoHandle casts to integer/float variables
Ariel Ben-Yehuda [Sun, 24 Dec 2017 09:40:54 +0000 (11:40 +0200)]
Handle casts to integer/float variables

These can happen if prior errors disable defaulting.

Fixes #43825.

6 years agoAuto merge of #46888 - cramertj:nested-impl-trait-error, r=nikomatsakis
bors [Sun, 24 Dec 2017 07:34:13 +0000 (07:34 +0000)]
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

6 years agoAuto merge of #46833 - diwic:7c-abort-ffi, r=arielb1
bors [Sun, 24 Dec 2017 02:42:15 +0000 (02:42 +0000)]
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.

6 years agoRemove unnecessary assert that unions have only one variant
Jonathan S [Sun, 24 Dec 2017 02:38:36 +0000 (20:38 -0600)]
Remove unnecessary assert that unions have only one variant

6 years agorustc: Set release mode cgus to 16 by default
Alex Crichton [Thu, 21 Dec 2017 15:03:16 +0000 (07:03 -0800)]
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

6 years agoAuto merge of #46881 - michaelwoerister:ensure-coherence, r=nikomatsakis
bors [Sat, 23 Dec 2017 23:06:13 +0000 (23:06 +0000)]
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

6 years agoUpdate check::cast::pointer_kind logic to new rustc
Ariel Ben-Yehuda [Sat, 23 Dec 2017 21:38:09 +0000 (23:38 +0200)]
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.

6 years agoUpdate compiler_builtins
Sam Green [Sat, 23 Dec 2017 19:03:54 +0000 (19:03 +0000)]
Update compiler_builtins

6 years agofix doctests in libcore
Michael Hewson [Sat, 23 Dec 2017 17:36:04 +0000 (12:36 -0500)]
fix doctests in libcore

6 years agoTestcase for const-eval array lengths
Wilco Kusee [Sat, 23 Dec 2017 10:16:03 +0000 (11:16 +0100)]
Testcase for const-eval array lengths

6 years agoEnable IPv6 support in Dockers to workaround travis-ci/travis-ci#8891.
kennytm [Thu, 21 Dec 2017 19:14:21 +0000 (03:14 +0800)]
Enable IPv6 support in Dockers to workaround travis-ci/travis-ci#8891.

6 years agoRevert "Temporarily use the old Travis image."
kennytm [Thu, 21 Dec 2017 19:10:51 +0000 (03:10 +0800)]
Revert "Temporarily use the old Travis image."

This reverts commit c0c26a649e7c970203f6d23ac5c9e017a42d9b0c.

6 years agoAnnotate raw pointer target types
Christopher Durham [Sat, 23 Dec 2017 08:47:13 +0000 (03:47 -0500)]
Annotate raw pointer target types

cc https://github.com/rust-lang/rust/issues/46906
cc https://github.com/rust-lang/rust/pull/46914

6 years agoAuto merge of #46864 - estebank:closure-type-err-sp, r=nikomatsakis
bors [Sat, 23 Dec 2017 04:40:39 +0000 (04:40 +0000)]
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.

6 years agoAuto merge of #46857 - estebank:use-loop-sp, r=nikomatsakis
bors [Sat, 23 Dec 2017 02:08:27 +0000 (02:08 +0000)]
Auto merge of #46857 - estebank:use-loop-sp, r=nikomatsakis

Point at `while true` span instead of entire block

6 years agoAuto merge of #46842 - michaelwoerister:fingerprint-vec, r=nikomatsakis
bors [Fri, 22 Dec 2017 23:34:29 +0000 (23:34 +0000)]
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

6 years agofix errors in rustc_data_structures
Michael Hewson [Fri, 22 Dec 2017 23:16:19 +0000 (18:16 -0500)]
fix errors in rustc_data_structures

6 years agofix some errors in libstd
Michael Hewson [Fri, 22 Dec 2017 17:40:39 +0000 (12:40 -0500)]
fix some errors in libstd

6 years agoAuto merge of #46838 - pnkfelix:issue-46112-followup, r=estebank
bors [Fri, 22 Dec 2017 16:02:31 +0000 (16:02 +0000)]
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).

6 years agoUpdated existing tests.
David Wood [Fri, 22 Dec 2017 15:48:56 +0000 (15:48 +0000)]
Updated existing tests.

6 years agoAdded 'move occurs because `X` is not `Copy`' note.
David Wood [Fri, 22 Dec 2017 15:00:26 +0000 (15:00 +0000)]
Added 'move occurs because `X` is not `Copy`' note.

6 years agoConverted moves-based-on-type-tuple test and added MIR borrowck comparison.
David Wood [Thu, 21 Dec 2017 18:56:48 +0000 (18:56 +0000)]
Converted moves-based-on-type-tuple test and added MIR borrowck comparison.

6 years agoAuto merge of #46779 - Zoxc:par-merge-without-sync, r=arielb1
bors [Fri, 22 Dec 2017 12:34:45 +0000 (12:34 +0000)]
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.

6 years agoConvert warning about `*const _` to a future-compat lint
Michael Hewson [Thu, 21 Dec 2017 16:20:53 +0000 (11:20 -0500)]
Convert warning about `*const _` to a future-compat lint

6 years agoFix process test when using busybox mkdir
Marco A L Barbosa [Fri, 22 Dec 2017 10:11:34 +0000 (08:11 -0200)]
Fix process test when using busybox mkdir

busybox mkdir . returns 0
busybox mkdir ./ returns 1

6 years agoAuto merge of #46752 - Yoric:nll, r=arielb1
bors [Fri, 22 Dec 2017 09:54:21 +0000 (09:54 +0000)]
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.

6 years agoAdd CloudABI to the list of supported targets.
Ed Schouten [Fri, 22 Dec 2017 08:39:40 +0000 (09:39 +0100)]
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.

6 years agoAdd support for CloudABI targets to the rustc backend.
Ed Schouten [Fri, 22 Dec 2017 08:37:02 +0000 (09:37 +0100)]
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/

6 years agoDon't try to statically link libstdc++ on FreeBSD
Scott Abbey [Fri, 22 Dec 2017 03:43:16 +0000 (21:43 -0600)]
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.

6 years agoRe-do the FreeBSD cross-builds to use Clang and libc++. Fixes #44433.
Jed Davis [Sat, 16 Sep 2017 03:14:34 +0000 (21:14 -0600)]
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.

6 years agoFixing Rust Moderation Team link
David Alber [Fri, 22 Dec 2017 06:53:50 +0000 (22:53 -0800)]
Fixing Rust Moderation Team link

6 years agoAuto merge of #46732 - estebank:silence-recovered-blocks, r=petrochenkov
bors [Fri, 22 Dec 2017 07:22:33 +0000 (07:22 +0000)]
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.

6 years agoMake core::f32/f64 docs match std.
Clar Charr [Fri, 22 Dec 2017 01:29:14 +0000 (20:29 -0500)]
Make core::f32/f64 docs match std.

6 years agoClarify docs for split_at_mut
Luc Street [Thu, 21 Dec 2017 23:22:36 +0000 (15:22 -0800)]
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.

6 years agoMark clippy as broken
Esteban Küber [Thu, 21 Dec 2017 23:09:26 +0000 (15:09 -0800)]
Mark clippy as broken

6 years agoAuto merge of #46922 - kennytm:rollup, r=kennytm
bors [Thu, 21 Dec 2017 23:01:27 +0000 (23:01 +0000)]
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:

6 years agoCorrect the return type for `x86_mm256_sad_epu8`
varkor [Thu, 21 Dec 2017 22:58:03 +0000 (22:58 +0000)]
Correct the return type for `x86_mm256_sad_epu8`

Fixes #43439.

6 years agoDo not emit type errors on recovered blocks
Esteban Küber [Thu, 14 Dec 2017 07:05:49 +0000 (23:05 -0800)]
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.

6 years agoRollup merge of #46918 - alexcrichton:fix-ordering, r=michaelwoerister
kennytm [Thu, 21 Dec 2017 18:50:59 +0000 (02:50 +0800)]
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

6 years agoAuto merge of #45930 - jplatte:generics_refactoring, r=eddyb
bors [Thu, 21 Dec 2017 20:12:13 +0000 (20:12 +0000)]
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`.

6 years agoRollup merge of #46898 - tspiteri:int-overflow-not-underflow, r=steveklabnik
kennytm [Thu, 21 Dec 2017 18:50:57 +0000 (02:50 +0800)]
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.

6 years agoRollup merge of #46890 - arielb1:contributing-improvements, r=steveklabnik
kennytm [Thu, 21 Dec 2017 18:50:56 +0000 (02:50 +0800)]
Rollup merge of #46890 - arielb1:contributing-improvements, r=steveklabnik

A few small improvements to the contributing docs

r? @steveklabnik

6 years agoRollup merge of #46884 - Manishearth:vec-docs, r=steveklabnik
kennytm [Thu, 21 Dec 2017 18:50:55 +0000 (02:50 +0800)]
Rollup merge of #46884 - Manishearth:vec-docs, r=steveklabnik

Clarify vec docs on deallocation (fixes #46879)

r? @steveklabnik

6 years agoRollup merge of #46878 - malbarbo:fix-armv5te, r=alexcrichton
kennytm [Thu, 21 Dec 2017 18:50:54 +0000 (02:50 +0800)]
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)

6 years agoRollup merge of #46858 - QuietMisdreavus:external-doc-error, r=estebank
kennytm [Thu, 21 Dec 2017 18:50:53 +0000 (02:50 +0800)]
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.

6 years agoRollup merge of #46847 - GuillaumeGomez:more-sidebar-escape, r=QuietMisdreavus
kennytm [Thu, 21 Dec 2017 18:50:52 +0000 (02:50 +0800)]
Rollup merge of #46847 - GuillaumeGomez:more-sidebar-escape, r=QuietMisdreavus

Escape more items in the sidebar when needed

Fixes #46724.

r? @QuietMisdreavus

6 years agoRollup merge of #46839 - michaelwoerister:faster-span-hashing-2, r=nikomatsakis
kennytm [Thu, 21 Dec 2017 18:50:51 +0000 (02:50 +0800)]
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

6 years agoRollup merge of #46820 - nodakai:simplify-int-impl, r=alexcrichton
kennytm [Thu, 21 Dec 2017 18:50:50 +0000 (02:50 +0800)]
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.

6 years agoRollup merge of #46814 - varkor:contrib-7, r=alexcrichton
kennytm [Thu, 21 Dec 2017 18:50:49 +0000 (02:50 +0800)]
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.

6 years agoRollup merge of #46809 - eddyb:issue-46769-optimal, r=arielb1
kennytm [Thu, 21 Dec 2017 18:50:49 +0000 (02:50 +0800)]
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).

6 years agoRollup merge of #46784 - bjorn3:patch-1, r=pnkfelix
kennytm [Thu, 21 Dec 2017 18:50:48 +0000 (02:50 +0800)]
Rollup merge of #46784 - bjorn3:patch-1, r=pnkfelix

Cleanup for libgraphviz

6 years agoRollup merge of #46780 - varkor:contrib-5, r=arielb1
kennytm [Thu, 21 Dec 2017 18:50:47 +0000 (02:50 +0800)]
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.

6 years agoRollup merge of #46636 - frewsxcv:frewsxcv-fn-box, r=estebank
kennytm [Thu, 21 Dec 2017 18:50:45 +0000 (02:50 +0800)]
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.

6 years agoMir: fixup nits in previous commit (f536143)
David Henningsson [Thu, 21 Dec 2017 18:32:26 +0000 (19:32 +0100)]
Mir: fixup nits in previous commit (f536143)

As suggested by arielb1.

Closes rust-lang/rust#18510

Signed-off-by: David Henningsson <diwic@ubuntu.com>
6 years agoAdd Encodable and Decodable impls for Arc<[T]>
John Kåre Alsaker [Sun, 3 Dec 2017 13:31:27 +0000 (14:31 +0100)]
Add Encodable and Decodable impls for Arc<[T]>

6 years agoRemove useless Rc
John Kåre Alsaker [Sun, 3 Dec 2017 13:25:09 +0000 (14:25 +0100)]
Remove useless Rc

6 years agoMake IndexVec implement Send and Sync
John Kåre Alsaker [Sun, 3 Dec 2017 13:22:23 +0000 (14:22 +0100)]
Make IndexVec implement Send and Sync

6 years agoAdd a -Z query-threads compiler option
John Kåre Alsaker [Sun, 3 Dec 2017 13:16:19 +0000 (14:16 +0100)]
Add a -Z query-threads compiler option

6 years agoRefactor code so the call to codemap.files() does not deadlock
John Kåre Alsaker [Sun, 3 Dec 2017 13:08:21 +0000 (14:08 +0100)]
Refactor code so the call to codemap.files() does not deadlock

6 years agoMake err_count thread safe
John Kåre Alsaker [Sun, 3 Dec 2017 13:04:51 +0000 (14:04 +0100)]
Make err_count thread safe

6 years agoMake mk_attr_id thread safe
John Kåre Alsaker [Sun, 3 Dec 2017 13:03:28 +0000 (14:03 +0100)]
Make mk_attr_id thread safe

6 years agoCombine GlobalArenas and DroplessArena into AllArenas
John Kåre Alsaker [Sun, 3 Dec 2017 12:57:25 +0000 (13:57 +0100)]
Combine GlobalArenas and DroplessArena into AllArenas

6 years agoIssue #46589 - Kill borrows on a local variable whenever we assign over this variable
David Teller [Fri, 15 Dec 2017 20:27:06 +0000 (14:27 -0600)]
Issue #46589 - Kill borrows on a local variable whenever we assign over this variable

6 years agoAdd a feature gate for nested uses of `impl Trait`
Taylor Cramer [Wed, 20 Dec 2017 18:18:37 +0000 (10:18 -0800)]
Add a feature gate for nested uses of `impl Trait`

6 years agorustc: Sort CGUs before merging
Alex Crichton [Thu, 21 Dec 2017 17:00:55 +0000 (09:00 -0800)]
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

6 years agoAuto merge of #46877 - Deewiant:gh46843, r=eddyb
bors [Thu, 21 Dec 2017 16:15:16 +0000 (16:15 +0000)]
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.

6 years agoAuto merge of #46904 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Thu, 21 Dec 2017 13:34:09 +0000 (13:34 +0000)]
Auto merge of #46904 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 5 pull requests

- Successful merges: #46827, #46853, #46860, #46861, #46887
- Failed merges:

6 years agoAdd GenericParam, refactor Generics in ast, hir, rustdoc
Jonas Platte [Mon, 16 Oct 2017 19:07:26 +0000 (21:07 +0200)]
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.

6 years agofix debuginfo scoping of let-statements
Ariel Ben-Yehuda [Wed, 20 Dec 2017 22:35:19 +0000 (00:35 +0200)]
fix debuginfo scoping of let-statements

6 years agoRollup merge of #46887 - pnkfelix:ensure-activations-are-from-assignments-to-locals...
Guillaume Gomez [Thu, 21 Dec 2017 12:18:21 +0000 (13:18 +0100)]
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.)

6 years agoRollup merge of #46861 - GuillaumeGomez:fix-ios-sidebar, r=QuietMisdreavus
Guillaume Gomez [Thu, 21 Dec 2017 12:18:21 +0000 (13:18 +0100)]
Rollup merge of #46861 - GuillaumeGomez:fix-ios-sidebar, r=QuietMisdreavus

Fix sidebar on ios

r? @QuietMisdreavus