Commit Graph

75031 Commits

Author SHA1 Message Date
Guillaume Gomez
89f4f1bca1 Fix anchor not always being put at the right place 2018-03-09 17:45:44 +01:00
Guillaume Gomez
9e0ccc5a47 Fix escape not working when searchbar selected 2018-03-09 17:45:44 +01:00
Guillaume Gomez
6235ef0422 Add missing items in the sidebar for functions 2018-03-09 17:45:44 +01:00
Guillaume Gomez
a628543891 Don't generate '[+]'/'[-]' on 'empty' traits 2018-03-05 23:39:34 +01:00
bors
e2746d8700 Auto merge of #48736 - alexcrichton:fix-rust-src, r=3
Include stdsimd in rust-src component

Closes #48734
2018-03-04 22:24:20 +00:00
Alex Crichton
2f2ac9ac47 Include stdsimd in rust-src component
Closes #48734
2018-03-04 12:13:21 -08:00
bors
259e4a6784 Auto merge of #48592 - spastorino:borrowed_value_error, r=nikomatsakis
[NLL] Avoid borrowed value must be valid for lifetime '_#2r..." in errors

Closes #48428

- [x] If NLL is enabled, [do not invoke `note_and_explain_region`](https://github.com/rust-lang/rust/issues/48428#issuecomment-367691123)
- [x] Modify `-Zdump-nll-cause` to not print [the overwhelming debug output here](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/borrow_check/nll/region_infer/mod.rs#L1288-L1299). This way we should I believe at least get nice-ish output for [our original example](https://github.com/rust-lang/rust/issues/48428#issue-299364536).
- [x] Extend `explain_why_borrow_contains_point` to also work for "universal lifetimes" like the `'a` in [the example at the end of this comment](https://github.com/rust-lang/rust/issues/48428#issuecomment-367691123).
- [ ] Figure out how to enable causal information all the time (but that is https://github.com/rust-lang/rust/issues/46590).
2018-03-04 18:16:43 +00:00
bors
1e1bfc715f Auto merge of #47832 - fintelia:vec-index, r=kennytm
Have Vec use slice's implementations of Index<I> and IndexMut<I>

This PR simplifies the implementation of Index and IndexMut on Vec, and in the process enables indexing Vec by any user types that implement SliceIndex.

The stability annotations probably need to be changed, but I wasn't sure of the right way to do that. It also wasn't completely clear to me if this change could break any existing code.
2018-03-04 12:30:27 +00:00
bors
9ff5cb5aea Auto merge of #48587 - Zoxc:transitive-relation, r=nikomatsakis
Make TransitiveRelation thread safe. Avoid locking by using get_mut in some cases

r? @nikomatsakis
2018-03-04 09:41:32 +00:00
bors
4a316e7483 Auto merge of #48630 - alexcrichton:more-sccache, r=kennytm
rustbuild: Pass `ccache` to build scripts

This is a re-attempt at #48192 hopefully this time with 100% less randomly
[blocking builds for 20 minutes][block]. To work around #48192 the sccache
server is started in the `run.sh` script very early on in the compilation
process.

[block]: https://github.com/rust-lang/rust/issues/48192
2018-03-04 07:09:41 +00:00
bors
4a7206323b Auto merge of #48125 - alexcrichton:lld, r=Mark-Simulacrum
rust: Import LLD for linking wasm objects

This commit imports the LLD project from LLVM to serve as the default linker for
the `wasm32-unknown-unknown` target. The `binaryen` submoule is consequently
removed along with "binaryen linker" support in rustc.

Moving to LLD brings with it a number of benefits for wasm code:

* LLD is itself an actual linker, so there's no need to compile all wasm code
  with LTO any more. As a result builds should be *much* speedier as LTO is no
  longer forcibly enabled for all builds of the wasm target.
* LLD is quickly becoming an "official solution" for linking wasm code together.
  This, I believe at least, is intended to be the main supported linker for
  native code and wasm moving forward. Picking up support early on should help
  ensure that we can help LLD identify bugs and otherwise prove that it works
  great for all our use cases!
* Improvements to the wasm toolchain are currently primarily focused around LLVM
  and LLD (from what I can tell at least), so it's in general much better to be
  on this bandwagon for bugfixes and new features.
* Historical "hacks" like `wasm-gc` will soon no longer be necessary, LLD
  will [natively implement][gc] `--gc-sections` (better than `wasm-gc`!) which
  means a postprocessor is no longer needed to show off Rust's "small wasm
  binary size".

LLD is added in a pretty standard way to rustc right now. A new rustbuild target
was defined for building LLD, and this is executed when a compiler's sysroot is
being assembled. LLD is compiled against the LLVM that we've got in tree, which
means we're currently on the `release_60` branch, but this may get upgraded in
the near future!

LLD is placed into rustc's sysroot in a `bin` directory. This is similar to
where `gcc.exe` can be found on Windows. This directory is automatically added
to `PATH` whenever rustc executes the linker, allowing us to define a `WasmLd`
linker which implements the interface that `wasm-ld`, LLD's frontend, expects.

Like Emscripten the LLD target is currently only enabled for Tier 1 platforms,
notably OSX/Windows/Linux, and will need to be installed manually for compiling
to wasm on other platforms. LLD is by default turned off in rustbuild, and
requires a `config.toml` option to be enabled to turn it on.

Finally the unstable `#![wasm_import_memory]` attribute was also removed as LLD
has a native option for controlling this.

[gc]: https://reviews.llvm.org/D42511
2018-03-04 04:22:39 +00:00
Alex Crichton
0129b01a41 rustc: Tweak default linker selection
This commit refactors how the path to the linker that we're going to invoke is
selected. Previously all targets listed *both* a `LinkerFlavor` and a `linker`
(path) option, but this meant that whenever you changed one you had to change
the other. The purpose of this commit is to avoid coupling these where possible.

Target specifications now only unconditionally define the *flavor* of the linker
that they're using by default. If not otherwise specified each flavor now
implies a particular default linker to run. As a result, this means that if
you'd like to test out `ld` for example you should be able to do:

    rustc -Z linker-flavor=ld foo.rs

whereas previously you had to do

    rustc -Z linker-flavor=ld -C linker=ld foo.rs

This will hopefully make it a bit easier to tinker around with variants that
should otherwise be well known to work, for example with LLD, `ld` on OSX, etc.
2018-03-03 20:21:35 -08:00
Alex Crichton
d69b24805b rust: Import LLD for linking wasm objects
This commit imports the LLD project from LLVM to serve as the default linker for
the `wasm32-unknown-unknown` target. The `binaryen` submoule is consequently
removed along with "binaryen linker" support in rustc.

Moving to LLD brings with it a number of benefits for wasm code:

* LLD is itself an actual linker, so there's no need to compile all wasm code
  with LTO any more. As a result builds should be *much* speedier as LTO is no
  longer forcibly enabled for all builds of the wasm target.
* LLD is quickly becoming an "official solution" for linking wasm code together.
  This, I believe at least, is intended to be the main supported linker for
  native code and wasm moving forward. Picking up support early on should help
  ensure that we can help LLD identify bugs and otherwise prove that it works
  great for all our use cases!
* Improvements to the wasm toolchain are currently primarily focused around LLVM
  and LLD (from what I can tell at least), so it's in general much better to be
  on this bandwagon for bugfixes and new features.
* Historical "hacks" like `wasm-gc` will soon no longer be necessary, LLD
  will [natively implement][gc] `--gc-sections` (better than `wasm-gc`!) which
  means a postprocessor is no longer needed to show off Rust's "small wasm
  binary size".

LLD is added in a pretty standard way to rustc right now. A new rustbuild target
was defined for building LLD, and this is executed when a compiler's sysroot is
being assembled. LLD is compiled against the LLVM that we've got in tree, which
means we're currently on the `release_60` branch, but this may get upgraded in
the near future!

LLD is placed into rustc's sysroot in a `bin` directory. This is similar to
where `gcc.exe` can be found on Windows. This directory is automatically added
to `PATH` whenever rustc executes the linker, allowing us to define a `WasmLd`
linker which implements the interface that `wasm-ld`, LLD's frontend, expects.

Like Emscripten the LLD target is currently only enabled for Tier 1 platforms,
notably OSX/Windows/Linux, and will need to be installed manually for compiling
to wasm on other platforms. LLD is by default turned off in rustbuild, and
requires a `config.toml` option to be enabled to turn it on.

Finally the unstable `#![wasm_import_memory]` attribute was also removed as LLD
has a native option for controlling this.

[gc]: https://reviews.llvm.org/D42511
2018-03-03 20:21:35 -08:00
bors
0be38e1ce3 Auto merge of #48600 - Mark-Simulacrum:rustbuild-updates-2, r=alexcrichton
Remove --host and --target arguments to configure in Dockerfiles

These arguments are passed to the relevant x.py invocation in all cases
anyway. As such, there is no need to separately configure them. x.py
will ignore the configuration when they are passed on the command line
anyway.

r? @alexcrichton
2018-03-04 01:32:57 +00:00
bors
e026b59cf4 Auto merge of #48694 - kennytm:rollup, r=kennytm
Rollup of 8 pull requests

- Successful merges: #48283, #48466, #48569, #48629, #48637, #48680, #48513, #48664
- Failed merges:
2018-03-03 19:40:21 +00:00
kennytm
ea354b6a01
Rollup merge of #48664 - Keruspe:codegen, r=alexcrichton
make codegen-backends directory name configurable

This allows to parallel-install several versions of rust system-wide
Fixes #48263
2018-03-04 02:18:25 +08:00
kennytm
6f07aaa428
Rollup merge of #48513 - alexcrichton:simd, r=JoshTriplett
std: Add `arch` and `simd` modules

This commit imports the `stdsimd` crate into the standard library,
creating an `arch` and `simd` module inside of both libcore and libstd.
Both of these modules are **unstable** and will continue to be so until
RFC 2335 is stabilized.

As a brief recap, the modules are organized as so:

* `arch` contains all current architectures with intrinsics, for example
  `std::arch::x86`, `std::arch::x86_64`, `std::arch::arm`, etc. These
  modules contain all of the intrinsics defined for the platform, like
  `_mm_set1_epi8`.
* In the standard library, the `arch` module also exports a
  `is_target_feature_detected` macro which performs runtime detection to
  determine whether a target feature is available at runtime.
* The `simd` module contains experimental versions of strongly-typed
  lane-aware SIMD primitives, to be fully fleshed out in a future RFC.

The main purpose of this commit is to start pulling in all these
intrinsics and such into the standard library on nightly and allow
testing and such. This'll help allow users to easily kick the tires and
see if intrinsics work as well as allow us to test out all the
infrastructure for moving the intrinsics into the standard library.
2018-03-04 02:17:38 +08:00
kennytm
e71c96fab9
Rollup merge of #48680 - steveklabnik:no-toc, r=nikomatsakis
Don't produce TOCs for doc markdown files

Currently, we are producing headers for markdown files,
which is generally not what we want. As such, passing this
flag causes them to render normally.

https://doc.rust-lang.org/nightly/book/ is an example page currently where this is done incorrectly.
2018-03-04 02:17:36 +08:00
bors
3b8bd530b0 Auto merge of #48583 - dotdash:jt_assume, r=alexcrichton
Backport LLVM fixes for a JumpThreading / assume intrinsic bug

This fixes the original cause of #48116 and restores the assume intrinsic that was removed as a workaround.

r? @alexcrichton
2018-03-03 14:09:56 +00:00
kennytm
fb411d86c6
Rollup merge of #48637 - segevfiner:restore-rust-mingw-download, r=alexcrichton
Restore the download of rust-mingw

The build might otherwise break due to mixing MinGW object files from rust-std and the local MinGW which might be newer/older than the version used to build rust-std.

Fixes #48272

r? @alexcrichton
2018-03-03 18:45:47 +08:00
kennytm
ad1cc0c1bc
Rollup merge of #48629 - strake:char, r=alexcrichton
impl Clone for ::std_unicode::char::{ToLowercase, ToUppercase}
2018-03-03 18:45:46 +08:00
kennytm
14b6262fde
Rollup merge of #48569 - Phlosioneer:x-py-help-optimization, r=petrochenkov
Improve --help performance for x.py

Since compiling the bootstrap command doesn't require any submodules,
we can skip updating submodules when a --help command is passed in.
On my machine, this saves 1 minute if the submodules are already
downloaded, and 10 minutes if run on a clean repo.

This commit also adds a message before compiling/downloading anything
when a --help command is passed in, to tell the user WHY --help
takes so long to complete. It also points the user to the bootstrap
README.md for faster help.

Finally, this fixes one warning message that still referenced using
make instead of x.py, even though x.py is now the standard way of
building rust.

Closes #37305
2018-03-03 18:45:45 +08:00
kennytm
ae6fe8f283
Rollup merge of #48466 - sanxiyn:no-neon, r=alexcrichton
Disable NEON on musl ARMv7

`armv7-unknown-linux-musleabihf` target diverged a bit from `armv7-unknown-linux-gnueabihf` target. This PR re-syncs them.

Fix #47765.
2018-03-03 18:45:44 +08:00
kennytm
65f48a4edf
Rollup merge of #48283 - QuietMisdreavus:rustdoc-readme, r=@GuillaumeGomez
add readme for librustdoc

In the same vein as the other compiler-library readmes, here's one for rustdoc! It's mainly a "how does rustdoc even" blog-post-style writeup, but i wanted to have something in-repo so people could get a sense of what bits did what.
2018-03-03 18:45:42 +08:00
bors
c9b86a9178 Auto merge of #48689 - Manishearth:rollup, r=Manishearth
Rollup (unsupervised)

less risky PRs, to run overnight
2018-03-03 07:24:11 +00:00
Manish Goregaokar
40d2a98503
Rollup merge of #48641 - alexcrichton:no-hash-l-paths, r=michaelwoerister
Fixes #47311.
r? @nrc
2018-03-02 22:01:31 -08:00
Manish Goregaokar
3fa4bff31b
Rollup merge of #48635 - scottmcm:faster-zip-nth, r=kennytm
Fixes #47311.
r? @nrc
2018-03-02 22:01:29 -08:00
Manish Goregaokar
6fa14f0e5f
Rollup merge of #48628 - strake:reverse, r=sfackler
Fixes #47311.
r? @nrc
2018-03-02 22:01:27 -08:00
Manish Goregaokar
8c7c8fb212
Rollup merge of #48338 - estebank:match-missing-comma, r=petrochenkov
Fixes #47311.
r? @nrc
2018-03-02 22:01:23 -08:00
Manish Goregaokar
8bf026df5b
Rollup merge of #48328 - frewsxcv:frewsxcv-clarify-error-zero-duration, r=sfackler
Fixes #47311.
r? @nrc
2018-03-02 22:01:20 -08:00
Manish Goregaokar
65253fd2eb
Rollup merge of #48259 - tinaun:patch-1, r=alexcrichton
Fixes #47311.
r? @nrc
2018-03-02 22:01:16 -08:00
Manish Goregaokar
85a6b928aa
Rollup merge of #48477 - Manishearth:dyn-trait-fixes, r=nmatsakis
Fixes #47311.
r? @nrc
2018-03-02 22:01:04 -08:00
Manish Goregaokar
40f218f703 Remove allow(bare_trait_object) from librustc_mir 2018-03-02 21:02:37 -08:00
Manish Goregaokar
3c95814294 Perform manual fixups 2018-03-02 21:02:37 -08:00
Manish Goregaokar
8d730ed527 Run Rustfix on librustc_mir 2018-03-02 21:02:37 -08:00
Manish Goregaokar
fb7980d796 Remove allow(bare_trait_object) from librustc 2018-03-02 21:02:36 -08:00
Manish Goregaokar
f3cb962f63 Perform manual fixups 2018-03-02 21:02:36 -08:00
Manish Goregaokar
69c53ac904 Run Rustfix on librustc 2018-03-02 21:02:34 -08:00
bors
5f1f628765 Auto merge of #48666 - sgrif:sg-revert-perf-regression, r=nikomatsakis
Revert "correct subtle bug in the type variable code"

This reverts commit ccd92c2a4e.

This commit is the source of a major perf regression, and was not
intended to be included in #47861. At some point I must have
accidentally re-added the commit.

Fixes #48660.

r? @nikomatsakis
2018-03-03 04:54:28 +00:00
Jonathan Behrens
370df40dab Don't have Vec<T> delegate to [T]'s bounds for indexing 2018-03-02 23:25:52 -05:00
Jonathan Behrens
ae73a21081 Update compile fail test error messages 2018-03-02 23:25:52 -05:00
Jonathan Behrens
45bdf9cbee Update comments 2018-03-02 23:25:52 -05:00
Jonathan Behrens
2db05f04be Update UI test 2018-03-02 23:25:52 -05:00
Jonathan Behrens
46fef766b0 Have Vec use slice's implementations of Index<I> and IndexMut<I> 2018-03-02 23:25:52 -05:00
bors
e8af0f4c1f Auto merge of #48586 - Zoxc:atomic-rc, r=michaelwoerister
Replace Rc with Lrc for shared data

This replaces `Rc`s reachable from `TyCtxt` with `Lrc`. This has no effect unless `cfg(parallel_queries)` is set. It also contains a fix for the `Decodable` impl for `Arc`.

r? @nikomatsakis
2018-03-03 02:02:45 +00:00
tinaun
1011b8a3f1 Stabilize Unsafe Pointer Methods
also minor doc fixes.

Closes #43941
2018-03-02 19:20:36 -05:00
Alex Crichton
c72537f204 std: Add arch and simd modules
This commit imports the `stdsimd` crate into the standard library,
creating an `arch` and `simd` module inside of both libcore and libstd.
Both of these modules are **unstable** and will continue to be so until
RFC 2335 is stabilized.

As a brief recap, the modules are organized as so:

* `arch` contains all current architectures with intrinsics, for example
  `std::arch::x86`, `std::arch::x86_64`, `std::arch::arm`, etc. These
  modules contain all of the intrinsics defined for the platform, like
  `_mm_set1_epi8`.
* In the standard library, the `arch` module also exports a
  `is_target_feature_detected` macro which performs runtime detection to
  determine whether a target feature is available at runtime.
* The `simd` module contains experimental versions of strongly-typed
  lane-aware SIMD primitives, to be fully fleshed out in a future RFC.

The main purpose of this commit is to start pulling in all these
intrinsics and such into the standard library on nightly and allow
testing and such. This'll help allow users to easily kick the tires and
see if intrinsics work as well as allow us to test out all the
infrastructure for moving the intrinsics into the standard library.
2018-03-02 14:34:07 -08:00
steveklabnik
900d511fdc Don't produce TOCs for doc markdown files
Currently, we are producing headers for markdown files,
which is generally not what we want. As such, passing this
flag causes them to render normally.
2018-03-02 13:52:13 -05:00
Mark Simulacrum
ab7ce1c3c4 Remove --host and --target arguments to configure
These arguments are passed to the relevant x.py invocation in all cases
anyway. As such, there is no need to separately configure them. x.py
will ignore the configuration when they are passed on the command line
anyway.
2018-03-02 11:28:29 -07:00
Sean Griffin
f5f53e9677 Revert "correct subtle bug in the type variable code"
This reverts commit ccd92c2a4e.

This commit is the source of a major perf regression, and was not
intended to be included in #47861. At some point I must have
accidentally re-added the commit.
2018-03-02 06:52:12 -07:00