Commit Graph

422 Commits

Author SHA1 Message Date
Marc-Antoine Perennou 90e54f4340 update openssl{,-sys} to fix build with libressl 2.6.x
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-11-17 20:40:25 +01:00
Oliver Schneider 5319203aa3
Reenable clippy testing 2017-11-15 10:42:47 +01:00
bors 4b6f7252a1 Auto merge of #45902 - nrc:component-update, r=alexcrichton
Update RLS and Rustfmt

r? @alexcrichton
2017-11-12 12:20:07 +00:00
kennytm 2c4a0a78b8 Rollup merge of #45783 - kennytm:compiler-test-fixes, r=alexcrichton
Miscellaneous changes for CI, Docker and compiletest.

This PR contains 7 independent commits that improves interaction with CI, Docker and compiletest.

1. a4e5c91cb8 — Forces a newline every 100 dots when testing in quiet mode. Prevents spurious timeouts when abusing the CI to test Android jobs.

2. 1b5aaf22e8 — Use vault.centos.org for dist-powerpc64le-linux, see #45744.

3. 33400fbbcd — Modify `src/ci/docker/run.sh` so that the docker images can be run from Docker Toolbox for Windows on Windows 7. I haven't checked the behavior of the newer Docker for Windows on Windows 10. Also, "can run" does not mean all the test can pass successfully (the UDP tests failed last time I checked)

4. d517668a08 — Don't emit a real warning the linker segfault, which affects UI tests like https://github.com/rust-lang/rust/pull/45489#issuecomment-340134944. Log it instead.

5. 51e2247948 — During run-pass, trim the output if stdout/stderr exceeds 416 KB (top 160 KB + bottom 256 KB). This is an attempt to avoid spurious failures like https://github.com/rust-lang/rust/pull/45384#issuecomment-341755788

6. 9cfdabaf3c — Force `gem update --system` before deploy. This is an attempt to prevent spurious error #44159.

7. eee10cc482 — Tries to print the crash log on macOS on failure. This is an attempt to debug #45230.
2017-11-10 17:07:04 +08:00
Nick Cameron 2afc039a5d Update RLS submodule 2017-11-10 17:53:46 +13:00
Nick Cameron 12da5a4b11 Update rustfmt submodule 2017-11-10 13:53:28 +13:00
Alex Crichton 6bc8f164b0 std: Remove `rand` crate and module
This commit removes the `rand` crate from the standard library facade as
well as the `__rand` module in the standard library. Neither of these
were used in any meaningful way in the standard library itself. The only
need for randomness in libstd is to initialize the thread-local keys of
a `HashMap`, and that unconditionally used `OsRng` defined in the
standard library anyway.

The cruft of the `rand` crate and the extra `rand` support in the
standard library makes libstd slightly more difficult to port to new
platforms, namely WebAssembly which doesn't have any randomness at all
(without interfacing with JS). The purpose of this commit is to clarify
and streamline randomness in libstd, focusing on how it's only required
in one location, hashmap seeds.

Note that the `rand` crate out of tree has almost always been a drop-in
replacement for the `rand` crate in-tree, so any usage (accidental or
purposeful) of the crate in-tree should switch to the `rand` crate on
crates.io. This then also has the further benefit of avoiding
duplication (mostly) between the two crates!
2017-11-08 20:41:17 -08:00
Robin Kruppe 0d6b52c2f3 Saturating casts between integers and floats (both directions).
This affects regular code generation as well as constant evaluation in trans,
but not the HIR constant evaluator because that one returns an error for
overflowing casts and NaN-to-int casts. That error is conservatively
correct and we should be careful to not accept more code in constant
expressions.
The changes to code generation are guarded by a new -Z flag, to be able
to evaluate the performance impact. The trans constant evaluation changes
are unconditional because they have no run time impact and don't affect
type checking either.
2017-11-07 20:13:19 +01:00
Dustin Speckhals d0c1f36771 tools: Fix rustfmt and the RLS
These tools have been corrected in their upstream repo's, and the
submodules have been updated here to reflect that. I also had to update
Cargo to match what the RLS is expecting.

The tool states for `rustfmt` and `rls` where both changed from "Broken"
to "Testing" in this commit, thus enabling testing and distribution
again.
2017-11-06 13:03:06 -05:00
bors 44990e5b14 Auto merge of #45770 - spastorino:newtype_index, r=nikomatsakis
Make last structs indexes definitions use newtype_index macro

This PR makes the last two index structs not using newtype_index macro to use it and also fixes this https://github.com/rust-lang/rust/issues/45763 issue.
2017-11-05 22:06:15 +00:00
kennytm 51e2247948
Abbreviate some stdout/stderr output in compiletest.
This is intended to prevent the spurious OOM error from
run-pass/rustc-rust-log.rs, by skipping the output in the middle when the
size is over 416 KB, so that the log output will not be overwhelmed.
2017-11-06 03:53:41 +08:00
bors 12e6b53744 Auto merge of #45711 - tirr-c:unicode-span, r=estebank
Display spans correctly when there are zero-width or wide characters

Hopefully...
* fixes #45211
* fixes #8706

---

Before:
```
error: invalid width `7` for integer literal
  --> unicode_2.rs:12:25
   |
12 |     let _ = ("a̐éö̲", 0u7);
   |                         ^^^
   |
   = help: valid widths are 8, 16, 32, 64 and 128

error: invalid width `42` for integer literal
  --> unicode_2.rs:13:20
   |
13 |     let _ = ("아あ", 1i42);
   |                    ^^^^
   |
   = help: valid widths are 8, 16, 32, 64 and 128

error: aborting due to 2 previous errors
```

After:
```
error: invalid width `7` for integer literal
  --> unicode_2.rs:12:25
   |
12 |     let _ = ("a̐éö̲", 0u7);
   |                     ^^^
   |
   = help: valid widths are 8, 16, 32, 64 and 128

error: invalid width `42` for integer literal
  --> unicode_2.rs:13:20
   |
13 |     let _ = ("아あ", 1i42);
   |                      ^^^^
   |
   = help: valid widths are 8, 16, 32, 64 and 128

error: aborting due to 2 previous errors
```

Spans might display incorrectly on the browser.

r? @estebank
2017-11-04 23:09:19 +00:00
Santiago Pastorino d19faead2d Make DefIndex use newtype_index macro 2017-11-04 19:22:37 -03:00
Wonwoo Choi 272c2faa1d Display spans correctly when there are non-half-width characters 2017-11-03 03:15:39 +09:00
bors 2379faa933 Auto merge of #45468 - Xanewok:crate-source, r=nrc
Emit crate disambiguators in save-analysis data

Needed for https://github.com/nrc/rls-analysis/issues/93.
Blocked by https://github.com/nrc/rls-data/pull/11. (For now, this pulls my branch [rls-data/crate-source](https://github.com/Xanewok/rls-data/tree/crate-source))

This will allow to disambiguate different crates types/versions when indexing resulting save-analysis data (most importantly allow to support bin+lib and different crate versions).

r? @nrc
2017-11-02 03:36:50 +00:00
Igor Matuszewski b4ffedee67 Update rls so it compiles with #45468 2017-11-01 00:48:26 +01:00
bors 90ef3372e8 Auto merge of #45597 - DSpeckhals:rustfmt-update, r=nrc
tools: Update rustfmt and re-enable testing

This allows rustfmt and the RLS to test and compile again.
2017-10-29 21:25:12 +00:00
Dustin Speckhals e3bf19d8d4 Update rustfmt again 2017-10-29 15:16:02 -04:00
Manish Goregaokar 84f1fc951d
Update clippy 2017-10-29 05:27:36 -04:00
Dustin Speckhals 1156455d42 Update rustfmt
This allows rustfmt and the RLS to test and compile again.
2017-10-28 13:46:43 -04:00
kennytm b644339a16 Rollup merge of #45421 - QuietMisdreavus:update-pulldown, r=steveklabnik
rustdoc: update pulldown + fix spurious rendering difference around footnotes

