]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #49742 - Pulkit07:master, r=steveklabnik
kennytm [Sat, 7 Apr 2018 06:51:32 +0000 (14:51 +0800)]
Rollup merge of #49742 - Pulkit07:master, r=steveklabnik

Using X headings instead of 0.X #49739

Fix #49739

6 years agoRollup merge of #49731 - japaric:std-thumb-for-real, r=alexcrichton
kennytm [Sat, 7 Apr 2018 06:51:31 +0000 (14:51 +0800)]
Rollup merge of #49731 - japaric:std-thumb-for-real, r=alexcrichton

add THUMB targets to rustup manifest

as instructed in https://github.com/rust-lang/rust/pull/49563#issuecomment-379271327

r? @alexcrichton

6 years agoRollup merge of #49728 - japaric:no-debug_gdb_scripts, r=alexcrichton
kennytm [Sat, 7 Apr 2018 06:51:30 +0000 (14:51 +0800)]
Rollup merge of #49728 - japaric:no-debug_gdb_scripts, r=alexcrichton

add emit_debug_gdb_scripts target option and ..

set it to false for no-std targets like ARM Cortex-M and MSP430. For the rationale of this change see the comment in thumb_base.rs

this is a temporary workaround until #44993 is implemented

r? @alexcrichton or @michaelwoerister

6 years agoRollup merge of #49702 - alexcrichton:inline-methods, r=Mark-Simulacrum
kennytm [Sat, 7 Apr 2018 06:51:28 +0000 (14:51 +0800)]
Rollup merge of #49702 - alexcrichton:inline-methods, r=Mark-Simulacrum

std: Inline some Termination-related methods

These were showing up in tests and in binaries but are trivially optimize-able
away, so add `#[inline]` attributes so LLVM has an opportunity to optimize them
out.

6 years agoRollup merge of #49652 - GuillaumeGomez:anchor-collapsed, r=QuietMisdreavus
kennytm [Sat, 7 Apr 2018 06:51:27 +0000 (14:51 +0800)]
Rollup merge of #49652 - GuillaumeGomez:anchor-collapsed, r=QuietMisdreavus

Fix anchors issue when everything is collapsed

Fixes #49455.

@frewsxcv does it seem good for you like this?

r? @QuietMisdreavus

6 years agoRollup merge of #49510 - GuillaumeGomez:anchor-field-position, r=QuietMisdreavus
kennytm [Sat, 7 Apr 2018 06:51:26 +0000 (14:51 +0800)]
Rollup merge of #49510 - GuillaumeGomez:anchor-field-position, r=QuietMisdreavus

Fix anchor position on fields

Take a look at `Option` variants for example and try to click on `§` to get the issue.

r? @QuietMisdreavus

6 years agoAuto merge of #49222 - Zoxc:print-query-stack, r=nikomatsakis
bors [Sat, 7 Apr 2018 02:51:17 +0000 (02:51 +0000)]
Auto merge of #49222 - Zoxc:print-query-stack, r=nikomatsakis

Print query stack on ICEs

ICE output is now:
```
thread 'rustc' panicked at 'no borrowck', librustc_borrowck\borrowck\mod.rs:95:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
query stack during panic:
#0 [borrowck] processing `main`
  --> no-std.rs:10:1
   |
10 | fn main() {}
   | ^^^^^^^^^
end of query stack

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.26.0-dev running on x86_64-pc-windows-msvc
```

Fixes #42529.

r? @eddyb

6 years agoAuto merge of #49623 - steveklabnik:update-mdbook, r=GuillaumeGomez
bors [Sat, 7 Apr 2018 00:20:21 +0000 (00:20 +0000)]
Auto merge of #49623 - steveklabnik:update-mdbook, r=GuillaumeGomez

update mdbook

This includes search for all books, a long-requested feature!

6 years agoAuto merge of #49392 - retep007:nll-issue-48962, r=nikomatsakis
bors [Fri, 6 Apr 2018 21:50:12 +0000 (21:50 +0000)]
Auto merge of #49392 - retep007:nll-issue-48962, r=nikomatsakis

fixes move analysis

Fixed compiler error by correct checking when dereferencing

Fix #48962

r? @nikomatsakis

6 years agoUsing X headings instead of 0.X #49739
Pulkit Goyal [Fri, 6 Apr 2018 19:12:47 +0000 (00:42 +0530)]
Using X headings instead of 0.X #49739

6 years agoAuto merge of #49064 - QuietMisdreavus:piercing-the-veil, r=GuillaumeGomez
bors [Fri, 6 Apr 2018 17:38:41 +0000 (17:38 +0000)]
Auto merge of #49064 - QuietMisdreavus:piercing-the-veil, r=GuillaumeGomez

rustdoctest: suppress the default allow(unused) under --display-warnings

If you're passing rustdoc `--display-warnings`, you probably want to see the default ones too. This change modifies `test::make_test` to suppress the default `#![allow(unused)]` if the `--display-warnings` CLI flag was provided to rustdoc.

cc https://github.com/rust-lang/rust/issues/41574

6 years agoAuto merge of #48779 - michaelwoerister:share-generics4, r=alexcrichton
bors [Fri, 6 Apr 2018 15:01:27 +0000 (15:01 +0000)]
Auto merge of #48779 - michaelwoerister:share-generics4, r=alexcrichton

Allow for re-using monomorphizations in upstream crates.

Followup to #48611. This implementation is pretty much finished modulo failing tests if there are any. Not quite ready for review yet though.

### DESCRIPTION

This PR introduces a `share-generics` mode for RLIBs and Rust dylibs. When a crate is compiled in this mode, two things will happen:
- before instantiating a monomorphization in the current crate, the compiler will look for that monomorphization in all upstream crates and link to it, if possible.
- monomorphizations are not internalized during partitioning. Instead they are added to the list of symbols exported from the crate.

