]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #44940 - philipc:remap-path, r=michaelwoerister
bors [Thu, 5 Oct 2017 05:16:41 +0000 (05:16 +0000)]
Auto merge of #44940 - philipc:remap-path, r=michaelwoerister

Don't use remapped path when loading modules and include files

Fixes bug reported in https://github.com/rust-lang/rust/issues/41555#issuecomment-327866056.

cc @michaelwoerister

6 years agoAuto merge of #44481 - Aaronepower:master, r=alexcrichton
bors [Thu, 5 Oct 2017 02:53:43 +0000 (02:53 +0000)]
Auto merge of #44481 - Aaronepower:master, r=alexcrichton

Updated RELEASES.md for 1.21.0

[Rendered](https://github.com/Aaronepower/rust/blob/master/RELEASES.md)

6 years agoAuto merge of #44901 - michaelwoerister:on-demand-eval, r=nikomatsakis
bors [Wed, 4 Oct 2017 19:14:41 +0000 (19:14 +0000)]
Auto merge of #44901 - michaelwoerister:on-demand-eval, r=nikomatsakis

incr.comp.: Switch to red/green change tracking, remove legacy system.

This PR finally switches incremental compilation to [red/green tracking](https://github.com/rust-lang/rust/issues/42293) and completely removes the legacy dependency graph implementation -- which includes a few quite costly passes that are simply not needed with the new system anymore.

There's still some documentation to be done and there's certainly still lots of optimizing and tuning ahead -- but the foundation for red/green is in place with this PR. This has been in the making for a long time `:)`

r? @nikomatsakis
cc @alexcrichton, @rust-lang/compiler

6 years agoAuto merge of #44890 - nvzqz:str-box-transmute, r=alexcrichton
bors [Wed, 4 Oct 2017 15:14:15 +0000 (15:14 +0000)]
Auto merge of #44890 - nvzqz:str-box-transmute, r=alexcrichton

Remove mem::transmute used in Box<str> conversions

Given that https://github.com/rust-lang/rust/pull/44877 is failing, I decided to make a separate PR. This is done with the same motivation: to avoid `mem::transmute`-ing non `#[repr(C)]` types.

6 years agoAuto merge of #44882 - mikhail-m1:master, r=pnkfelix
bors [Wed, 4 Oct 2017 11:26:12 +0000 (11:26 +0000)]
Auto merge of #44882 - mikhail-m1:master, r=pnkfelix

add notes to report_conflicting_borrow MIR borrowck

part of #44596

6 years agoincr.comp.: Address review comments.
Michael Woerister [Wed, 4 Oct 2017 10:35:56 +0000 (12:35 +0200)]
incr.comp.: Address review comments.

6 years agoadd notes to report_conflicting_borrow MIR borrowck
Mikhail Modin [Wed, 27 Sep 2017 07:01:42 +0000 (10:01 +0300)]
add notes to report_conflicting_borrow MIR borrowck

6 years agoAuto merge of #44905 - Pirh:process_abort_docs, r=steveklabnik
bors [Wed, 4 Oct 2017 05:43:00 +0000 (05:43 +0000)]
Auto merge of #44905 - Pirh:process_abort_docs, r=steveklabnik

Update docs for process::abort

Remove a typo and explain the relationship to `panic!`.

Part of #29370

r? @steveklabnik

6 years agoAuto merge of #44999 - pnkfelix:mir-borrowck-fix-assert-left-right, r=nikomatsakis
bors [Wed, 4 Oct 2017 03:28:24 +0000 (03:28 +0000)]
Auto merge of #44999 - pnkfelix:mir-borrowck-fix-assert-left-right, r=nikomatsakis

Overlapping borrows can point to different lvalues.

Overlapping borrows can point to different lvalues.

There's always a basis for the overlap, so instead of removing the assert entirely, I instead pass in the prefix that we found and check that it actually is a prefix of both lvalues.

Fix #44829

6 years agoAuto merge of #44979 - hinaria:master, r=dtolnay
bors [Wed, 4 Oct 2017 00:57:30 +0000 (00:57 +0000)]
Auto merge of #44979 - hinaria:master, r=dtolnay

make `backtrace = false` compile for windows targets.

when building for windows with `backtrace = false`, `libstd` fails to compile because some modules that use items from `sys_common::backtrace::*` are still included, even though those modules aren't used or referenced by anything.

`sys_common::backtrace` doesn't exist when the backtrace feature is turned off.

--

i've also added `#[cfg(feature = "backtrace")]` to various items that exist exclusively to support `mod backtrace` since the compilation would fail since they would be unused in a configuration with backtraces turned off.

6 years agoAuto merge of #44895 - stephaneyfx:master, r=dtolnay
bors [Tue, 3 Oct 2017 22:19:40 +0000 (22:19 +0000)]
Auto merge of #44895 - stephaneyfx:master, r=dtolnay

Made `fs::copy` return the length of the main stream

On Windows with the NTFS filesystem, `fs::copy` would return the sum of the
lengths of all streams, which can be different from the length reported by
`metadata` and thus confusing for users unaware of this NTFS peculiarity.

This makes `fs::copy` return the same length `metadata` reports which is the
value it used to return before PR #26751. Note that alternate streams are still
copied; their length is just not included in the returned value.

This change relies on the assumption that the stream with index 1 is always the
main stream in the `CopyFileEx` callback. I could not find any official
document confirming this but empirical testing has shown this to be true,
regardless of whether the alternate stream is created before or after the main
stream.

Resolves #44532

6 years agoAuto merge of #44949 - QuietMisdreavus:rustdoctest-dirs, r=nikomatsakis
bors [Tue, 3 Oct 2017 19:38:33 +0000 (19:38 +0000)]
Auto merge of #44949 - QuietMisdreavus:rustdoctest-dirs, r=nikomatsakis

let htmldocck.py check for directories

Since i messed this up during https://github.com/rust-lang/rust/pull/44613, i wanted to codify this into the rustdoc tests to make sure that doesn't happen again.

6 years agoAuto merge of #44922 - zilbuz:issue-44596/E0594, r=pnkfelix
bors [Tue, 3 Oct 2017 16:42:26 +0000 (16:42 +0000)]
Auto merge of #44922 - zilbuz:issue-44596/E0594, r=pnkfelix

MIR borrowck: move span_label to `borrowck_errors.rs`

The calls to `span_label` are moved and factorized for:
* E0503 (`cannot_use_when_mutably_borrowed()`)
* E0506 (`cannot_assign_to_borrowed()`)

Additionnally, the error E0594 (`cannot_assign_static()`) has been factorized between `check_loan.rs` and `borrowc_check.rs`.

Part of #44596

6 years agoAuto merge of #44896 - qmx:move-resolve-to-librustc, r=arielb1
bors [Tue, 3 Oct 2017 12:18:13 +0000 (12:18 +0000)]
Auto merge of #44896 - qmx:move-resolve-to-librustc, r=arielb1

Move monomorphize::resolve() to librustc

this moves `monomorphize::resolve(..)` to librustc, and re-enables inlining for some trait methods, fixing #44389

@nikomatsakis I've kept the calls to the new `ty::Instance::resolve(....)` always `.unwrap()`-ing for the moment, how/do you want to add more debugging info via `.unwrap_or()` or something like this?

we still have some related `resolve_*` functions on monomorphize, but I wasn't sure moving them was into the scope for this PR too.

@eddyb mind to take a look too?

6 years agoOverlapping borrows can point to different lvalues.
Felix S. Klock II [Tue, 3 Oct 2017 12:00:38 +0000 (14:00 +0200)]
Overlapping borrows can point to different lvalues.

There's always a basis for the overlap, so instead of removing the
assert entirely, I instead pass in the prefix that we found and check
that it actually is a prefix of both lvalues.

Fix #44829

6 years agoincr.comp.: Fix some merge fallout.
Michael Woerister [Fri, 29 Sep 2017 09:13:18 +0000 (11:13 +0200)]
incr.comp.: Fix some merge fallout.

6 years agoAdd fixme regarding remapping paths for doctests
Philip Craig [Tue, 3 Oct 2017 10:35:55 +0000 (20:35 +1000)]
Add fixme regarding remapping paths for doctests

6 years agoRename FileMap::path and change to an Option
Philip Craig [Tue, 3 Oct 2017 09:44:58 +0000 (19:44 +1000)]
Rename FileMap::path and change to an Option

6 years agoAuto merge of #44920 - vi:rustdoc_implementors_src_link, r=GuillaumeGomez
bors [Tue, 3 Oct 2017 08:04:33 +0000 (08:04 +0000)]
Auto merge of #44920 - vi:rustdoc_implementors_src_link, r=GuillaumeGomez

 rustdoc: Render [src] links for trait implementors

Should close #43893.

<s>No tests [yet].</s>

r? @QuietMisdreavus

6 years agoAuto merge of #44966 - zackmdavis:no_mangle_no_snake, r=aturon
bors [Tue, 3 Oct 2017 02:26:27 +0000 (02:26 +0000)]
Auto merge of #44966 - zackmdavis:no_mangle_no_snake, r=aturon

make non_snake_case lint allow extern no-mangle functions

Resolves #31924.

r? @sfackler

6 years agoAuto merge of #44977 - steveklabnik:update-mdbook, r=alexcrichton
bors [Mon, 2 Oct 2017 22:39:51 +0000 (22:39 +0000)]
Auto merge of #44977 - steveklabnik:update-mdbook, r=alexcrichton

update mdbook

Fixes #44704

6 years agoDocument that process::abort will not call the panic hook
Pirh [Mon, 2 Oct 2017 18:59:50 +0000 (19:59 +0100)]
Document that process::abort will not call the panic hook

6 years agoAuto merge of #44885 - lu-zero:master, r=alexcrichton
bors [Mon, 2 Oct 2017 17:18:20 +0000 (17:18 +0000)]
Auto merge of #44885 - lu-zero:master, r=alexcrichton

More Altivec Intrinsics

Float-specific intrinsics

6 years agowindows: make `backtrace = false` compile
hinaria [Mon, 2 Oct 2017 15:48:17 +0000 (02:48 +1100)]
windows: make `backtrace = false` compile

6 years agoupdate mdbook
steveklabnik [Mon, 2 Oct 2017 14:16:32 +0000 (10:16 -0400)]
update mdbook

Fixes #44704

6 years agoincr.comp.: Do some cleanup.
Michael Woerister [Thu, 28 Sep 2017 15:07:22 +0000 (17:07 +0200)]
incr.comp.: Do some cleanup.

6 years agoincr.comp.: Remove legacy dep-graph runtime.
Michael Woerister [Thu, 28 Sep 2017 14:19:10 +0000 (16:19 +0200)]
incr.comp.: Remove legacy dep-graph runtime.

6 years agorustdoc: Remove cruft from the test
Vitaly _Vi Shukela [Mon, 2 Oct 2017 13:54:35 +0000 (16:54 +0300)]
rustdoc: Remove cruft from the test

per @GuillaumeGomez's sample, but with one change.

6 years agoincr.comp.: Remove saving and loading of legacy dep-graph.
Michael Woerister [Thu, 28 Sep 2017 13:26:11 +0000 (15:26 +0200)]
incr.comp.: Remove saving and loading of legacy dep-graph.

6 years agoincr.comp.: Build DepGraphQuery from new dep-graph impl.
Michael Woerister [Thu, 28 Sep 2017 11:26:15 +0000 (13:26 +0200)]
incr.comp.: Build DepGraphQuery from new dep-graph impl.

6 years agoincr.comp.: Use red/green tracking for CGU re-use.
Michael Woerister [Thu, 28 Sep 2017 09:58:45 +0000 (11:58 +0200)]
incr.comp.: Use red/green tracking for CGU re-use.

6 years agoincr.comp.: Add some logging to DepGraph::try_mark_green().
Michael Woerister [Wed, 27 Sep 2017 16:42:31 +0000 (18:42 +0200)]
incr.comp.: Add some logging to DepGraph::try_mark_green().

6 years agoincr.comp.: Make some DepNodes non-anonymous.
Michael Woerister [Wed, 27 Sep 2017 16:30:26 +0000 (18:30 +0200)]
incr.comp.: Make some DepNodes non-anonymous.

6 years agoincr.comp.: Re-execute queries during red/green marking in order to find out their...
Michael Woerister [Tue, 26 Sep 2017 17:43:17 +0000 (19:43 +0200)]
incr.comp.: Re-execute queries during red/green marking in order to find out their color.

6 years agoincr.comp.: Add minimal version of try_mark_green procedure.
Michael Woerister [Mon, 25 Sep 2017 11:51:49 +0000 (13:51 +0200)]
incr.comp.: Add minimal version of try_mark_green procedure.

6 years agoincr.comp.: Determine red/green state of every new node.
Michael Woerister [Mon, 25 Sep 2017 10:25:41 +0000 (12:25 +0200)]
incr.comp.: Determine red/green state of every new node.

6 years agoAuto merge of #44959 - arielb1:generic-errors, r=eddyb
bors [Mon, 2 Oct 2017 10:06:32 +0000 (10:06 +0000)]
Auto merge of #44959 - arielb1:generic-errors, r=eddyb

handle nested generics in Generics::type_param/region_param

Fixes #44952.

r? @eddyb

6 years agofix handling of `Self`
Ariel Ben-Yehuda [Mon, 2 Oct 2017 08:43:36 +0000 (10:43 +0200)]
fix handling of `Self`

6 years agoAuto merge of #44942 - zackmdavis:lint_suggestions, r=estebank
bors [Mon, 2 Oct 2017 07:03:26 +0000 (07:03 +0000)]
Auto merge of #44942 - zackmdavis:lint_suggestions, r=estebank

code suggestions for unused-mut, while-true, deprecated-attribute, and unused-parens lints

![lint_suggestions](https://user-images.githubusercontent.com/1076988/31044068-b2074de8-a57c-11e7-9319-6668508b6d1f.png)

r? @estebank

6 years agocorrect unused-parens lint suggestion to strip exact pair
Zack M. Davis [Sat, 30 Sep 2017 07:53:26 +0000 (00:53 -0700)]
correct unused-parens lint suggestion to strip exact pair

6 years agoAuto merge of #44960 - SeanPrashad:master, r=steveklabnik
bors [Mon, 2 Oct 2017 02:17:14 +0000 (02:17 +0000)]
Auto merge of #44960 - SeanPrashad:master, r=steveklabnik

Resolves #36284 - vec.rs documentation

Removed comments associated with `[into_vec]` being equivalent to `[shrink_to_fit]` as requested.

6 years agomake non_snake_case lint allow extern no-mangle functions
Zack M. Davis [Sun, 1 Oct 2017 23:44:33 +0000 (16:44 -0700)]
make non_snake_case lint allow extern no-mangle functions

Resolves #31924.

6 years agoAuto merge of #44955 - laumann:small-typo-fix, r=steveklabnik
bors [Sun, 1 Oct 2017 22:16:04 +0000 (22:16 +0000)]
Auto merge of #44955 - laumann:small-typo-fix, r=steveklabnik

Fix typo: geneartor -> generator

6 years agofix handling of Self
Ariel Ben-Yehuda [Sun, 1 Oct 2017 21:03:48 +0000 (23:03 +0200)]
fix handling of Self

6 years agoAuto merge of #44919 - diwic:79-pretty-mir, r=arielb1
bors [Sun, 1 Oct 2017 19:57:01 +0000 (19:57 +0000)]
Auto merge of #44919 - diwic:79-pretty-mir, r=arielb1

Mir pretty print: Add cleanup comment

I found it useful to add a comment indicating whether or not a
BasicBlock is a cleanup block or not. Hopefully you'll find it
useful too.

6 years agoAuto merge of #44897 - Havvy:doc-size_of, r=steveklabnik
bors [Sun, 1 Oct 2017 17:32:34 +0000 (17:32 +0000)]
Auto merge of #44897 - Havvy:doc-size_of, r=steveklabnik

Docs for size_of::<#[repr(C)]> items.

Most of this info comes from camlorn's blog post on optimizing struct layout and the Rustonomicon.

I don't really like my wording in the first paragraph.

I also cannot find a definition of what `#[repr(C)]` does for enums that have variants with fields. They're allowed, unlike `#[repr(C)] enum`s with no variants.

6 years agoResolves #36284 - vec.rs documentation
Sean Prashad [Sun, 1 Oct 2017 16:15:05 +0000 (12:15 -0400)]
Resolves #36284 - vec.rs documentation

6 years agohandle nested generics in Generics::type_param/region_param
Ariel Ben-Yehuda [Sun, 1 Oct 2017 15:15:15 +0000 (17:15 +0200)]
handle nested generics in Generics::type_param/region_param

Fixes #44952.

6 years agostray comma
Douglas Campos [Sun, 1 Oct 2017 15:14:47 +0000 (11:14 -0400)]
stray comma

6 years agoFix typo: geneartor -> generator
Thomas Jespersen [Sun, 1 Oct 2017 13:40:00 +0000 (15:40 +0200)]
Fix typo: geneartor -> generator

6 years agoAuto merge of #44945 - petrochenkov:fixtyrec, r=arielb1
bors [Sun, 1 Oct 2017 13:26:15 +0000 (13:26 +0000)]
Auto merge of #44945 - petrochenkov:fixtyrec, r=arielb1

Do not require semantic types for all syntactic types when there are errors

Fixes https://github.com/rust-lang/rust/issues/44814
Fixes https://github.com/rust-lang/rust/issues/44858
Fixes https://github.com/rust-lang/rust/issues/44946
r? @nikomatsakis

6 years agorustdoc: Style of [src] link for trait implementors
Vitaly _Vi Shukela [Sun, 1 Oct 2017 12:54:50 +0000 (15:54 +0300)]
rustdoc: Style of [src] link for trait implementors

A change suggested by @GuillaumeGomez and @QuietMisdreavus.

Also slight reindenting of the appropriate CSS section.

6 years agoAuto merge of #44906 - dkl:main-signature, r=nagisa
bors [Sun, 1 Oct 2017 09:14:53 +0000 (09:14 +0000)]
Auto merge of #44906 - dkl:main-signature, r=nagisa

Fix native main() signature on 64bit

Hello,

in LLVM-IR produced by rustc on x86_64-linux-gnu, the native main() function had incorrect types for the function result and argc parameter: i64, while it should be i32 (really c_int). See also #20064, #29633.

So I've attempted a fix here. I tested it by checking the LLVM IR produced with --target x86_64-unknown-linux-gnu and i686-unknown-linux-gnu. Also I tried running the tests (`./x.py test`), however I'm getting two failures with and without the patch, which I'm guessing is unrelated.

6 years agoAuto merge of #44921 - est31:master, r=alexcrichton
bors [Sun, 1 Oct 2017 01:41:42 +0000 (01:41 +0000)]
Auto merge of #44921 - est31:master, r=alexcrichton

Update the libcompiler_builtins submodule

Pulls in the latest changes from libcompiler_builtins.

It should work, but it would be best if this wouldn't get put into a rollup so that bisecting is possible if there is a regression.

r? @alexcrichton

6 years agotest: Update target specs test for new target-c-int-width field
Daniel Klauer [Sat, 30 Sep 2017 21:45:36 +0000 (23:45 +0200)]
test: Update target specs test for new target-c-int-width field

6 years agoAuto merge of #44944 - dbrgn:trace-macros-docs, r=QuietMisdreavus
bors [Sat, 30 Sep 2017 20:46:57 +0000 (20:46 +0000)]
Auto merge of #44944 - dbrgn:trace-macros-docs, r=QuietMisdreavus

Docs: Add trace_macros! to unstable book

As TIL'd at Rustfest :)

Note: This is unfortunately untested, since I'm on my laptop battery, and compiling LLVM would probably eat at least 50% of it on my dual core CPU. (Is there a way to build docs without compiling LLVM?)

6 years agocode suggestions for unused-mut, while-true lints; UI test
Zack M. Davis [Sat, 30 Sep 2017 06:52:51 +0000 (23:52 -0700)]
code suggestions for unused-mut, while-true lints; UI test

6 years agocode suggestion for unused-parentheses lint
Zack M. Davis [Sat, 30 Sep 2017 06:50:34 +0000 (23:50 -0700)]
code suggestion for unused-parentheses lint

Resolves #42892.

6 years agocode suggestion for deprecated-attribute lint
Zack M. Davis [Sat, 30 Sep 2017 06:44:41 +0000 (23:44 -0700)]
code suggestion for deprecated-attribute lint

Also, fix the deprecation message for the late no-debug feature.

6 years agolet htmldocck.py check for directories
QuietMisdreavus [Mon, 25 Sep 2017 17:50:27 +0000 (12:50 -0500)]
let htmldocck.py check for directories

6 years agoweird formatting
Douglas Campos [Sat, 30 Sep 2017 15:08:08 +0000 (11:08 -0400)]
weird formatting

6 years agoAuto merge of #44783 - alexcrichton:lto-codegen-units, r=michaelwoerister
bors [Sat, 30 Sep 2017 15:01:35 +0000 (15:01 +0000)]
Auto merge of #44783 - alexcrichton:lto-codegen-units, r=michaelwoerister

rustc: Enable LTO and multiple codegen units

This commit is a refactoring of the LTO backend in Rust to support compilations
with multiple codegen units. The immediate result of this PR is to remove the
artificial error emitted by rustc about `-C lto -C codegen-units-8`, but longer
term this is intended to lay the groundwork for LTO with incremental compilation
and ultimately be the underpinning of ThinLTO support.

The problem here that needed solving is that when rustc is producing multiple
codegen units in one compilation LTO needs to merge them all together.
Previously only upstream dependencies were merged and it was inherently relied
on that there was only one local codegen unit. Supporting this involved
refactoring the optimization backend architecture for rustc, namely splitting
the `optimize_and_codegen` function into `optimize` and `codegen`. After an LLVM
module has been optimized it may be blocked and queued up for LTO, and only
after LTO are modules code generated.

Non-LTO compilations should look the same as they do today backend-wise, we'll
spin up a thread for each codegen unit and optimize/codegen in that thread. LTO
compilations will, however, send the LLVM module back to the coordinator thread
once optimizations have finished. When all LLVM modules have finished optimizing
the coordinator will invoke the LTO backend, producing a further list of LLVM
modules. Currently this is always a list of one LLVM module. The coordinator
then spawns further work to run LTO and code generation passes over each module.

In the course of this refactoring a number of other pieces were refactored:

* Management of the bytecode encoding in rlibs was centralized into one module
  instead of being scattered across LTO and linking.
* Some internal refactorings on the link stage of the compiler was done to work
  directly from `CompiledModule` structures instead of lists of paths.
* The trans time-graph output was tweaked a little to include a name on each
  bar and inflate the size of the bars a little

6 years agoDo not require semantic types for all syntactic types when there are type errors
petrochenkov [Sat, 30 Sep 2017 13:42:22 +0000 (16:42 +0300)]
Do not require semantic types for all syntactic types when there are type errors

6 years agorustc: Use 16bit c_int for msp430
Daniel Klauer [Sat, 30 Sep 2017 11:48:12 +0000 (13:48 +0200)]
rustc: Use 16bit c_int for msp430

Fix regression from c2fe69b9, where main() signature was changed from
using 16bit isize to 32bit c_int for argc parameter/result.

6 years agoCast inner type in OsStr::bytes
Nikolai Vazquez [Sat, 30 Sep 2017 14:01:41 +0000 (10:01 -0400)]
Cast inner type in OsStr::bytes

The innermost type is not [u8] on all platforms but is assumed to have
the same memory layout as [u8] since this conversion was done via
mem::transmute before.

6 years agorustc: Specify c_int width for each target
Daniel Klauer [Sat, 30 Sep 2017 11:47:49 +0000 (13:47 +0200)]
rustc: Specify c_int width for each target

(all i32 for now, as in liblibc)

6 years agoDocs: Add trace_macros! to unstable book
Danilo Bargen [Sat, 30 Sep 2017 09:50:32 +0000 (11:50 +0200)]
Docs: Add trace_macros! to unstable book

6 years agoUpdate RELEASES.md
Aaron Power [Sat, 30 Sep 2017 10:36:49 +0000 (11:36 +0100)]
Update RELEASES.md

6 years agoAuto merge of #44936 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Sat, 30 Sep 2017 10:03:00 +0000 (10:03 +0000)]
Auto merge of #44936 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 15 pull requests

- Successful merges: #44124, #44287, #44320, #44694, #44708, #44794, #44797, #44824, #44836, #44840, #44845, #44854, #44889, #44900, #44903
- Failed merges:

6 years agorustc: Enable LTO and multiple codegen units
Alex Crichton [Sun, 23 Jul 2017 15:14:38 +0000 (08:14 -0700)]
rustc: Enable LTO and multiple codegen units

This commit is a refactoring of the LTO backend in Rust to support compilations
with multiple codegen units. The immediate result of this PR is to remove the
artificial error emitted by rustc about `-C lto -C codegen-units-8`, but longer
term this is intended to lay the groundwork for LTO with incremental compilation
and ultimately be the underpinning of ThinLTO support.

The problem here that needed solving is that when rustc is producing multiple
codegen units in one compilation LTO needs to merge them all together.
Previously only upstream dependencies were merged and it was inherently relied
on that there was only one local codegen unit. Supporting this involved
refactoring the optimization backend architecture for rustc, namely splitting
the `optimize_and_codegen` function into `optimize` and `codegen`. After an LLVM
module has been optimized it may be blocked and queued up for LTO, and only
after LTO are modules code generated.

Non-LTO compilations should look the same as they do today backend-wise, we'll
spin up a thread for each codegen unit and optimize/codegen in that thread. LTO
compilations will, however, send the LLVM module back to the coordinator thread
once optimizations have finished. When all LLVM modules have finished optimizing
the coordinator will invoke the LTO backend, producing a further list of LLVM
modules. Currently this is always a list of one LLVM module. The coordinator
then spawns further work to run LTO and code generation passes over each module.

In the course of this refactoring a number of other pieces were refactored:

* Management of the bytecode encoding in rlibs was centralized into one module
  instead of being scattered across LTO and linking.
* Some internal refactorings on the link stage of the compiler was done to work
  directly from `CompiledModule` structures instead of lists of paths.
* The trans time-graph output was tweaked a little to include a name on each
  bar and inflate the size of the bars a little

6 years agoAuto merge of #44893 - spastorino:remove_new_and_index, r=nikomatsakis
bors [Sat, 30 Sep 2017 06:56:49 +0000 (06:56 +0000)]
Auto merge of #44893 - spastorino:remove_new_and_index, r=nikomatsakis

Remove new and index methods already implement for Idx

These are the rest of the repeated implementations for new and index methods. Follow up of https://github.com/rust-lang/rust/pull/44889

6 years agofix comment typo, `CodeSuggestion` path in doc comment
Zack M. Davis [Sat, 30 Sep 2017 06:38:33 +0000 (23:38 -0700)]
fix comment typo, `CodeSuggestion` path in doc comment

`CodeSuggestion` doesn't live in the `diagnostic` module.

6 years agoDon't use remapped path when loading modules and include files
Philip Craig [Sat, 30 Sep 2017 06:28:48 +0000 (16:28 +1000)]
Don't use remapped path when loading modules and include files

6 years agomake match exaustive
Douglas Campos [Sat, 30 Sep 2017 02:21:35 +0000 (22:21 -0400)]
make match exaustive

6 years agoimprove documentation for resolve()
Douglas Campos [Sat, 30 Sep 2017 01:57:12 +0000 (21:57 -0400)]
improve documentation for resolve()

6 years agofix formatting
Douglas Campos [Sat, 30 Sep 2017 01:51:20 +0000 (21:51 -0400)]
fix formatting

6 years agostyle fixes as requested by @eddyb
Douglas Campos [Thu, 28 Sep 2017 12:36:34 +0000 (08:36 -0400)]
style fixes as requested by @eddyb

6 years agostop using monomorphize::resolve()
Douglas Campos [Thu, 28 Sep 2017 03:23:16 +0000 (23:23 -0400)]
stop using monomorphize::resolve()

6 years agotake ParamEnv into account when resolving
Douglas Campos [Thu, 28 Sep 2017 02:22:55 +0000 (22:22 -0400)]
take ParamEnv into account when resolving

6 years agomake it not to be a method
Douglas Campos [Tue, 19 Sep 2017 21:31:00 +0000 (17:31 -0400)]
make it not to be a method

6 years agoalways use resolve
Douglas Campos [Tue, 19 Sep 2017 13:14:43 +0000 (09:14 -0400)]
always use resolve

6 years agore-enable mir inlining across trait methods
Douglas Campos [Tue, 19 Sep 2017 03:53:33 +0000 (23:53 -0400)]
re-enable mir inlining across trait methods

this fixes #44389

6 years agocopy resolve() over to librustc
Douglas Campos [Tue, 19 Sep 2017 02:49:40 +0000 (22:49 -0400)]
copy resolve() over to librustc

6 years agorustdoc: A test for local and foreign [src] trait impl links
Vitaly _Vi Shukela [Sat, 30 Sep 2017 00:17:51 +0000 (03:17 +0300)]
rustdoc: A test for local and foreign [src] trait impl links

6 years agoRollup merge of #44903 - kallisti5:ci-build-disabled, r=aidanhs
Mark Simulacrum [Fri, 29 Sep 2017 23:59:05 +0000 (17:59 -0600)]
Rollup merge of #44903 - kallisti5:ci-build-disabled, r=aidanhs

ci: Fix building disabled containers

* Change the context into the disabled directory. Now you can test
  containers which are disabled.

6 years agoRollup merge of #44900 - Havvy:normalize-lang-attribute-spacing, r=sfackler
Mark Simulacrum [Fri, 29 Sep 2017 23:59:04 +0000 (17:59 -0600)]
Rollup merge of #44900 - Havvy:normalize-lang-attribute-spacing, r=sfackler

Normalize spaces in lang attributes.

So, like, I grepped for all `lang` attributes for *reasons* and I noticed that they all share the same spacing of `#[lang = "item_name"]` except these five instances. So I decided to fix that. So enjoy this PR of exactly ten spaces.

6 years agoRollup merge of #44889 - spastorino:remove_new, r=arielb1
Mark Simulacrum [Fri, 29 Sep 2017 23:59:03 +0000 (17:59 -0600)]
Rollup merge of #44889 - spastorino:remove_new, r=arielb1

Remove DepNodeIndex::new is already impl for Idx

6 years agoRollup merge of #44854 - lucasem:atomic-docs, r=steveklabnik
Mark Simulacrum [Fri, 29 Sep 2017 23:59:02 +0000 (17:59 -0600)]
Rollup merge of #44854 - lucasem:atomic-docs, r=steveklabnik

docs improvement sync::atomic::Atomic*

Addresses the `Atomic*` part of #29377.
r? @steveklabnik

6 years agoRollup merge of #44845 - SimonSapin:nll_mod_rs, r=nikomatsakis
Mark Simulacrum [Fri, 29 Sep 2017 23:59:01 +0000 (17:59 -0600)]
Rollup merge of #44845 - SimonSapin:nll_mod_rs, r=nikomatsakis

Move src/librustc_mir/transform/nll.rs to a subdirectory

CC https://github.com/rust-lang/rust/issues/43234

6 years agoRollup merge of #44840 - steveklabnik:fix-wording, r=BurntSushi
Mark Simulacrum [Fri, 29 Sep 2017 23:59:00 +0000 (17:59 -0600)]
Rollup merge of #44840 - steveklabnik:fix-wording, r=BurntSushi

Improve wording for StepBy

No other iterator makes the distinction between an iterator and an iterator adapter
in its summary line, so change it to be consistent with all other adapters.

6 years agoRollup merge of #44836 - GuillaumeGomez:fmt-missing-links, r=QuietMisdreavus
Mark Simulacrum [Fri, 29 Sep 2017 23:58:59 +0000 (17:58 -0600)]
Rollup merge of #44836 - GuillaumeGomez:fmt-missing-links, r=QuietMisdreavus

Add missing links in fmt module

r? @rust-lang/docs

6 years agoRollup merge of #44824 - dtolnay:22really21, r=alexcrichton
Mark Simulacrum [Fri, 29 Sep 2017 23:58:58 +0000 (17:58 -0600)]
Rollup merge of #44824 - dtolnay:22really21, r=alexcrichton

Backport libs stabilizations to 1.21 beta

Includes the following stabilizations:

- tcpstream_connect_timeout https://github.com/rust-lang/rust/pull/44563
- iterator_for_each https://github.com/rust-lang/rust/pull/44567
- ord_max_min https://github.com/rust-lang/rust/pull/44593
- compiler_fences https://github.com/rust-lang/rust/pull/44595
- needs_drop https://github.com/rust-lang/rust/pull/44639
- vec_splice https://github.com/rust-lang/rust/pull/44640

These have been backported in https://github.com/rust-lang/rust/pull/44823.

6 years agoRollup merge of #44797 - lucasem:master, r=frewsxcv
Mark Simulacrum [Fri, 29 Sep 2017 23:58:57 +0000 (17:58 -0600)]
Rollup merge of #44797 - lucasem:master, r=frewsxcv

docs improvement std::sync::{PoisonError, TryLockError}

Addresses the `PoisonError` and `TryLockError` parts of #29377.
Adds examples and links.

r? @steveklabnik

6 years agoRollup merge of #44794 - napen123:master, r=frewsxcv
Mark Simulacrum [Fri, 29 Sep 2017 23:58:56 +0000 (17:58 -0600)]
Rollup merge of #44794 - napen123:master, r=frewsxcv

Add doc example to HashMap::hasher

None

6 years agoRollup merge of #44708 - toidiu:ak-44493, r=nikomatsakis
Mark Simulacrum [Fri, 29 Sep 2017 23:58:55 +0000 (17:58 -0600)]
Rollup merge of #44708 - toidiu:ak-44493, r=nikomatsakis

Infer `T: 'x` outlives requirements on structs #44493

https://github.com/rust-lang/rust/issues/44493

6 years agoRollup merge of #44694 - tommyip:make_clean, r=Mark-Simulacrum
Mark Simulacrum [Fri, 29 Sep 2017 23:58:54 +0000 (17:58 -0600)]
Rollup merge of #44694 - tommyip:make_clean, r=Mark-Simulacrum

Add --all flag to ./x.py clean

This make `clean` removes the LLVM and download cache directory as well.

Fixes #44214.

r? @Mark-Simulacrum

6 years agoRollup merge of #44320 - jakllsch:jakllsch-caf2c3d2-c939-4c4d-8c68-1aecbd570fab,...
Mark Simulacrum [Fri, 29 Sep 2017 23:58:53 +0000 (17:58 -0600)]
Rollup merge of #44320 - jakllsch:jakllsch-caf2c3d2-c939-4c4d-8c68-1aecbd570fab, r=Mark-Simulacrum

Fix extended bootstrap issues with OpenSSL on NetBSD build hosts

6 years agoRollup merge of #44287 - Eh2406:master, r=aturon
Mark Simulacrum [Fri, 29 Sep 2017 23:58:52 +0000 (17:58 -0600)]
Rollup merge of #44287 - Eh2406:master, r=aturon

Allow T op= &T for built-in numeric types T v2

Manually rebase of @Migi https://github.com/rust-lang/rust/pull/41336

6 years agoRollup merge of #44124 - gaurikholkar:return_self, r=arielb1
Mark Simulacrum [Fri, 29 Sep 2017 23:58:51 +0000 (17:58 -0600)]
Rollup merge of #44124 - gaurikholkar:return_self, r=arielb1

adding E0623 for return types - both parameters are anonymous

This is a fix for #44018
```
error[E0621]: explicit lifetime required in the type of `self`
  --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:17:5
   |
16 |   fn foo<'a>(&self, x: &i32) -> &i32 {
   |                        ----     ----
   |                        |
   |                        this parameter and the return type are
                            declared with different lifetimes...
17 |     x
   |     ^ ...but data from `x` is returned here

error: aborting due to previous error
```
It also works for the below case where we have self as anonymous

```
error[E0623]: lifetime mismatch
  --> src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs:17:19
   |
16 |     fn foo<'a>(&self, x: &Foo) -> &Foo {
   |                          ----     ----
   |                          |
   |                          this parameter and the return type are
                            declared with different lifetimes...
17 |         if true { x } else { self }
   |                   ^ ...but data from `x` is returned here

error: aborting due to previous error
```
r? @nikomatsakis

Currently, I have enabled E0621 where return type and self are anonymous, hence WIP.

6 years agoUpdate the libcompiler_builtins submodule
est31 [Thu, 28 Sep 2017 19:18:50 +0000 (21:18 +0200)]
Update the libcompiler_builtins submodule