fixes #45420
2017-10-28 15:56:19 +08:00
Igor Matuszewski 45fa7b26e8 Use rls-data 0.12 2017-10-27 23:53:57 +02:00
bors d9f1249655 Auto merge of #45285 - alexcrichton:update-bootstrap, r=Mark-Simulacrum
Bump to 1.23 and update bootstrap

This commit updates the bootstrap compiler, bumps the version to 1.23, updates
Cargo, updates books, and updates crates.io dependencies
2017-10-27 18:00:32 +00:00
Alex Crichton ca18537197 Bump to 1.23 and update bootstrap
This commit updates the bootstrap compiler, bumps the version to 1.23, updates
Cargo, updates books, and updates crates.io dependencies
2017-10-26 13:59:18 -07:00
bors b218a02ad8 Auto merge of #45519 - michaelwoerister:dedup-errors, r=arielb1
Don't emit the same compiler diagnostic twice.

This PR makes the compiler filter out diagnostic messages that have already been emitted during the same compilation session.
2017-10-26 18:16:15 +00:00
Michael Woerister 6fccd71f75 librustc_errors: Don't emit the same error message twice. 2017-10-25 15:01:06 +02:00
Dustin Speckhals bca47e42b2 Merge branch 'master' into update-rls-data-for-save-analysis 2017-10-24 19:37:15 -04:00
leonardo.yvens 19aa23b6d3 Remove deprecated `collections` crate.
This reverts commit 6484258f17.
2017-10-22 14:55:02 -02:00
bors 5481098274 Auto merge of #45423 - durka:update-jobserver, r=Mark-Simulacrum
update jobserver version to work around macos bug

Update `jobserver` crate to fix rust-lang/cargo#4643, a panic which can't happen according to `libc::poll`'s man page but was nevertheless reported on macOS 10.9 and 10.10.

r? @alexcrichton
2017-10-22 03:13:16 +00:00
QuietMisdreavus 4fdd6299b0 rustdoc: update pulldown renderer
fixes #45420
2017-10-21 13:27:06 -05:00
Corey Farwell c96db06e5b Rollup merge of #45411 - oli-obk:clippy, r=Manishearth
Reactivate clippy in toolstate.toml

The `Cargo.lock` changes are b/c clippy is not its own workspace anymore, but is part of the main workspace

r? @Manishearth
2017-10-21 09:47:23 -04:00
Dustin Speckhals 69ba6738eb Use newest version of RLS and rustfmt 2017-10-20 18:57:06 -04:00
Alex Burka ff0e9df152 update jobserver version to work around macos bug 2017-10-20 18:35:18 -04:00
Oliver Schneider 2812865664
Reactivate clippy in toolstate.toml 2017-10-20 16:01:30 +02:00
bjorn3 906523efea Move collector to rustc_trans_utils 2017-10-19 11:01:31 +02:00
bors fdec805d03 Auto merge of #45283 - alexcrichton:used-mut-nodes, r=arielb1
rustc: Remove `used_mut_nodes` from `TyCtxt`

This updates the borrowck query to return a result, and this result is then used
to incrementally check for unused mutable nodes given sets of all the used
mutable nodes.

Closes #42384
2017-10-16 03:02:05 +00:00
Vadim Petrochenkov 9e0fc5ccd0 rustbuild: Support specifying archiver and linker explicitly 2017-10-15 22:10:07 +03:00
bors 6c0d50f9fa Auto merge of #45224 - malbarbo:x32, r=alexcrichton
Add x86_64-unknown-linux-gnux32 target

This adds X32 ABI support for Linux on X86_64. Let's package and dist it so we can star testing libc, libstd, etc.

Fixes https://github.com/rust-lang/rfcs/issues/1339
2017-10-15 06:12:13 +00:00
Alex Crichton 4df1278c69 rustc: Remove `used_mut_nodes` from `TyCtxt`
This updates the borrowck query to return a result, and this result is then used
to incrementally check for unused mutable nodes given sets of all the used
mutable nodes.

Closes #42384
2017-10-14 09:29:02 -07:00
kennytm 81ea49f244
Rollup merge of #45049 - alexcrichton:update-jobserver, r=sfackler
Update the `jobserver` crate

Brings in a bugfix to be compatible with the master branch of `make` where
jobserver fds are set in nonblocking mode
2017-10-13 01:58:40 +08:00
Marco A L Barbosa 03419c846a Bump cc to 1.01 to include x86_64-unknown-linux-gnux32 support 2017-10-11 21:35:53 -03:00
Dustin Speckhals 218103ef5a Update rustfmt along with rls 2017-10-11 12:00:29 -04:00
Dustin Speckhals dcb915e774 Update rls submodule 2017-10-07 16:54:00 -04:00
Dustin Speckhals 57d0410f60 Update rls-data for librustc-save-analysis
0.10 -> 0.11

This will allow for more fine-grained save analysis for enum variants
(tuple and struct)
2017-10-07 16:12:51 -04:00
Alex Crichton 47fc913e56 Update the `jobserver` crate
Brings in a bugfix to be compatible with the master branch of `make` where
jobserver fds are set in nonblocking mode
2017-10-05 12:34:52 -07:00
Santiago Pastorino c8549a1586 Generate Idx in nll using newtype_index! 2017-10-04 23:50:53 -03:00
steveklabnik 1bbf41da6f update mdbook
Fixes #44704
2017-10-02 10:16:32 -04:00
est31 4114d68f18 Update the libcompiler_builtins submodule 2017-09-30 01:45:21 +02:00
Oliver Schneider ea35192d7c
Adjust imports to librustc::mir::interpret 2017-09-29 12:54:39 +02:00
Alex Crichton 7694ca419b Update to the `cc` crate
This is the name the `gcc` crate has moved to
2017-09-28 07:45:50 -07:00
Alex Crichton 041d3550f6 Update some minor dependencies 2017-09-27 15:40:57 -07:00
Nick Cameron 71a0be0792 Update the RLS again 2017-09-27 15:40:57 -07:00
Nick Cameron c5cad5a78d Update RLS and Rustfmt 2017-09-27 15:40:57 -07:00
bors 0e6f4cf51c Auto merge of #44709 - Badel2:inclusive-range-dotdoteq, r=petrochenkov
Initial support for `..=` syntax

#28237

This PR adds `..=` as a synonym for `...` in patterns and expressions.
Since `...` in expressions was never stable, we now issue a warning.

cc @durka
r? @aturon
2017-09-27 16:04:31 +00:00
Badel2 5102309b1f bump rustfmt 2017-09-26 20:57:13 +02:00
bjorn3 18005203e1 Remove now unused dependency on flate2 from rustc_driver 2017-09-23 15:27:54 +02:00
bjorn3 e130ccc54e Fix for upstream changes 2017-09-23 14:46:15 +02:00
bjorn3 d703552325 Merge rustc_trans_trait into rustc_trans_utils 2017-09-23 13:00:28 +02:00
bjorn3 9eeaba18bd Move NoLlvmMetadataLoader to rustc_trans_traits 2017-09-23 13:00:25 +02:00
bjorn3 44c184382f Add TransCrate trait 2017-09-23 12:59:46 +02:00
bjorn3 89af6d5c8b [WIP] Less hacky way of supporting dylibs 2017-09-23 12:58:19 +02:00
bjorn3 cba53f0be5 Allow writing metadata without llvm 2017-09-23 12:54:53 +02:00
Vadim Petrochenkov 419069d984 Use recorded types in rustc_privacy 2017-09-23 00:50:46 +03:00
Tamir Duberstein 231d9e7e5d
Remove rustc_bitflags; use the bitflags crate 2017-09-17 14:19:24 -04:00
Tim Neumann eea2f5596a Rollup merge of #44533 - nrc:rustfmt-submod, r=alexcrichton
Add Rustfmt