This results in less code being translated and LLVMed. However, there are also downsides:
- it will impede optimization somewhat, since fewer functions can be internalized, and
- Rust dylibs will have bigger symbol tables since they'll also export monomorphizations.

Consequently, this PR only enables the `shared-generics` mode for opt-levels `No`, `Less`, `Size`, and `MinSize`, and for when incremental compilation is activated. `-O2` and `-O3` will still generate generic functions per-crate.

Another thing to note is that this has a somewhat similar effect as MIR-only RLIBs, in that monomorphizations are shared, but it is less effective because it cannot share monomorphizations between sibling crates:

```
         A        <--- defines `fn foo<T>() { .. }`
       /   \
      /     \
     B       C    <--- both call `foo<u32>()`
      \     /
       \   /
         D        <--- calls `foo<u32>()` too
```

With `share-generics`, both `B` and `C` have to instantiate `foo<u32>` and only `D` can re-use it (from either `B` or `C`). With MIR-only RLIBs, `B` and `C` would not instantiate anything, and in `D` we would then only instantiate `foo<u32>` once.
On the other hand, when there are many leaf crates in the graph (e.g. when compiling many individual test binaries) then the `share-generics` approach will often be more effective.

### TODO
 - [x] Add codegen test that makes sure monomorphizations can be internalized in non-Rust binaries.
 - [x] Add codegen-units test that makes sure we share generics.
 - [x] Add run-make test that makes sure we don't export any monomorphizations from non-Rust binaries.
 - [x] Review for reproducible-builds implications.

6 years agoadd THUMB targets to rustup manifest
Jorge Aparicio [Fri, 6 Apr 2018 14:35:03 +0000 (16:35 +0200)]
add THUMB targets to rustup manifest

6 years agoPrint query stack on ICEs
John Kåre Alsaker [Tue, 20 Mar 2018 22:41:25 +0000 (23:41 +0100)]
Print query stack on ICEs

6 years agorefactor: simplify `needs_gdb_debug_scripts_section`
Jorge Aparicio [Fri, 6 Apr 2018 13:44:08 +0000 (15:44 +0200)]
refactor: simplify `needs_gdb_debug_scripts_section`

6 years agoadd emit_debug_gdb_scripts target option and ..
Jorge Aparicio [Fri, 6 Apr 2018 13:40:43 +0000 (15:40 +0200)]
add emit_debug_gdb_scripts target option and ..

set it to false for no-std targets like ARM Cortex-M and MSP430. For the rationale of this change
see the comment in thumb_base.rs

6 years agoAuto merge of #49335 - GuillaumeGomez:remove-unneeded-trait-implementations-title...
bors [Fri, 6 Apr 2018 12:03:16 +0000 (12:03 +0000)]
Auto merge of #49335 - GuillaumeGomez:remove-unneeded-trait-implementations-title, r=QuietMisdreavus

Remove unneeded trait implementations titles

r? @QuietMisdreavus

6 years agoUpdate run-make/symbol-visibility to also cover shared-generics
Michael Woerister [Tue, 13 Mar 2018 13:21:50 +0000 (14:21 +0100)]
Update run-make/symbol-visibility to also cover shared-generics

6 years agoAllow for re-using hidden monomorphizations on platforms that don't support Rust...
Michael Woerister [Wed, 21 Mar 2018 11:23:57 +0000 (12:23 +0100)]
Allow for re-using hidden monomorphizations on platforms that don't support Rust dylibs.

6 years agoUpdate a few comments about symbol visibility.
Michael Woerister [Wed, 14 Mar 2018 15:45:06 +0000 (16:45 +0100)]
Update a few comments about symbol visibility.

6 years agoAdd codegen-units test for shared-generics.
Michael Woerister [Tue, 13 Mar 2018 13:26:49 +0000 (14:26 +0100)]
Add codegen-units test for shared-generics.

6 years agoMake sure that generics are internalized in executables even with -Zshare-generics
Michael Woerister [Tue, 13 Mar 2018 13:24:03 +0000 (14:24 +0100)]
Make sure that generics are internalized in executables even with -Zshare-generics

6 years agoDon't internalize generics that are re-exported
Michael Woerister [Tue, 13 Mar 2018 13:21:00 +0000 (14:21 +0100)]
Don't internalize generics that are re-exported

6 years agoFix some rebasing fallout.
Michael Woerister [Tue, 13 Mar 2018 10:52:26 +0000 (11:52 +0100)]
Fix some rebasing fallout.

6 years agoSelect upstream monomorphizations in a stable way.
Michael Woerister [Mon, 12 Mar 2018 17:28:53 +0000 (18:28 +0100)]
Select upstream monomorphizations in a stable way.

6 years agoAdapt codegen-unit test to shared-generics.
Michael Woerister [Wed, 7 Mar 2018 11:01:28 +0000 (12:01 +0100)]
Adapt codegen-unit test to shared-generics.

6 years agoAllow for internalizing monomorphizations that cannot be shared.
Michael Woerister [Tue, 6 Mar 2018 13:44:14 +0000 (14:44 +0100)]
Allow for internalizing monomorphizations that cannot be shared.

6 years agoRemove the (inaccurate) symbol_export_level query.
Michael Woerister [Tue, 6 Mar 2018 11:20:50 +0000 (12:20 +0100)]
Remove the (inaccurate) symbol_export_level query.

6 years agoMake generics sharing the default for non-optimized builds.
Michael Woerister [Tue, 6 Mar 2018 10:56:01 +0000 (11:56 +0100)]
Make generics sharing the default for non-optimized builds.