r? @alexcrichton
2017-09-17 13:19:04 +02:00
Alex Crichton a47ca2291d Rollup merge of #44606 - alexcrichton:update-cmake, r=Mark-Simulacrum
rustbuild: Update `cmake` dependency

Should help suppress some warnings from various repos as `cmake` in the newest
version disables warnings by default.
2017-09-16 17:09:41 -07:00
Alex Crichton 941e172fc1 Rollup merge of #44531 - QuietMisdreavus:bump-gcc, r=alexcrichton
bump gcc for bootstrap

On Windows, the gcc crate would send /Wall to msvc, which would cause
builds to get flooded with warnings, exploding compile times from one
hour to more than 72! The gcc crate version 0.3.54 changes this behavior
to send /W4 instead, which greatly cuts down on cl.exe flooding the
command prompt window with warnings.
2017-09-16 17:09:37 -07:00
bors ae8efdc87d Auto merge of #43017 - durka:stabilize-const-invocation, r=eddyb
Individualize feature gates for const fn invocation

This PR changes the meaning of `#![feature(const_fn)]` so it is only required to declare a const fn but not to call one. Based on discussion at #24111. I was hoping we could have an FCP here in order to move that conversation forward.

This sets the stage for future stabilization of the constness of several functions in the standard library (listed below), so could someone please tag the lang team for review.

- `std::cell`
    - `Cell::new`
    - `RefCell::new`
    - `UnsafeCell::new`
- `std::mem`
    - `size_of`
    - `align_of`
- `std::ptr`
    - `null`
    - `null_mut`
- `std::sync`
    - `atomic`
        - `Atomic{Bool,Ptr,Isize,Usize}::new`
    - `once`
        - `Once::new`
- primitives
    - `{integer}::min_value`
    - `{integer}::max_value`

Some other functions are const but they are also unstable or hidden, e.g. `Unique::new` so they don't have to be considered at this time.

After this stabilization, the following `*_INIT` constants in the standard library can be deprecated. I wasn't sure whether to include those deprecations in the current PR.

- `std::sync`
    - `atomic`
        - `ATOMIC_{BOOL,ISIZE,USIZE}_INIT`
    - `once`
        - `ONCE_INIT`
2017-09-16 17:02:17 +00:00
Alex Burka 332c38cd70 bump rls 2017-09-16 15:53:02 +00:00
Alex Crichton 6fdadaaa96 rustbuild: Update `cmake` dependency
Should help suppress some warnings from various repos as `cmake` in the newest
version disables warnings by default.
2017-09-15 09:37:52 -07:00
Corey Farwell 5255ab7e2a Rollup merge of #44430 - steveklabnik:update-mdbook, r=alexcrichton
update mdbook

This eliminates some warnings

r? @alexcrichton
2017-09-14 22:32:37 -04:00
Nick Cameron d0070e85db Build and test Rustfmt 2017-09-13 16:18:45 +12:00
Alex Crichton 921750b8ac rustc: Make `CrateStore` private to `TyCtxt`
This commit removes the `cstore_untracked` method, making the `CrateStore` trait
object entirely private to the `ty/context.rs` module.
2017-09-12 21:14:06 -07:00
QuietMisdreavus 81ebab6fca bump gcc for bootstrap
On Windows, the gcc crate would send /Wall to msvc, which would cause
builds to get flooded with warnings, exploding compile times from one
hour to more than 72! The gcc crate version 0.3.54 changes this behavior
to send /W4 instead, which greatly cuts down on cl.exe flooding the
command prompt window with warnings.
2017-09-12 18:09:26 -05:00
steveklabnik f3d6f120e8 update mdbook 2017-09-11 11:56:35 -04:00
Alex Crichton 38bedfabb9 rustbuild: Switch back to using hard links
The `copy` function historically in rustbuild used hard links to speed up the
copy operations that it does. This logic was backed out, however, in #39518 due
to a bug that only showed up on Windows, described in #39504. The cause
described in #39504 happened because Cargo, on a fresh build, would overwrite
the previous artifacts with new hard links that Cargo itself manages.

This behavior in Cargo was fixed in rust-lang/cargo#4390 where it no longer
should overwrite files on fresh builds, opportunistically leaving the filesystem
intact and not touching it.

Hopefully this can help speed up local builds by doing fewer copies all over the
place!
2017-09-09 21:14:44 -07:00
bors 3681220877 Auto merge of #43975 - RalfJung:gcc, r=alexcrichton
use gcc::Build rather than deprecated gcc::Config

I did `cargo update -p gcc` to upgrade only this package. Is there further process that should be follwoed when updating a build dependency from crates.io?

r? @alexcrichton
Fixes #43973
2017-09-06 19:28:36 +00:00
bors 5e9431a6f5 Auto merge of #44176 - nrc:update-rls, r=alexcrichton
Update rls

And expose the `CFG_VERSION` env var to tools so they can determine the version of Rust.

This gets the RLS back on master and so completes the PR dance for the generators PR.

r? @alexcrichton
2017-09-03 00:51:47 +00:00
Ralf Jung 12d84cc009 update gcc crate
Use gcc::Build rather than deprecated gcc::Config.
Fixes #43973
2017-09-02 21:51:18 +02:00
Guillaume Gomez 7befbbc020 Update html-diff-rs version 2017-09-02 00:16:55 +02:00
Alex Crichton 271c63c189 Update git2-rs to fix cross compiles 2017-09-01 07:56:44 -07:00
Alex Crichton 7a2a8d7d60 Update Cargo to 0.23.0 and our lockfile 2017-08-31 07:02:50 -07:00
bors 97b01abf3d Auto merge of #41991 - GuillaumeGomez:rustdoc-html-diff, r=nrc
Add warnings when rustdoc html rendering differs
2017-08-31 08:52:03 +00:00
Guillaume Gomez b501d00090 downgrade libgit2 2017-08-31 09:49:38 +02:00
Nick Cameron 92867d22a8 Update rls 2017-08-31 15:24:23 +12:00
Alex Crichton fd4f362b30 Rollup merge of #44125 - SergioBenitez:master, r=nrc
Initial diagnostic API for proc-macros.

This commit introduces the ability to create and emit `Diagnostic` structures from proc-macros, allowing for proc-macro authors to emit warning, error, note, and help messages just like the compiler does.

The API is somewhat based on the diagnostic API already present in `rustc` with several changes that improve usability. The entry point into the diagnostic API is a new `Diagnostic` type which is primarily created through new `error`, `warning`, `help`, and `note` methods on `Span`. The `Diagnostic` type records the diagnostic level, message, and optional `Span` for the top-level diagnostic and contains a `Vec` of all of the child diagnostics. Child diagnostics can be added through builder methods on `Diagnostic`.

A typical use of the API may look like:

```rust
let token = parse_token();
let val = parse_val();

val.span
    .error(format!("expected A but found {}", val))
    .span_note(token.span, "because of this token")
    .help("consider using a different token")
    .emit();
```