6 years agoAllow for re-using monomorphizations from upstream crates.
Michael Woerister [Tue, 6 Mar 2018 09:33:42 +0000 (10:33 +0100)]
Allow for re-using monomorphizations from upstream crates.

6 years agoMove export level computation to reachable_non_generics query.
Michael Woerister [Tue, 6 Mar 2018 09:18:48 +0000 (10:18 +0100)]
Move export level computation to reachable_non_generics query.

6 years agoAllow for representing exported monomorphizations in crate metadata.
Michael Woerister [Thu, 1 Mar 2018 15:50:08 +0000 (16:50 +0100)]
Allow for representing exported monomorphizations in crate metadata.

6 years agoFix incomplete ICH implementation for ty::subst::UnpackedKind.
Michael Woerister [Thu, 1 Mar 2018 15:48:03 +0000 (16:48 +0100)]
Fix incomplete ICH implementation for ty::subst::UnpackedKind.

6 years agoAuto merge of #49154 - petrochenkov:spident, r=eddyb
bors [Fri, 6 Apr 2018 09:32:03 +0000 (09:32 +0000)]
Auto merge of #49154 - petrochenkov:spident, r=eddyb

AST: Give spans to all identifiers

Change representation of `ast::Ident` from `{ name: Symbol, ctxt: SyntaxContext }` to `{ name: Symbol, span: Span }`.
Syntax contexts still can be extracted from spans (`span.ctxt()`).

Why this should not require more memory:
- `Span` is `u32` just like `SyntaxContext`.
- Despite keeping more spans in AST we don't actually *create* more spans, so the number of "outlined" spans kept in span interner shouldn't become larger.

Why this may be slightly slower:
- When we need to extract ctxt from an identifier instead of just field read we need to do bit field extraction possibly followed by and access by index into span interner's vector. Both operations should be fast (unless the span interner is under some synchronization) and we already do ctxt extraction from spans all the time during macro expansion, so the difference should be lost in noise.

cc https://github.com/rust-lang/rust/pull/48842#issuecomment-373365661

6 years agoFix feature gating for crate/extern in paths
Vadim Petrochenkov [Sun, 25 Mar 2018 15:51:32 +0000 (18:51 +0300)]
Fix feature gating for crate/extern in paths

6 years agoUse `Ident` instead of `Name` in `MetaItem`
Vadim Petrochenkov [Sat, 24 Mar 2018 18:17:27 +0000 (21:17 +0300)]
Use `Ident` instead of `Name` in `MetaItem`

6 years agoFix stable hash for identifiers
Vadim Petrochenkov [Sat, 24 Mar 2018 17:28:44 +0000 (20:28 +0300)]
Fix stable hash for identifiers

6 years agoMake lifetime nonterminals closer to identifier nonterminals
Vadim Petrochenkov [Sat, 24 Mar 2018 16:49:50 +0000 (19:49 +0300)]
Make lifetime nonterminals closer to identifier nonterminals

6 years agoRemove more duplicated spans
Vadim Petrochenkov [Mon, 19 Mar 2018 00:54:56 +0000 (03:54 +0300)]
Remove more duplicated spans

6 years agoRename `ast::Variant_::name` into `ident` + Fix rebase
Vadim Petrochenkov [Sun, 18 Mar 2018 22:21:30 +0000 (01:21 +0300)]
Rename `ast::Variant_::name` into `ident` + Fix rebase

6 years agoUse `Span::apply_mark` where possible
Vadim Petrochenkov [Sun, 18 Mar 2018 20:51:53 +0000 (23:51 +0300)]
Use `Span::apply_mark` where possible

6 years agoGet rid of `SpannedIdent`
Vadim Petrochenkov [Sun, 18 Mar 2018 13:47:09 +0000 (16:47 +0300)]
Get rid of `SpannedIdent`

6 years agoRename `PathSegment::identifier` to `ident`
Vadim Petrochenkov [Sun, 18 Mar 2018 00:53:41 +0000 (03:53 +0300)]
Rename `PathSegment::identifier` to `ident`

6 years agoUse `Span` instead of `SyntaxContext` in `Ident`
Vadim Petrochenkov [Sat, 17 Mar 2018 23:57:23 +0000 (02:57 +0300)]
Use `Span` instead of `SyntaxContext` in `Ident`

6 years agoAuto merge of #49293 - memoryleak47:add-compiletest-nll-compare-mode, r=pnkfelix
bors [Fri, 6 Apr 2018 07:04:20 +0000 (07:04 +0000)]
Auto merge of #49293 - memoryleak47:add-compiletest-nll-compare-mode, r=pnkfelix

Add compiletest `--compare-mode nll` option

Before implementing the tidy stuff, I'd appreciate if someone reviews the changes so far.
This is my first non-trivial pull request, so I could really use some feedback. :)
closes #48879.

r? @nikomatsakis

6 years agoAuto merge of #49696 - alexcrichton:rollup, r=alexcrichton
bors [Thu, 5 Apr 2018 19:25:37 +0000 (19:25 +0000)]
Auto merge of #49696 - alexcrichton:rollup, r=alexcrichton

Rollup of 8 pull requests

Successful merges:

 - #49045 (Make queries thread safe)
 - #49350 (Expand macros in `extern {}` blocks)
 - #49497 (Chalkify - Tweak `Clause` definition and HRTBs)
 - #49597 (proc_macro: Reorganize public API)
 - #49686 (typos)
- #49621
- #49697
- #49705

Failed merges:

6 years agoupdate mdbook
steveklabnik [Tue, 3 Apr 2018 14:32:04 +0000 (10:32 -0400)]
update mdbook

This includes search for all books, a long-requested feature!

6 years agoRollup merge of #49705 - alexcrichton:less-manifest-docs, r=kennytm
Alex Crichton [Thu, 5 Apr 2018 19:03:03 +0000 (12:03 -0700)]
Rollup merge of #49705 - alexcrichton:less-manifest-docs, r=kennytm