cc @jseyfried @nrc @dtolnay @alexcrichton
2017-08-30 11:11:12 -05:00
Guillaume Gomez 9b26f3ad25 Remove some false positive issues 2017-08-30 11:46:58 +02:00
Guillaume Gomez f2774b7ac3 Print warning whatever the rendering mode 2017-08-30 09:40:43 +02:00
Guillaume Gomez 33d99e526e Set python binary name to python 2.7 2017-08-30 09:40:43 +02:00
Guillaume Gomez e1367ef1b1 Update unstable-crate test 2017-08-30 09:40:43 +02:00
Guillaume Gomez 274543b9ca Add warnings when rustdoc html rendering differs 2017-08-30 09:40:43 +02:00
Alex Crichton a996d5eec7 Tweak rls submodule again 2017-08-28 07:32:25 -07:00
Sergio Benitez 8be132e9d7 Initial diagnostic API for proc-macros.
This commit introduces the ability to create and emit `Diagnostic`
structures from proc-macros, allowing for proc-macro authors to emit
warning, error, note, and help messages just like the compiler does.
2017-08-28 02:58:22 -07:00
Alex Crichton 8a9e32b3fa Update lock file 2017-08-27 18:52:02 -07:00
Tatsuyuki Ishi 611b111139 Move unused-extern-crate to late pass 2017-08-27 19:02:24 +09:00
Mark Simulacrum a947c6a595 Update cargo 2017-08-26 12:30:57 -06:00
Nick Cameron 7cb3f45063 Update RLS and Cargo 2017-08-25 18:12:47 -07:00
Felix S. Klock II 8e79fc72cb Move borrowck error msg construction to module in `rustc_mir` (for later reuse by mir borrowck).
post-rebase: Do not put "(Ast)" suffix in error msg unless passed `-Z borrowck-mir`.
(But unconditionally include "(Mir)" suffix for mir-borrowck errors.)
2017-08-16 15:52:45 +02:00
bjorn3 e5399961c6
Remove some unused dependencies from rustc_trans_utils 2017-08-11 14:00:09 +02:00
bjorn3 b8d5c74c99
It now completely compiles without LLVM!!! 2017-08-11 14:00:07 +02:00
bjorn3 b7314c7caf
Actually make rustc_driver compile without llvm 2017-08-11 14:00:05 +02:00
bjorn3 b43c02b0aa
Make librustc_driver work without librustc_trans 2017-08-11 10:38:31 +02:00
Danek Duvall 9c5397d033 Update libc to 0.2.29
Cargo pulls in libc from crates.io for a number of dependencies, but
0.2.27 is too old to work properly with Solaris.  In particular, it
needs the change to make Solaris' PTHREAD_PROCESS_PRIVATE a 16-bit
integer.
2017-08-07 15:42:30 -07:00
Nick Cameron 17d5f6a086 update rls 2017-08-07 12:16:04 +12:00
bors 2b82b7e50a Auto merge of #43554 - eddyb:apfloat, r=nikomatsakis
APFloat: Rewrite It In Rust and use it for deterministic floating-point CTFE.

As part of the CTFE initiative, we're forced to find a solution for floating-point operations.
By design, IEEE-754 does not explicitly define everything in a deterministic manner, and there is some variability between platforms, at the very least (e.g. NaN payloads).

If types are to evaluate constant expressions involving type (or in the future, const) generics, that evaluation needs to be *fully deterministic*, even across `rustc` host platforms.
That is, if `[T; T::X]` was used in a cross-compiled library, and the evaluation of `T::X` executed a floating-point operation, that operation has to be reproducible on *any other host*, only knowing `T` and the definition of the `X` associated const (as either AST or HIR).

Failure to uphold those rules allows an associated type (e.g. `<Foo as Iterator>::Item`) to be seen as two (or more) different types, depending on the current host, and such type safety violations typically allow writing of a `transmute` in safe code, given enough generics.

The options considered by @rust-lang/compiler were:
1. Ban floating-point operations in generic const-evaluation contexts
2. Emulate floating-point operations in an uniformly deterministic fashion

The former option may seem appealing at first, but floating-point operations *are allowed today*, so they can't be banned wholesale, a distinction has to be made between the code that already works, and future generic contexts. *Moreover*, every computation that succeeded *has to be cached*, otherwise the generic case can be reproduced without any generics. IMO there are too many ways it can go wrong, and a single violation can be enough for an unsoundness hole.
Not to mention we may end up really wanting floating-point operations *anyway*, in CTFE.

I went with the latter option, and seeing how LLVM *already* has a library for this exact purpose (as it needs to perform optimizations independently of host floating-point capabilities), i.e. `APFloat`, that was what I ended up basing this PR on.
But having been burned by the low reusability of bindings that link to LLVM, and because I would *rather* the floating-point operations to be wrong than not deterministic or not memory-safe (`APFloat` does far more pointer juggling than I'm comfortable with), I decided to RIIR.

This way, we have a guarantee of *no* `unsafe` code, a bit more control over the where native floating-point might accidentally be involved, and non-LLVM backends can share it.
I've also ported all the testcases over, *before* any functionality, to catch any mistakes.

Currently the PR replaces all CTFE operations to go through `apfloat::ieee::{Single,Double}`, keeping only the bits of the `f32` / `f64` memory representation in between operations.
Converting from a string also double-checks that `core::num` and `apfloat` agree on the interpretation of a floating-point number literal, in case either of them has any bugs left around.

r? @nikomatsakis
f? @nagisa @est31

<hr/>

Huge thanks to @edef1c for first demoing usable `APFloat` bindings and to @chandlerc for fielding my questions on IRC about `APFloat` peculiarities (also upstreaming some bugfixes).
2017-08-05 13:12:56 +00:00
Nick Cameron 5abbf798e7 Update RLS 2017-08-02 17:53:37 +12:00
Nick Cameron 8c1699d874 Update rls-data dep 2017-08-02 16:57:50 +12:00
Eduard-Mihai Burtescu 877ec94654 rustc_apfloat: introduce the base Float API. 2017-08-02 03:45:03 +03:00
bors e772c28d2e Auto merge of #43506 - michaelwoerister:async-llvm, r=alexcrichton
Run translation and LLVM in parallel when compiling with multiple CGUs

This is still a work in progress but the bulk of the implementation is done, so I thought it would be good to get it in front of more eyes.

This PR makes the compiler start running LLVM while translation is still in progress, effectively allowing for more parallelism towards the end of the compilation pipeline. It also allows the main thread to switch between either translation or running LLVM, which allows to reduce peak memory usage since not all LLVM module have to be kept in memory until linking. This is especially good for incr. comp. but it works just as well when running with `-Ccodegen-units=N`.

In order to help tuning and debugging the work scheduler, the PR adds the `-Ztrans-time-graph` flag which spits out html files that show how work packages where scheduled:
![Building regex](https://user-images.githubusercontent.com/1825894/28679272-f6752bd8-72f2-11e7-8a6c-56207855ce95.png)
(red is translation, green is llvm)

One side effect here is that `-Ztime-passes` might show something not quite correct because trans and LLVM are not strictly separated anymore. I plan to have some special handling there that will try to produce useful output.

One open question is how to determine whether the trans-thread should switch to intermediate LLVM processing.

TODO:
- [x] Restore `-Z time-passes` output for LLVM.
- [x] Update documentation, esp. for work package scheduling.
- [x] Tune the scheduling algorithm.

cc @alexcrichton @rust-lang/compiler
2017-08-01 17:21:24 +00:00
bors df90a54662 Auto merge of #43533 - nrc:macro-save, r=jseyfried,
Three small fixes for save-analysis

First commit does some naive deduplication of macro uses. We end up with lots of duplication here because of the weird way we get this data (we extract a use for every span generated by a macro use).

Second commit is basically a typo fix.

Third commit is a bit interesting, it partially reverts a change from #40939 where temporary variables in format! (and thus println!) got a span with the primary pointing at the value stored into the temporary (e.g., `x` in `println!("...", x)`). If `format!` had a definition it should point at the temporary in the macro def, but since it is built-in, that is not possible (for now), so `DUMMY_SP` is the best we can do (using the span in the callee really breaks save-analysis because it thinks `x` is a definition as well as a reference).

There aren't a test for this stuff because: the deduplication is filtered by any of the users of save-analysis, so it is purely an efficiency change. I couldn't actually find an example for the second commit that we have any machinery to test, and the third commit is tested by the RLS, so there will be a test once I update the RLS version and and uncomment the previously failing tests).

r? @jseyfried
2017-08-01 03:52:14 +00:00
Nick Cameron 27b9182d5b review changes 2017-08-01 15:06:22 +12:00
Michael Woerister bd36df84a5 async-llvm(24): Improve scheduling and documentation. 2017-07-31 15:15:44 +02:00
bors 53bf7903fa Auto merge of #43009 - GuillaumeGomez:unused-doc-comments, r=nrc
Throw errors when doc comments are added where they're unused

#42617
2017-07-29 23:01:45 +00:00
Guillaume Gomez 5636d325ed Update cargo version 2017-07-29 15:11:31 +02:00
Mark Simulacrum e2e9b40e9a Build rustdoc on-demand.
Rustdoc is no longer compiled in every stage, alongside rustc, instead
it is only compiled when requested, and generally only for the last
stage.
2017-07-27 05:51:22 -06:00
Nick Cameron b23c83e0c2 Update RLS 2017-07-26 18:51:32 +12:00
Alex Crichton 9010567dcc Bump master to 1.21.0
This commit bumps the master branch's version to 1.21.0 and also updates the
bootstrap compiler from the freshly minted beta release.
2017-07-25 07:03:19 -07:00
bors 513906c43d Auto merge of #43327 - nrc:rls-config, r=eddyb
Use a config struct for save-analysis

Replaces some existing customisation options, including removing the -Zsave-analysis-api flag

r? @eddyb
2017-07-24 07:29:25 +00:00
Nick Cameron ad8ecc20a2 Point RLS submodule at a branch with required changes
And cargo update
2017-07-24 17:25:15 +12:00
bors 8d22af87d8 Auto merge of #43059 - Mark-Simulacrum:rustbuild-2.0, r=alexcrichton
Rework Rustbuild to an eagerly compiling approach

This introduces a new dependency on `serde`; I don't believe that's a problem since bootstrap is compiled with nightly/beta always so proc macros are available. Compile times are slightly longer -- about 2-3x (30 seconds vs. 10 seconds). I don't think this is too big a problem, especially since recompiling bootstrap is somewhat rare. I think we can remove the dependency on Serde if necessary, though, so let me know.

r? @alexcrichton
2017-07-22 18:27:29 +00:00
Nick Cameron 84d93a4edd Use a config file with save-analysis
Replaces the output path env var. Can be passed to save-analysis via a function call or env var.
2017-07-22 16:35:40 +12:00
Simon Sapin b77ff24060 Update Cargo to ffab51954ec32d55631c37a8730bb24915fc090b
https://github.com/rust-lang/cargo/pull/4123 added the [patch] section of the manifest
2017-07-21 11:13:18 +02:00
Mark Simulacrum dec44b0656 Resolve rebase errors 2017-07-20 11:24:36 -06:00
Mark Simulacrum 528646e127 Utilize interning to allow Copy/Clone steps 2017-07-20 11:24:32 -06:00
Mark Simulacrum a1fa2681cf Update to toml 0.4 2017-07-20 11:23:59 -06:00
Mark Simulacrum 60388303c7 Fixes warnings and errors introduced while moving code around 2017-07-20 11:23:58 -06:00
Nick Cameron 04415dc64c Run RLS tests 2017-07-17 17:21:46 +12:00
bors c4373bd6a2 Auto merge of #43207 - alexcrichton:update-cargo, r=nikomatsakis
Update the `cargo` submodule

Notably pull in an update to the `jobserver` crate to have Cargo set the
`CARGO_MAKEFLAGS` environment variable instead of the `MAKEFLAGS` environment
variable.

cc https://github.com/rust-lang/rust/issues/42635
2017-07-15 11:02:35 +00:00
Alex Crichton bdcebc938b Update the `cargo` submodule
Notably pull in an update to the `jobserver` crate to have Cargo set the
`CARGO_MAKEFLAGS` environment variable instead of the `MAKEFLAGS` environment
variable.
2017-07-13 07:54:28 -07:00
Oliver Schneider cb92ab93a2 Reduce the usage of features in compiletest and libtest 2017-07-13 16:37:57 +02:00
steveklabnik 4871dba5d4 update crate dependencies
I wanted to update mdbook's version. This ended up updating a bunch of other stuff too.
2017-07-11 21:18:44 -04:00
Vadim Petrochenkov 9ac79e4934 Update rls to pull rustfmt with libsyntax changes 2017-07-10 00:20:25 +03:00
bors 8cab2c73d4 Auto merge of #42899 - alexcrichton:compiler-builtins, r=nikomatsakis
Switch to rust-lang-nursery/compiler-builtins

This commit migrates the in-tree `libcompiler_builtins` to the upstream version
at https://github.com/rust-lang-nursery/compiler-builtins. The upstream version
has a number of intrinsics written in Rust and serves as an in-progress rewrite
of compiler-rt into Rust. Additionally it also contains all the existing
intrinsics defined in `libcompiler_builtins` for 128-bit integers.

It's been the intention since the beginning to make this transition but
previously it just lacked the manpower to get done. As this PR likely shows it
wasn't a trivial integration! Some highlight changes are:

* The PR rust-lang-nursery/compiler-builtins#166 contains a number of fixes
  across platforms and also some refactorings to make the intrinsics easier to
  read. The additional testing added there also fixed a number of integration
  issues when pulling the repository into this tree.

* LTO with the compiler-builtins crate was fixed to link in the entire crate
  after the LTO process as these intrinsics are excluded from LTO.

* Treatment of hidden symbols was updated as previously the
  `#![compiler_builtins]` crate would mark all symbol *imports* as hidden
  whereas it was only intended to mark *exports* as hidden.
2017-07-06 02:34:29 +00:00
bors 1685c92986 Auto merge of #42727 - alexcrichton:allocators-new, r=eddyb
rustc: Implement the #[global_allocator] attribute

This PR is an implementation of [RFC 1974] which specifies a new method of
defining a global allocator for a program. This obsoletes the old
`#![allocator]` attribute and also removes support for it.

[RFC 1974]: https://github.com/rust-lang/rfcs/pull/1974

The new `#[global_allocator]` attribute solves many issues encountered with the
`#![allocator]` attribute such as composition and restrictions on the crate
graph itself. The compiler now has much more control over the ABI of the
allocator and how it's implemented, allowing much more freedom in terms of how
this feature is implemented.

cc #27389
2017-07-06 00:16:16 +00:00
Alex Crichton 695dee063b rustc: Implement the #[global_allocator] attribute
This PR is an implementation of [RFC 1974] which specifies a new method of
defining a global allocator for a program. This obsoletes the old
`#![allocator]` attribute and also removes support for it.

[RFC 1974]: https://github.com/rust-lang/rfcs/pull/197

The new `#[global_allocator]` attribute solves many issues encountered with the
`#![allocator]` attribute such as composition and restrictions on the crate
graph itself. The compiler now has much more control over the ABI of the
allocator and how it's implemented, allowing much more freedom in terms of how
this feature is implemented.

cc #27389
2017-07-05 14:37:01 -07:00
Alex Crichton fd95db25b3 Merge remote-tracking branch 'origin/master' into proc_macro_api 2017-07-05 08:42:13 -07:00
Alex Crichton 7e6c9f3635 Switch to rust-lang-nursery/compiler-builtins
This commit migrates the in-tree `libcompiler_builtins` to the upstream version
at https://github.com/rust-lang-nursery/compiler-builtins. The upstream version
has a number of intrinsics written in Rust and serves as an in-progress rewrite
of compiler-rt into Rust. Additionally it also contains all the existing
intrinsics defined in `libcompiler_builtins` for 128-bit integers.

It's been the intention since the beginning to make this transition but
previously it just lacked the manpower to get done. As this PR likely shows it
wasn't a trivial integration! Some highlight changes are:

* The PR rust-lang-nursery/compiler-builtins#166 contains a number of fixes
  across platforms and also some refactorings to make the intrinsics easier to
  read. The additional testing added there also fixed a number of integration
  issues when pulling the repository into this tree.

* LTO with the compiler-builtins crate was fixed to link in the entire crate
  after the LTO process as these intrinsics are excluded from LTO.

* Treatment of hidden symbols was updated as previously the
  `#![compiler_builtins]` crate would mark all symbol *imports* as hidden
  whereas it was only intended to mark *exports* as hidden.
2017-07-05 07:08:36 -07:00
est31 3b91f9406c Update cargo
... to get https://github.com/rust-lang/cargo/pull/4244 and
https://github.com/rust-lang/cargo/pull/4246
2017-07-02 16:42:13 +02:00
bors d41b791c1a Auto merge of #42971 - stepancheg:ir-demangle, r=nagisa
When writing LLVM IR output demangled fn name in comments

`--emit=llvm-ir` looks like this now:

```
; <alloc::vec::Vec<T> as core::ops::index::IndexMut<core::ops::range::RangeFull>>::index_mut
; Function Attrs: inlinehint uwtable
define internal { i8*, i64 } @"_ZN106_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..ops..index..IndexMut$LT$core..ops..range..RangeFull$GT$$GT$9index_mut17h7f7b576609f30262E"(%"alloc::vec::Vec<u8>"* dereferenceable(24)) unnamed_addr #0 {
start:
  ...
```

cc https://github.com/integer32llc/rust-playground/issues/15
2017-07-01 05:52:08 +00:00
Stepan Koltsov b62bdaafe0 When writing LLVM IR output demangled fn name in comments
`--emit=llvm-ir` looks like this now:

```
; <alloc::vec::Vec<T> as core::ops::index::IndexMut<core::ops::range::RangeFull>>::index_mut
; Function Attrs: inlinehint uwtable
define internal { i8*, i64 } @"_ZN106_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..ops..index..IndexMut$LT$core..ops..range..RangeFull$GT$$GT$9index_mut17h7f7b576609f30262E"(%"alloc::vec::Vec<u8>"* dereferenceable(24)) unnamed_addr #0 {
start:
  ...
```

cc https://github.com/integer32llc/rust-playground/issues/15
2017-07-01 03:16:43 +03:00
Nick Cameron 3dad1977a5 Update RLS submodule 2017-06-28 06:40:23 +12:00
Mark Simulacrum 38b468832f Update Cargo 2017-06-26 10:30:36 -06:00
Jeffrey Seyfried e42836b208 Implement `quote!` and other `proc_macro` API. 2017-06-26 02:06:26 +00:00
bors 80271e8edf Auto merge of #42682 - alexcrichton:jobserver, r=michaelwoerister
Integrate jobserver support to parallel codegen

This commit integrates the `jobserver` crate into the compiler. The crate was
previously integrated in to Cargo as part of rust-lang/cargo#4110. The purpose
here is to two-fold:

* Primarily the compiler can cooperate with Cargo on parallelism. When you run
  `cargo build -j4` then this'll make sure that the entire build process between
  Cargo/rustc won't use more than 4 cores, whereas today you'd get 4 rustc
  instances which may all try to spawn lots of threads.

* Secondarily rustc/Cargo can now integrate with a foreign GNU `make` jobserver.
  This means that if you call cargo/rustc from `make` or another
  jobserver-compatible implementation it'll use foreign parallelism settings
  instead of creating new ones locally.

As the number of parallel codegen instances in the compiler continues to grow
over time with the advent of incremental compilation it's expected that this'll
become more of a problem, so this is intended to nip concurrent concerns in the
bud by having all the tools to cooperate!

Note that while rustc has support for itself creating a jobserver it's far more
likely that rustc will always use the jobserver configured by Cargo. Cargo today
will now set a jobserver unconditionally for rustc to use.
2017-06-22 00:32:42 +00:00
Corey Farwell 80e14a0fe3 Rollup merge of #42766 - nrc:versions, r=nagisa
Update rls-data version

And update the RLS submod
2017-06-21 10:40:17 -04:00
Alex Crichton 201f06988f Integrate jobserver support to parallel codegen
This commit integrates the `jobserver` crate into the compiler. The crate was
previously integrated in to Cargo as part of rust-lang/cargo#4110. The purpose
here is to two-fold:

* Primarily the compiler can cooperate with Cargo on parallelism. When you run
  `cargo build -j4` then this'll make sure that the entire build process between
  Cargo/rustc won't use more than 4 cores, whereas today you'd get 4 rustc
  instances which may all try to spawn lots of threads.

* Secondarily rustc/Cargo can now integrate with a foreign GNU `make` jobserver.
  This means that if you call cargo/rustc from `make` or another
  jobserver-compatible implementation it'll use foreign parallelism settings
  instead of creating new ones locally.

As the number of parallel codegen instances in the compiler continues to grow
over time with the advent of incremental compilation it's expected that this'll
become more of a problem, so this is intended to nip concurrent concerns in the
bud by having all the tools to cooperate!

Note that while rustc has support for itself creating a jobserver it's far more
likely that rustc will always use the jobserver configured by Cargo. Cargo today
will now set a jobserver unconditionally for rustc to use.
2017-06-21 07:16:43 -07:00
Alex Crichton 5c3d0e6de3 Switch to the crates.io `getopts` crate
This commit deletes the in-tree `getopts` crate in favor of the crates.io-based
`getopts` crate. The main difference here is with a new builder-style API, but
otherwise everything else remains relatively standard.
2017-06-20 12:43:12 -07:00
bors 753fee4ab6 Auto merge of #42495 - alexcrichton:new-stage0, r=Mark-Simulacrum
Bump to 1.20.0 and update stage0 compiler

Betas are hot off the bots, let's get them while they're fresh.
2017-06-20 07:22:38 +00:00
Nick Cameron 7a18a77e1b Update rls-data dep 2017-06-20 18:55:14 +12:00
Alex Crichton be7ebdd512 Bump version and stage0 compiler 2017-06-19 22:25:05 -07:00
Alex Crichton 5bc4031e63 Update `wincolor` dep for Cargo
Closes rust-lang/cargo#4189
2017-06-19 10:44:12 -07:00
bors 10d7cb44c9 Auto merge of #42676 - alexcrichton:update-cargo, r=Mark-Simulacrum
Update cargo/rls submodules and dependencies

Brings in a few regression fixes on the Cargo side, updates the rls to work
with the newer Cargo, and also updates other crates.io dependencies to pull in
various bug fixes and such.
2017-06-18 21:10:33 +00:00
Mark Simulacrum c982529327 Rollup merge of #42720 - murarth:deprecated-collections, r=alexcrichton
Reintroduce deprecated `collections` crate
2017-06-18 10:34:10 -06:00
bors 28cc0c5a7b Auto merge of #42593 - ibabushkin:on-demand-external-source, r=eddyb
Implement lazy loading of external crates' sources. Fixes #38875

Fixes #38875. This is a follow-up to #42507. When a (now correctly translated) span from an external crate is referenced in a error, warning or info message, we still don't have the source code being referenced.
Since stuffing the source in the serialized metadata of an rlib is extremely wasteful, the following scheme has been implemented:

* File maps now contain a source hash that gets serialized as well.
* When a span is rendered in a message, the source hash in the corresponding file map(s) is used to try and load the source from the corresponding file on disk. If the file is not found or the hashes don't match, the failed attempt is recorded (and not retried).
* The machinery fetching source lines from file maps is augmented to use the lazily loaded external source as a secondary fallback for file maps belonging to external crates.

This required a small change to the expected stderr of one UI test (it now renders a span, where previously was none).

Further work can be done based on this - some of the machinery previously used to hide external spans is possibly obsolete and the hashing code can be reused in different places as well.

r? @eddyb
2017-06-18 10:41:05 +00:00
Murarth 6484258f17 Reintroduce deprecated `collections` crate 2017-06-17 13:18:18 -07:00
Alex Crichton 1cede109d8 Update cargo/rls submodules and dependencies
Brings in a few regression fixes on the Cargo side, updates the rls to work
with the newer Cargo, and also updates other crates.io dependencies to pull in
various bug fixes and such.
2017-06-17 12:00:49 -07:00
bors b40be00a0c Auto merge of #42612 - est31:master, r=nagisa
Autogenerate stubs and SUMMARY.md in the unstable book

Removes a speed bump in compiler development by autogenerating stubs for features in the unstable book. See #42454 for discussion.

The PR contains three commits, separated in order to make review easy:

* The first commit converts the tidy tool from a binary crate to a crate that contains both a library and a binary. In the second commit, we'll use the tidy library
* The second and main commit introduces autogeneration of SUMMARY.md and feature stub files
* The third commit turns off the tidy lint that checks for features without a stub, and removes the stub files. A separate commit due to the large number of files touched

Members of the doc team who wish to document some features can either do this (where `$rustsrc` is the root of the rust repo git checkout):

1. cd to `$rustsrc/src/tools/unstable-book-gen` and then do `cargo run $rustsrc/src $rustsrc/src/doc/unstable-book` to put the stubs into the unstable book
2. cd to `$rustsrc` and run `git ls-files --others --exclude-standard` to list the newly added stubs
3. choose a file to edit, then `git add` it and `git commit`
4. afterwards, remove all changes by the tool by doing `git --reset hard` and `git clean -f`

Or they can do this:

1. remove the comment marker in `src/tools/tidy/src/unstable_book.rs` line 122
2. run `./x.py test src/tools/tidy` to list the unstable features which only have stubs
3. revert the change in 1
3. document one of the chosen unstable features

The changes done by this PR also allow for further development:

* tidy obtains information about tracking issues. We can now forbid differing tracking issues between differing `#![unstable]` annotations. I haven't done this but plan to in a future PR
* we now have a general framework for generating stuff for the unstable book at build time. Further changes can autogenerate a list of the API a given library feature exposes.

The old way to simply click through the documentation after it has been uploaded to rust-lang.org works as well.

r? @nagisa

Fixes #42454
2017-06-16 14:41:15 +00:00
bors 258ae6dd9b Auto merge of #42648 - murarth:merge-alloc-collections, r=alexcrichton
Merge crate `collections` into `alloc`

This is a necessary step in order to merge #42565
2017-06-15 12:37:54 +00:00
bors dfa7e21e4e Auto merge of #42433 - marco-c:profiling, r=alexcrichton
Build instruction profiler runtime as part of compiler-rt

r? @alexcrichton

This is #38608 with some fixes.

Still missing:
- [x] testing with profiler enabled on some builders (on which ones? Should I add the option to some of the already existing configurations, or create a new configuration?);
- [x] enabling distribution (on which builders?);
- [x] documentation.
2017-06-14 08:46:14 +00:00
Murarth eadda7665e Merge crate `collections` into `alloc` 2017-06-13 23:37:34 -07:00
est31 c2d59067fb Autogenerate stubs and the summary of the unstable book 2017-06-14 04:59:27 +02:00
Nick Cameron 34bd80a782 Fix rebasing error 2017-06-12 14:29:59 +12:00
Nick Cameron 0058fdd110 Update rls-data 2017-06-12 14:14:23 +12:00
Inokentiy Babushkin dd8f7cd126
Moved FileMap construction to it's own constructor.
The rationale is that BOM stripping is needed for lazy source loading
for external crates, and duplication can be avoided by moving the
corresponding functionality to libsyntax_pos.
2017-06-10 16:09:51 +02:00
Corey Farwell 13ae42fb20 Rollup merge of #42512 - Keruspe:master, r=alexcrichton
update git2

Fixes build with libressl
2017-06-07 21:58:46 -04:00
Marc-Antoine Perennou 95bc0d6c79 update git2
Fixes build with libressl

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-06-07 21:42:31 +02:00
Alex Crichton 453080f13e Update Cargo
Brings in some perf improvements!
2017-06-07 07:57:59 -07:00
Marco Castelluccio ecba8d6a23 Merge branch 'profiling' of github.com:whitequark/rust into profiling 2017-06-04 15:54:39 +01:00
Mark Simulacrum 5775c9ec5f Rollup merge of #42343 - cuviper:install-executables, r=alexcrichton
Update rust-installer for Windows executable mode

It now marks a few whitelisted extensions as executable in the tarball,
so Windows packages can be extracted on other platforms and directly
execute install.sh.

It also includes a fix for the chmod on bulk dirs, so now the html docs
won't be marked executable en masse.

Fixes #42121
r? @alexcrichton
2017-06-02 09:10:45 -06:00
Brian Anderson da100fe0bb Support VS 2017
Fixes #38584
2017-06-01 20:41:38 +00:00
Josh Stone 0fba1f753d Update rust-installer for Windows executable mode
It now marks a few whitelisted extensions as executable in the tarball,
so Windows packages can be extracted on other platforms and directly
execute install.sh.

It also includes a fix for the chmod on bulk dirs, so now the html docs
won't be marked executable en masse.

Fixes #42121
r? @alexcrichton
2017-05-31 17:21:00 -07:00
Alex Crichton 3146d9f3a7 Updated locked version of libgit2
This should include a fix for rust-lang/cargo#4091 with an updated version of
libgit2.

Closes rust-lang/cargo#4091
2017-05-28 10:27:42 -07:00
Alex Crichton e0f11b4dde Update Cargo submodule
Contains a fix for rust-lang/cargo#4081
2017-05-24 12:59:58 -07:00
Tatsuyuki Ishi 0e79b9790a Unify all stage2 tools into a workspace
This avoids double compiled Cargo. Hopefully this would speed up (extended) compilation for ~10m.

Notes: when updating Cargo submodule, the replacement version may also need to be updated.
2017-05-18 00:30:54 +09:00
bors b28cf7564a Auto merge of #41853 - Keruspe:install, r=alexcrichton
rustbuild: add support for --bindir and --sysconfdir

This depends on https://github.com/rust-lang/rust-installer/pull/59 and we'll need to udpate the rust-installer submodule once it gets merged for it to work

Fixes #41644
2017-05-16 17:18:23 +00:00
Marc-Antoine Perennou 08cc29e762 update lzma-sys to 0.1.4
fixes build when DESTDIR is set

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-05-16 16:28:36 +02:00
bors fa78d5bb87 Auto merge of #41565 - rkruppe:llvm-sys, r=eddyb
Make only rustc_trans depend on rustc_llvm

With these changes, only rustc_trans depends directly on rustc_llvm (and no crate gained a new dependency on trans). This means changing LLVM doesn't rebuild librustc or rustc_metadata, only rustc_trans, rustc_driver and the rustc executable
Also, rustc_driver technically doesn't know about LLVM any more (of course, it still handles a ton of options that conceptually refer to LLVM, but it delegates their implementation to trans).

What I *didn't* implement was merging most or all of rustc_llvm into rustc_trans. I ran into a nasty bug, which was probably just a silly typo somewhere but I probably won't have the time to figure it out in the next week or two. I opened #41699 for that step.

Fixes #41473
2017-05-16 05:41:11 +00:00
Robin Kruppe e3f6e68d63 Remove (direct) rustc_llvm dependency from rustc_driver
This does not actually improve build times, since it still depends
on rustc_trans, but is better layering and fits the multi-backend
future slightly better.
2017-05-15 11:13:32 +02:00
Robin Kruppe 8e4f315116 Remove rustc_llvm dependency from librustc
Consequently, session creation can no longer initialize LLVM.
The few places that use the compiler without going through
rustc_driver/CompilerCalls thus need to be careful to manually
initialize LLVM (via rustc_trans!) immediately after session
creation.

This means librustc is not rebuilt when LLVM changes.
2017-05-15 11:13:30 +02:00
Josh Stone 020c5ecca7 Update to the oxidized rust-installer 2017-05-14 21:06:23 -07:00
Robin Kruppe 1a24a591dd Remove rustc_llvm dependency from rustc_metadata
Move the code for loading metadata from rlibs and dylibs from
rustc_metadata into rustc_trans, and introduce a trait to avoid
introducing a direct dependency on rustc_trans.

This means rustc_metadata is no longer rebuilt when LLVM changes.
2017-05-14 20:30:22 +02:00
Liran Ringel 1163f2cc23 Pass static crt to llvm cmake configuration 2017-05-13 17:12:19 +02:00
Nick Cameron 7bed5437fa Update save-analysis deps and RLS submodule 2017-05-09 07:15:48 +12:00
bors 9956e81c19 Auto merge of #41729 - ubsan:master, r=nrc
Delete features which are easily removed, in libsyntax
2017-05-07 22:59:30 +00:00
ubsan 0be875827f fix the easy features in libsyntax 2017-05-07 01:20:15 -07:00
Niko Matsakis 3039398c68 convert save-analysis to use `ItemCtxt` and not `ast_ty_to_ty_cache` 2017-05-03 21:33:15 -04:00
Niko Matsakis 196c98d314 remove use of `ast_ty_to_ty_cache` from librustdoc 2017-05-03 21:26:28 -04:00
whitequark 42754ce710 Add profiling support, through the rustc -Z profile flag.
When -Z profile is passed, the GCDAProfiling LLVM pass is added
to the pipeline, which uses debug information to instrument the IR.
After compiling with -Z profile, the $(OUT_DIR)/$(CRATE_NAME).gcno
file is created, containing initial profiling information.
After running the program built, the $(OUT_DIR)/$(CRATE_NAME).gcda
file is created, containing branch counters.

The created *.gcno and *.gcda files can be processed using
the "llvm-cov gcov" and "lcov" tools. The profiling data LLVM
generates does not faithfully follow the GCC's format for *.gcno
and *.gcda files, and so it will probably not work with other tools
(such as gcov itself) that consume these files.
2017-05-01 09:16:20 +00:00
bors e326e86b47 Auto merge of #41588 - cengizIO:master, r=nikomatsakis
use diff crate for compile-fail test diagnostics #41474

Hello!

This fixes #41474

We were using a custom implementation to dump the differences between expected and actual outputs of compile-fail tests.

I removed this internal implementation and added `diff` crate as a new dependency to `compile-fail`.

Again, huge thanks to @nikomatsakis for guiding.
2017-04-29 12:59:45 +00:00
Alex Crichton 7bc2cbf5db travis: Parallelize tests on Android
Currently our slowest test suite on android, run-pass, takes over 5 times longer
than the x86_64 component (~400 -> ~2200s). Typically QEMU emulation does indeed
add overhead, but not 5x for this kind of workload. One of the slowest parts of
the Android process is that *compilation* happens serially. Tests themselves
need to run single-threaded on the emulator (due to how the test harness works)
and this forces the compiles themselves to be single threaded.

Now Travis gives us more than one core per machine, so it'd be much better if we
could take advantage of them! The emulator itself is still fundamentally
single-threaded, but we should see a nice speedup by sending binaries for it to
run much more quickly.

It turns out that we've already got all the tools to do this in-tree. The
qemu-test-{server,client} that are in use for the ARM Linux testing are a
perfect match for the Android emulator. This commit migrates the custom adb
management code in compiletest/rustbuild to the same qemu-test-{server,client}
implementation that ARM Linux uses.

This allows us to lift the parallelism restriction on the compiletest test
suites, namely run-pass. Consequently although we'll still basically run the
tests themselves in single threaded mode we'll be able to compile all of them in
parallel, keeping the pipeline much more full and using more cores for the work
at hand. Additionally the architecture here should be a bit speedier as it
should have less overhead than adb which is a whole new process on both the host
and the emulator!

Locally on an 8 core machine I've seen the run-pass test suite speed up from
taking nearly an hour to only taking 6 minutes. I don't think we'll see quite a
drastic speedup on Travis but I'm hoping this change can place the Android tests
well below 2 hours instead of just above 2 hours.

Because the client/server here are now repurposed for more than just QEMU,
they've been renamed to `remote-test-{server,client}`.

Note that this PR does not currently modify how debuginfo tests are executed on
Android. While parallelizable it wouldn't be quite as easy, so that's left to
another day. Thankfully that test suite is much smaller than the run-pass test
suite.

As a final fix I discovered that the ARM and Android test suites were actually
running all library unit tests (e.g. stdtest, coretest, etc) twice. I've
corrected that to only run tests once which should also give a nice boost in
overall cycle time here.
2017-04-27 20:20:13 -07:00
Corey Farwell 6fe2c24be0 Rollup merge of #41572 - frewsxcv:bump-mdbook, r=steveklabnik
Bump mdbook dep to pick up new 'create missing' toggle feature.

This will avoid obscure Travis CI error messages:

* https://github.com/rust-lang/rust/pull/40290#issuecomment-294137045

Original mdbook issue:

* https://github.com/azerupi/mdBook/issues/253

mdbook PR:

* https://github.com/azerupi/mdBook/pull/254
2017-04-27 19:59:17 -04:00
Cengiz Can 837817c053 use diff crate for compile-fail test diagnostics #41474 2017-04-27 22:41:18 +03:00
Corey Farwell a517a96186 Bump mdbook dep to pick up new 'create missing' toggle feature.
This will avoid obscure Travis CI error messages:

* https://github.com/rust-lang/rust/pull/40290#issuecomment-294137045

Original mdbook issue:

* https://github.com/azerupi/mdBook/issues/253

mdbook PR:

* https://github.com/azerupi/mdBook/pull/254
2017-04-27 10:28:23 -04:00
Jessica Hamilton 85c2ff1c46 Update num_cpus dependency to 1.x (1.4.0) 2017-04-26 15:25:03 +12:00
Corey Farwell 5eab9ba471 Rollup merge of #41374 - steveklabnik:update-mdbook, r=frewsxcv
update mdbook

Ship some more improvements.

r? @rust-lang/docs
2017-04-19 21:55:38 -04:00
Corey Farwell fea3576633 Add top level sections to the Unstable Book.
Prior to this commit, the contents of the Unstable Book were assumed to
be unstable features. This commit moves features into 'language features'
or 'library features' subsections. It also moves the 'linker_flavor'
compiler flag into a new 'Compiler Flags' subsection.

Even though it was helpful, I removed the tidy check that
cross-references the SUMMARY.md links with the Unstable Book directory
contents just because it would be difficult to maintain.

Relevant PR: https://github.com/rust-lang/rust/issues/41142.
2017-04-18 21:26:09 -04:00
steveklabnik 43d92bb585 update mdbook 2017-04-18 11:41:07 -04:00
Eduard-Mihai Burtescu 63064ec190 rustc: expose monomorphic const_eval through on-demand. 2017-04-16 01:31:06 +03:00
Eduard-Mihai Burtescu 8854164d0c rustc_const_eval: move ConstEvalErr to the rustc crate. 2017-04-16 01:31:06 +03:00
Corey Farwell eef2a9598b Sync all unstable features with Unstable Book; add tidy lint.
Add a tidy lint that checks for...

* Unstable Book sections with no corresponding SUMMARY.md links
* unstable features that don't have Unstable Book sections
* Unstable Book sections that don't have corresponding unstable features
2017-03-31 11:40:44 -04:00