6 years agoRollup merge of #49697 - kennytm:name-every-builder, r=aturon
Alex Crichton [Thu, 5 Apr 2018 18:50:46 +0000 (11:50 -0700)]
Rollup merge of #49697 - kennytm:name-every-builder, r=aturon

6 years agoRollup merge of #49621 - Nemo157:impl-unpin-for-pin, r=withoutboats
Alex Crichton [Thu, 5 Apr 2018 18:50:12 +0000 (11:50 -0700)]
Rollup merge of #49621 - Nemo157:impl-unpin-for-pin, r=withoutboats

6 years agoFilter out missing components from manifests
Alex Crichton [Thu, 5 Apr 2018 18:36:01 +0000 (11:36 -0700)]
Filter out missing components from manifests

This commit updates our manifest generation for rustup to filter out any
components/extensions which are actually missing. This is intended to help
mitigate #49462 by making the manifests reflect reality, that many targets now
are missing a `rust-docs` component rather than requiring it exists.

6 years agoRollup merge of #49686 - memoryleak47:typo, r=alexcrichton
Alex Crichton [Thu, 5 Apr 2018 15:49:21 +0000 (10:49 -0500)]
Rollup merge of #49686 - memoryleak47:typo, r=alexcrichton

typos

6 years agoRollup merge of #49597 - alexcrichton:proc-macro-v2, r=petrochenkov
Alex Crichton [Thu, 5 Apr 2018 15:49:20 +0000 (10:49 -0500)]
Rollup merge of #49597 - alexcrichton:proc-macro-v2, r=petrochenkov

proc_macro: Reorganize public API

This commit is a reorganization of the `proc_macro` crate's public user-facing
API. This is the result of a number of discussions at the recent Rust All-Hands
where we're hoping to get the `proc_macro` crate into ship shape for
stabilization of a subset of its functionality in the Rust 2018 release.

The reorganization here is motivated by experiences from the `proc-macro2`,
`quote`, and `syn` crates on crates.io (and other crates which depend on them).
The main focus is future flexibility along with making a few more operations
consistent and/or fixing bugs. A summary of the changes made from today's
`proc_macro` API is:

* The `TokenNode` enum has been removed and the public fields of `TokenTree`
  have also been removed. Instead the `TokenTree` type is now a public enum
  (what `TokenNode` was) and each variant is an opaque struct which internally
  contains `Span` information. This makes the various tokens a bit more
  consistent, require fewer wrappers, and otherwise provides good
  future-compatibility as opaque structs are easy to modify later on.

* `Literal` integer constructors have been expanded to be unambiguous as to what
  they're doing and also allow for more future flexibility. Previously
  constructors like `Literal::float` and `Literal::integer` were used to create
  unsuffixed literals and the concrete methods like `Literal::i32` would create
  a suffixed token. This wasn't immediately clear to all users (the
  suffixed/unsuffixed aspect) and having *one* constructor for unsuffixed
  literals required us to pick a largest type which may not always be true. To
  fix these issues all constructors are now of the form
  `Literal::i32_unsuffixed` or `Literal::i32_suffixed` (for all integral types).
  This should allow future compatibility as well as being immediately clear
  what's suffixed and what isn't.

* Each variant of `TokenTree` internally contains a `Span` which can also be
  configured via `set_span`. For example `Literal` and `Term` now both
  internally contain a `Span` rather than having it stored in an auxiliary
  location.

* Constructors of all tokens are called `new` now (aka `Term::intern` is gone)
  and most do not take spans. Manufactured tokens typically don't have a fresh
  span to go with them and the span is purely used for error-reporting
  **except** the span for `Term`, which currently affects hygiene. The default
  spans for all these constructed tokens is `Span::call_site()` for now.

  The `Term` type's constructor explicitly requires passing in a `Span` to
  provide future-proofing against possible hygiene changes. It's intended that a
  first pass of stabilization will likely only stabilize `Span::call_site()`
  which is an explicit opt-in for "I would like no hygiene here please". The
  intention here is to make this explicit in procedural macros to be
  forwards-compatible with a hygiene-specifying solution.

* Some of the conversions for `TokenStream` have been simplified a little.

* The `TokenTreeIter` iterator was renamed to `token_stream::IntoIter`.

Overall the hope is that this is the "final pass" at the API of `TokenStream`
and most of `TokenTree` before stabilization. Explicitly left out here is any
changes to `Span`'s API which will likely need to be re-evaluated before
stabilization.

All changes in this PR have already been reflected to the [`proc-macro2`],
`quote`, and `syn` crates. New versions of all these crates have also been
published to crates.io.

Once this lands in nightly I plan on making an internals post again summarizing
the changes made here and also calling on all macro authors to give the APIs a
spin and see how they work. Hopefully pending no major issues we can then have
an FCP to stabilize later this cycle!

[`proc-macro2`]: https://docs.rs/proc-macro2/0.3.1/proc_macro2/

Closes #49596

6 years agoRollup merge of #49497 - scalexm:hrtb, r=nikomatsakis
Alex Crichton [Thu, 5 Apr 2018 15:49:19 +0000 (10:49 -0500)]
Rollup merge of #49497 - scalexm:hrtb, r=nikomatsakis

Chalkify - Tweak `Clause` definition and HRTBs

r? @nikomatsakis

6 years agostd: Inline some Termination-related methods
Alex Crichton [Thu, 5 Apr 2018 18:07:19 +0000 (11:07 -0700)]
std: Inline some Termination-related methods

These were showing up in tests and in binaries but are trivially optimize-able
away, so add `#[inline]` attributes so LLVM has an opportunity to optimize them
out.

6 years agoimpl Unpin for PinBox
Wim Looman [Thu, 5 Apr 2018 18:03:02 +0000 (20:03 +0200)]
impl Unpin for PinBox

6 years agoGive a name to every CI job.
kennytm [Thu, 5 Apr 2018 17:09:59 +0000 (01:09 +0800)]
Give a name to every CI job.

Bots that read the log can simply look for `[CI_JOB_NAME=...]` to find out
the job's name.

6 years agoAuto merge of #49045 - Zoxc:tls, r=michaelwoerister
bors [Thu, 5 Apr 2018 16:38:15 +0000 (16:38 +0000)]
Auto merge of #49045 - Zoxc:tls, r=michaelwoerister

Make queries thread safe

This makes queries thread safe by removing the query stack and making queries point to their parents. Queries write to the query map when starting and cycles are detected by checking if there's already an entry in the query map. This makes cycle detection O(1) instead of O(n), where `n` is the size of the query stack.

This is mostly corresponds to the method I described [here](https://internals.rust-lang.org/t/parallelizing-rustc-using-rayon/6606).

cc @rust-lang/compiler

r? @michaelwoerister

6 years agoRollup merge of #49350 - abonander:macros-in-extern, r=petrochenkov
Alex Crichton [Thu, 5 Apr 2018 15:49:14 +0000 (10:49 -0500)]
Rollup merge of #49350 - abonander:macros-in-extern, r=petrochenkov

Expand macros in `extern {}` blocks

This permits macro and proc-macro and attribute invocations (the latter only with the `proc_macro` feature of course) in `extern {}` blocks, gated behind a new `macros_in_extern` feature.

A tracking issue is now open at #49476

closes #48747

6 years agoRollup merge of #49045 - Zoxc:tls, r=michaelwoerister
Alex Crichton [Thu, 5 Apr 2018 15:49:13 +0000 (10:49 -0500)]
Rollup merge of #49045 - Zoxc:tls, r=michaelwoerister

Make queries thread safe

This makes queries thread safe by removing the query stack and making queries point to their parents. Queries write to the query map when starting and cycles are detected by checking if there's already an entry in the query map. This makes cycle detection O(1) instead of O(n), where `n` is the size of the query stack.

This is mostly corresponds to the method I described [here](https://internals.rust-lang.org/t/parallelizing-rustc-using-rayon/6606).

cc @rust-lang/compiler

r? @michaelwoerister

6 years agoAuto merge of #49684 - kennytm:rollup, r=kennytm
bors [Thu, 5 Apr 2018 13:07:45 +0000 (13:07 +0000)]
Auto merge of #49684 - kennytm:rollup, r=kennytm

Rollup of 9 pull requests

Successful merges:

 - #48658 (Add a generic CAS loop to std::sync::Atomic*)
 - #49253 (Take the original extra-filename passed to a crate into account when resolving it as a dependency)
 - #49345 (RFC 2008: Finishing Touches)
 - #49432 (Flush executables to disk after linkage)
 - #49496 (Add more vec![... ; n] optimizations)
 - #49563 (add a dist builder to build rust-std components for the THUMB targets)
 - #49654 (Host compiler documentation: Include private items)
 - #49667 (Add more features to rust_2018_preview)
 - #49674 (ci: Remove x86_64-gnu-incremental builder)

Failed merges:

6 years agotypos
memoryleak47 [Thu, 5 Apr 2018 11:04:00 +0000 (13:04 +0200)]
typos

6 years agoRollup merge of #49674 - alexcrichton:no-incremental-rustc, r=michaelwoerister
kennytm [Thu, 5 Apr 2018 10:38:53 +0000 (18:38 +0800)]
Rollup merge of #49674 - alexcrichton:no-incremental-rustc, r=michaelwoerister

ci: Remove x86_64-gnu-incremental builder

This builder is starting to time out frequently causing PRs to bounce and
otherwise doesn't seem to be catching too many bugs, so this commit removes it
entirely. We've had a number of timeouts in the last few weeks related to this
builder:

* https://travis-ci.org/rust-lang/rust/jobs/360947582
* https://travis-ci.org/rust-lang/rust/jobs/360464190
* https://travis-ci.org/rust-lang/rust/jobs/359946975
* https://travis-ci.org/rust-lang/rust/jobs/361213241
* https://travis-ci.org/rust-lang/rust/jobs/362346279
* https://travis-ci.org/rust-lang/rust/jobs/362072331

On a good run this builder takes about 2h15m, which is already too long for
Travis and the variable build times end up pushing it beyond the 3h limit
occasionally.

The timeouts here are somewhat expected in that an incrementally compiled rustc
compiler isn't optimized like a normal rustc, disallowing inlining between
codegen units and losing lots of optimization opportunities.

6 years agoRollup merge of #49667 - Manishearth:preview-features, r=nikomatsakis
kennytm [Thu, 5 Apr 2018 08:51:26 +0000 (16:51 +0800)]
Rollup merge of #49667 - Manishearth:preview-features, r=nikomatsakis

Add more features to rust_2018_preview

Doesn't handle lib features like never_type; we need to figure out a scheme for that.

6 years agoRollup merge of #49654 - davidtwco:issue-29893, r=alexcrichton
kennytm [Thu, 5 Apr 2018 08:51:25 +0000 (16:51 +0800)]
Rollup merge of #49654 - davidtwco:issue-29893, r=alexcrichton

Host compiler documentation: Include private items

Fixes #29893. Now that compiler documentation is being hosted, including private items seems sensible as these types are going to be being used by contributors working on the compiler.

However, including this means that doc comments that contain codeblocks with invalid Rust and can fail the documenting of a given crate (as evidenced by the changes in the second commit included in this PR). We'd need some way of ensuring that this cannot happen so that these failures don't cause documenting to fail. I'm unsure whether this change to documentation steps will cause this to happen already or if something new will be required.

r? @alexcrichton

6 years agoRollup merge of #49563 - japaric:std-thumb, r=alexcrichton
kennytm [Thu, 5 Apr 2018 08:51:24 +0000 (16:51 +0800)]
Rollup merge of #49563 - japaric:std-thumb, r=alexcrichton

add a dist builder to build rust-std components for the THUMB targets

the rust-std component only contains the core and compiler-builtins (+c +mem) crates

cc #49382

- I'm not entirely sure if this PR alone will produce rust-std components installable by rustup or if something else needs to be changed
- I could have done the THUMB builds in an existing builder / image; I wasn't sure if that was a good idea so I added a new image
- I could build other crates like alloc into the rust-std component but, AFAICT, that would require calling Cargo a second time (one for alloc and one for compiler-builtins), or have alloc depend on compiler-builtins (#49503 will perform that change) *and* have alloc resurface the "c" and "mem" Cargo features.

r? @alexcrichton

6 years agoRollup merge of #49496 - glandium:master, r=sfackler
kennytm [Thu, 5 Apr 2018 08:51:21 +0000 (16:51 +0800)]
Rollup merge of #49496 - glandium:master, r=sfackler

Add more vec![... ; n] optimizations

vec![0; n], via implementations of SpecFromElem, has an optimization that uses with_capacity_zeroed instead of with_capacity, which will use calloc instead of malloc, and avoid an extra memset.

This PR adds the same optimization for ptr::null, ptr::null_mut, and None, when their in-memory representation is zeroes.

6 years agoRollup merge of #49432 - nabijaczleweli:master, r=michaelwoerister
kennytm [Thu, 5 Apr 2018 08:51:20 +0000 (16:51 +0800)]
Rollup merge of #49432 - nabijaczleweli:master, r=michaelwoerister

Flush executables to disk after linkage

A problem caused by not doing so in Chrome has been reported [here](https://randomascii.wordpress.com/2018/02/25/compiler-bug-linker-bug-windows-kernel-bug/amp/).

`File::sync_all()` calls `FlushFileBuffers()` down the line, causing potentially unflushed buffers on high I/O-load systems to flush and preventing nasty non-reproducible bugs.

Closes #48545

6 years agoRollup merge of #49345 - davidtwco:issue-44109, r=nikomatsakis
kennytm [Thu, 5 Apr 2018 08:51:19 +0000 (16:51 +0800)]
Rollup merge of #49345 - davidtwco:issue-44109, r=nikomatsakis

RFC 2008: Finishing Touches

Part of #44109.

r? @nikomatsakis
(not sure who was best for this PR).

6 years agoRollup merge of #49253 - chmanchester:probing_fix, r=alexcrichton
kennytm [Thu, 5 Apr 2018 08:51:18 +0000 (16:51 +0800)]
Rollup merge of #49253 - chmanchester:probing_fix, r=alexcrichton

Take the original extra-filename passed to a crate into account when resolving it as a dependency

resolving it as a dependency.

Fixes #46816

6 years agoRollup merge of #48658 - llogiq:no-more-cas, r=kennytm
kennytm [Thu, 5 Apr 2018 08:51:16 +0000 (16:51 +0800)]
Rollup merge of #48658 - llogiq:no-more-cas, r=kennytm

Add a generic CAS loop to std::sync::Atomic*

This adds two new methods to both `AtomicIsize` and `AtomicUsize` with optimized safe compare-and-set loops, so users will no longer need to write their own, except in *very* strange circumstances.

`update_and_fetch` will apply the function and return its result, whereas `fetch_and_update` will apply the function and return the previous value.

This solves #48384 with `x.update_and_fetch(|x| x.max(y))`. It also relates to #48655 (which I misuse as tracking issue for now)..

*note* This *might* need a crater run because the functions could clash with third party extension traits.

6 years agoAuto merge of #48851 - petrochenkov:genparattr, r=nikomatsakis
bors [Thu, 5 Apr 2018 07:31:56 +0000 (07:31 +0000)]
Auto merge of #48851 - petrochenkov:genparattr, r=nikomatsakis

Stabilize attributes on generic parameters

Closes https://github.com/rust-lang/rust/issues/48848

6 years agoAuto merge of #48709 - tinaun:issue48703, r=nikomatsakis
bors [Thu, 5 Apr 2018 05:04:27 +0000 (05:04 +0000)]
Auto merge of #48709 - tinaun:issue48703, r=nikomatsakis

remove erroneous error message when checking impl trait params

fixes #48703

6 years agoci: Remove x86_64-gnu-incremental builder
Alex Crichton [Thu, 5 Apr 2018 00:35:42 +0000 (17:35 -0700)]
ci: Remove x86_64-gnu-incremental builder

This builder is starting to time out frequently causing PRs to bounce and
otherwise doesn't seem to be catching too many bugs, so this commit removes it
entirely. We've had a number of timeouts in the last few weeks related to this
builder:

* https://travis-ci.org/rust-lang/rust/jobs/360947582
* https://travis-ci.org/rust-lang/rust/jobs/360464190
* https://travis-ci.org/rust-lang/rust/jobs/359946975
* https://travis-ci.org/rust-lang/rust/jobs/361213241
* https://travis-ci.org/rust-lang/rust/jobs/362346279
* https://travis-ci.org/rust-lang/rust/jobs/362072331

On a good run this builder takes about 2h15m, which is already too long for
Travis and the variable build times end up pushing it beyond the 3h limit
occasionally.

The timeouts here are somewhat expected in that an incrementally compiled rustc
compiler isn't optimized like a normal rustc, disallowing inlining between
codegen units and losing lots of optimization opportunities.

6 years agoAuto merge of #49587 - Bobo1239:master, r=nrc
bors [Thu, 5 Apr 2018 00:19:46 +0000 (00:19 +0000)]
Auto merge of #49587 - Bobo1239:master, r=nrc

Update RLS

Includes https://github.com/rust-lang-nursery/rls/pull/793 which fixes https://github.com/rust-lang-nursery/rls/issues/803.

6 years agoStabilize attributes on generic parameters
Vadim Petrochenkov [Thu, 8 Mar 2018 19:24:10 +0000 (22:24 +0300)]
Stabilize attributes on generic parameters

6 years agoUpdate RLS
Boris-Chengbiao Zhou [Mon, 2 Apr 2018 14:08:03 +0000 (16:08 +0200)]
Update RLS

6 years agoTweak doc comment expansion
Alex Crichton [Wed, 4 Apr 2018 21:27:53 +0000 (14:27 -0700)]
Tweak doc comment expansion

* Expand `!` tokens for inner doc comments
* Trim leading doc comment decoration in the string literal

Both of these should help bring the expansion inline with what `macro_rules!`
already does.

Closes #49655
Closes #49656

6 years agoAuto merge of #49642 - kennytm:rollup, r=kennytm
bors [Wed, 4 Apr 2018 21:12:18 +0000 (21:12 +0000)]
Auto merge of #49642 - kennytm:rollup, r=kennytm

Rollup of 25 pull requests

Successful merges:

 - #49179 (Handle future deprecation annotations )
 - #49512 (Add support for variant and types fields for intra links)
 - #49515 (fix targetted value background)
 - #49516 (Add missing anchor for union type fields)
 - #49532 (Add test for rustdoc ignore test)
 - #49533 (Add #[must_use] to a few standard library methods)
 - #49540 (Fix miri Discriminant() for non-ADT)
 - #49559 (Introduce Vec::resize_with method (see #41758))
 - #49570 (avoid IdxSets containing garbage above the universe length)
 - #49577 (Stabilize String::replace_range)
 - #49599 (Fix typo)
 - #49603 (Fix url for intra link provided method)
 - #49607 (Stabilize iterator methods in 1.27)
 - #49609 (run-pass/attr-stmt-expr: expand test cases)
 - #49612 (Fix "since" version for getpid feature.)
 - #49618 (Fix build error when compiling libcore for 16bit targets)
 - #49619 (tweak core::fmt docs)
 - #49637 (Stabilize parent_id())
 - #49639 (Update Cargo)
 - #49628 (Re-write the documentation index)
 - #49594 (Add some performance guidance to std::fs and std::io docs)
 - #49625 (miri: add public alloc_kind accessor)
 - #49634 (Add a test for the fix to issue #43058)
 - #49641 (Regression test for #46314)
 - #49547 (Unignore borrowck test)

Failed merges:

6 years agoAdd more features to rust_2018_preview
Manish Goregaokar [Wed, 4 Apr 2018 20:58:38 +0000 (13:58 -0700)]
Add more features to rust_2018_preview

6 years agocompile other no-std crates
Jorge Aparicio [Wed, 4 Apr 2018 20:42:56 +0000 (22:42 +0200)]
compile other no-std crates

6 years agoRevert "create a nostd crate"
Jorge Aparicio [Wed, 4 Apr 2018 20:23:33 +0000 (22:23 +0200)]
Revert "create a nostd crate"

This reverts commit 14768f9b636ef345320ded41da5e9f3da7af3a81.

6 years agoRollup merge of #49547 - Phlosioneer:44831-borrowck-remove-ignore, r=arielb1
kennytm [Wed, 4 Apr 2018 19:09:47 +0000 (03:09 +0800)]
Rollup merge of #49547 - Phlosioneer:44831-borrowck-remove-ignore, r=arielb1

Unignore borrowck test

Unignores a test that has been fixed.

See #44831

6 years agoRollup merge of #49641 - valff:decl-macro-illegal-copy, r=nikomatsakis
kennytm [Wed, 4 Apr 2018 18:05:57 +0000 (02:05 +0800)]
Rollup merge of #49641 - valff:decl-macro-illegal-copy, r=nikomatsakis

Regression test for #46314

#46314 is fixed by NLL. This PR adds a regression test for the bug. Intended for #47366.

6 years agoRollup merge of #49634 - lloydmeta:tests/issue-43058, r=nikomatsakis
kennytm [Wed, 4 Apr 2018 18:05:29 +0000 (02:05 +0800)]
Rollup merge of #49634 - lloydmeta:tests/issue-43058, r=nikomatsakis

Add a test for the fix to issue #43058

Followed the instructions laid out here https://github.com/rust-lang/rust/issues/43058#issuecomment-378389971

6 years agoRollup merge of #49625 - bjorn3:miri_access_memory_kind, r=oli-obk
kennytm [Wed, 4 Apr 2018 18:05:02 +0000 (02:05 +0800)]
Rollup merge of #49625 - bjorn3:miri_access_memory_kind, r=oli-obk

miri: add public alloc_kind accessor

6 years agoRollup merge of #49594 - mbrubeck:docs, r=steveklabnik
kennytm [Wed, 4 Apr 2018 18:04:16 +0000 (02:04 +0800)]
Rollup merge of #49594 - mbrubeck:docs, r=steveklabnik

Add some performance guidance to std::fs and std::io docs

Adds more documentation about performance to various "read" functions in `fs` and `io`, and to `BufReader`/`BufWriter`, with the goal of helping developers choose the best option for a given task.

6 years agoRollup merge of #49628 - steveklabnik:learn-use-master, r=QuietMisdreavus
kennytm [Wed, 4 Apr 2018 18:02:37 +0000 (02:02 +0800)]
Rollup merge of #49628 - steveklabnik:learn-use-master, r=QuietMisdreavus

Re-write the documentation index

The docs team has decided that we're framing resources in three ways:
"learning Rust," "using Rust," "mastering Rust." This is a more useful
split than "beginner/intermediate/advanced." As we add more resources
in the future, we expect "using Rust" to grow. "the bookshelf" as a
concept is great, but isn't really organized along these lines. As such,
this reorganizes the docs along these lines.

6 years agoRollup merge of #49639 - matklad:cargo, r=kennytm
kennytm [Wed, 4 Apr 2018 09:13:04 +0000 (17:13 +0800)]
Rollup merge of #49639 - matklad:cargo, r=kennytm

Update Cargo

This includes at least two notable changes:

  * a regression is fixed where Cargo would update index on every
    operation https://github.com/rust-lang/cargo/pull/5288
  * a new unstable `--out-dir` option is implemented
    https://github.com/rust-lang/cargo/pull/5203

6 years agoRollup merge of #49637 - tmccombs:parent-id-stabilize, r=sfackler
kennytm [Wed, 4 Apr 2018 09:07:30 +0000 (11:07 +0200)]
Rollup merge of #49637 - tmccombs:parent-id-stabilize, r=sfackler

Stabilize parent_id()

Fixes #46104

6 years agoAuto merge of #48171 - FraGag:doc-copy-clone-impls, r=nikomatsakis
bors [Wed, 4 Apr 2018 18:11:51 +0000 (18:11 +0000)]
Auto merge of #48171 - FraGag:doc-copy-clone-impls, r=nikomatsakis

Better document the implementors of Clone and Copy

There are two parts to this change. The first part is a change to the compiler and to the standard library (specifically, libcore) to allow implementations of `Clone` and `Copy` to be written for a subset of builtin types. By adding these implementations to libcore, they now show up in the documentation. This is a [breaking-change] for users of `#![no_core]`, because they will now have to supply their own copy of the implementations of `Clone` and `Copy` that were added in libcore.

The second part is purely a documentation change to document the other implementors of `Clone` and `Copy` that cannot be described in Rust code (yet) and are thus provided by the compiler.

Fixes #25893

6 years agocreate a nostd crate
Jorge Aparicio [Wed, 4 Apr 2018 17:24:57 +0000 (19:24 +0200)]
create a nostd crate

the goal is to build, in a single Cargo invocation, several no-std crates that we want to put in the
rust-std component of no-std targets. The nostd crate builds these crates:

- core
- compiler-builtin (with the "c" and "mem" features enabled)
- alloc
- std_unicode

6 years agoAuto merge of #48913 - Mark-Simulacrum:rustbuild-test, r=alexcrichton
bors [Wed, 4 Apr 2018 15:38:10 +0000 (15:38 +0000)]
Auto merge of #48913 - Mark-Simulacrum:rustbuild-test, r=alexcrichton

Add tests to rustbuild

In order to run tests, we cfg out various parts of rustbuild. Generally
speaking, these are filesystem and process-spawning operations. Then, rustbuild
is run "as normal" and the various steps that where run are retrieved from the
cache and checked against the expected results.

Note that this means that the current implementation primarily tests "what" we
build, but doesn't actually test that what we build *will* build. In other
words, it doesn't do any form of dependency verification for any crate. This is
possible to implement, but is considered future work.

This implementation strives to cfg out as little code as possible; it also does
not currently test anywhere near all of rustbuild. The current tests are also
not checked for "correctness," rather, they simply represent what we do as of
this commit, which may be wrong.

Test cases are drawn from the old implementation of rustbuild, though the
expected results may vary.

r? @alexcrichton

6 years agoUpdated codeblocks to specify language where required.
David Wood [Wed, 4 Apr 2018 15:09:58 +0000 (16:09 +0100)]
Updated codeblocks to specify language where required.

6 years agoDocumenting private items in compiler docs.
David Wood [Wed, 4 Apr 2018 15:09:01 +0000 (16:09 +0100)]
Documenting private items in compiler docs.

6 years agoFix anchors issue when everything is collapsed
Guillaume Gomez [Wed, 4 Apr 2018 14:16:53 +0000 (16:16 +0200)]
Fix anchors issue when everything is collapsed

6 years agomiri: add public alloc_kind accessor
bjorn3 [Tue, 3 Apr 2018 15:50:31 +0000 (17:50 +0200)]
miri: add public alloc_kind accessor

6 years agoRollup merge of #49619 - durka:patch-46, r=steveklabnik
kennytm [Wed, 4 Apr 2018 09:07:28 +0000 (11:07 +0200)]
Rollup merge of #49619 - durka:patch-46, r=steveklabnik

tweak core::fmt docs

Remove an outdated (pre-1.0!) claim about passing something or other to a function. Also swap the variable names in the example.

6 years agoRollup merge of #49618 - pftbest:fix_warning, r=SimonSapin
kennytm [Wed, 4 Apr 2018 09:07:27 +0000 (11:07 +0200)]
Rollup merge of #49618 - pftbest:fix_warning, r=SimonSapin

Fix build error when compiling libcore for 16bit targets

Fixes #49617

cc @SimonSapin

6 years agoRollup merge of #49612 - tmccombs:stabilize-getpid, r=kennytm
kennytm [Wed, 4 Apr 2018 09:07:26 +0000 (11:07 +0200)]
Rollup merge of #49612 - tmccombs:stabilize-getpid, r=kennytm

Fix "since" version for getpid feature.

It was stabilized right before the beta branch was cut for 1.26.0.

See https://github.com/rust-lang/rust/pull/49523#issuecomment-377996315

This will need to be backported to beta (1.26.0)