]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoICH: Don't store hashes for individual foreign items.
Michael Woerister [Thu, 22 Dec 2016 15:31:11 +0000 (10:31 -0500)]
ICH: Don't store hashes for individual foreign items.

7 years agoICH: Fix some omissions around foreign mods in hasher.
Michael Woerister [Mon, 19 Dec 2016 22:51:27 +0000 (17:51 -0500)]
ICH: Fix some omissions around foreign mods in hasher.

7 years agoICH: Add test case for extern mods.
Michael Woerister [Mon, 19 Dec 2016 22:52:18 +0000 (17:52 -0500)]
ICH: Add test case for extern mods.

7 years agoAuto merge of #38072 - nikomatsakis:bootstrap-incremental, r=acrichto
bors [Mon, 19 Dec 2016 20:07:49 +0000 (20:07 +0000)]
Auto merge of #38072 - nikomatsakis:bootstrap-incremental, r=acrichto

add preliminary support for incremental compilation to rustbuild.py

This implements the integration described in #37929. It requires the use of a local nightly as your bootstrap compiler. The setup is described in `src/bootstrap/README.md`.

This does NOT implement the "copy stage0 libs to stage1" optimization described in #37929, just because that seems orthogonal to me.

In local testing, I do not yet see any incremental re-use when building rustc. I'm not sure why that is, more investigation needed.

(For these reasons, this is not marked as fixing the relevant issue.)

r? @alexcrichton -- I included one random cleanup (`Step::noop()`) that turned out to not be especially relevant. Feel free to tell me you liked it better the old way.

7 years agoadd and document `--incremental` flag along with misc other changes
Niko Matsakis [Wed, 16 Nov 2016 23:02:56 +0000 (18:02 -0500)]
add and document `--incremental` flag along with misc other changes

For example:

- we now support `-vv` to get very verbose output.
- RUSTFLAGS is respected by `x.py`
- better error messages for some cases

7 years agoadd concept of `Step::noop()`
Niko Matsakis [Wed, 16 Nov 2016 22:37:20 +0000 (17:37 -0500)]
add concept of `Step::noop()`

7 years agoAuto merge of #38405 - alexcrichton:rustbuild-fixes, r=japaric
bors [Mon, 19 Dec 2016 15:36:15 +0000 (15:36 +0000)]
Auto merge of #38405 - alexcrichton:rustbuild-fixes, r=japaric

rustbuild: Fix `copy` helper with existing files

This erroneously truncated files when the destination already existed and was an
existing hard link to the source. This in turn caused weird bugs!

Closes #37745

7 years agoAuto merge of #38466 - sanxiyn:rollup, r=sanxiyn
bors [Mon, 19 Dec 2016 12:17:24 +0000 (12:17 +0000)]
Auto merge of #38466 - sanxiyn:rollup, r=sanxiyn

Rollup of 9 pull requests

- Successful merges: #38334, #38397, #38413, #38421, #38422, #38433, #38438, #38445, #38459
- Failed merges:

7 years agoRollup merge of #38459 - nagisa:rustbuild-exec, r=alexcrichton
Seo Sanghyeon [Mon, 19 Dec 2016 07:59:44 +0000 (16:59 +0900)]
Rollup merge of #38459 - nagisa:rustbuild-exec, r=alexcrichton

Use exec for the wrapper on UNIXes

This not only avoids the small – and unnecessary – constant overhead for each compiler invocation,
but also helps somewhat by only having “correct” rustc processes to look for in `/proc/`.

This also makes the wrapper behave effectively as a regular exec wrapper its intended to be.

I also took liberty to change the fallback error code from `1` to `0xfe` (now only relevant on windows) so that when people complain about “compiler exited with code 254”, its obvious where the issue lies (wrapper losing the exit code somehow).

r? @alexcrichton

7 years agoRollup merge of #38445 - est31:master, r=apasel422
Seo Sanghyeon [Mon, 19 Dec 2016 07:59:44 +0000 (16:59 +0900)]
Rollup merge of #38445 - est31:master, r=apasel422

stage0.txt: typo fix

7 years agoRollup merge of #38438 - alexcrichton:update-beta, r=brson
Seo Sanghyeon [Mon, 19 Dec 2016 07:59:43 +0000 (16:59 +0900)]
Rollup merge of #38438 - alexcrichton:update-beta, r=brson

Update beta bootstrap compiler

The current beta that rustc is bootstrapping from contains a bug in Cargo that
erroneously links to OpenSSL in /usr/local, but this is fixed in the most recent
1.14 beta, so let's use that.

7 years agoRollup merge of #38433 - GuillaumeGomez:thread_docs, r=frewsxcv
Seo Sanghyeon [Mon, 19 Dec 2016 07:59:41 +0000 (16:59 +0900)]
Rollup merge of #38433 - GuillaumeGomez:thread_docs, r=frewsxcv

Thread docs

r? @frewscvx

7 years agoRollup merge of #38422 - zackmdavis:enjoy_tidy_path_error_macro_nicety, r=bluss
Seo Sanghyeon [Mon, 19 Dec 2016 07:59:40 +0000 (16:59 +0900)]
Rollup merge of #38422 - zackmdavis:enjoy_tidy_path_error_macro_nicety, r=bluss

tidy features: use 2-parameter form of internal try macro for open err

This tiny patch merely applies @bluss's suggestion for how to get a more
informative error message when the feature check can't open a file, a
matter that had briefly annoyed the present author, leading to the
filing of #38417.

Resolves #38417.

7 years agoRollup merge of #38421 - apasel422:issue-36934, r=alexcrichton
Seo Sanghyeon [Mon, 19 Dec 2016 07:59:38 +0000 (16:59 +0900)]
Rollup merge of #38421 - apasel422:issue-36934, r=alexcrichton

Replace invalid use of `&mut` with `UnsafeCell` in `std::sync::mpsc`

Closes #36934

r? @alexcrichton

7 years agoRollup merge of #38413 - rillian:armv7-neon, r=alexcrichton
Seo Sanghyeon [Mon, 19 Dec 2016 07:59:37 +0000 (16:59 +0900)]
Rollup merge of #38413 - rillian:armv7-neon, r=alexcrichton

rustc: Disable NEON on armv7 android.

We thought Google's ABI for arvm7 required neon, but it is
currently optional, perhaps because there is a significant
population of Tegra 2 devices still in use.

This turns off neon code generation outside #[target-feature]
blocks just like we do on armv7-unknown-linux-gnu, but unlike
most other armv7 targets. LLVM defaults to +neon for this target,
so an explicit disable is necessary.

See https://developer.android.com/ndk/guides/abis.html#v7a
for instruction set extension requirements.

Closes #38402.

7 years agoRollup merge of #38397 - frewsxcv:platform-specific-process-exit, r=alexcrichton
Seo Sanghyeon [Mon, 19 Dec 2016 07:59:36 +0000 (16:59 +0900)]
Rollup merge of #38397 - frewsxcv:platform-specific-process-exit, r=alexcrichton

Document platform-specific differences for `std::process::exit`.

Fixes https://github.com/rust-lang/rust/issues/35046.

7 years agoRollup merge of #38334 - frewsxcv:BuildHasherDefault, r=GuillaumeGomez
Seo Sanghyeon [Mon, 19 Dec 2016 07:59:35 +0000 (16:59 +0900)]
Rollup merge of #38334 - frewsxcv:BuildHasherDefault, r=GuillaumeGomez

Rewrite, improve documentation for `core::hash::BuildHasherDefault`.

Fixes https://github.com/rust-lang/rust/issues/31242.

7 years agoAuto merge of #38411 - japaric:gh38406, r=alexcrichton
bors [Mon, 19 Dec 2016 07:52:42 +0000 (07:52 +0000)]
Auto merge of #38411 - japaric:gh38406, r=alexcrichton

llvm: backport r280651

fixes #38406

r? @alexcrichton

(I'm secretly hoping this will error in the same way as #38314. That would sort of confirm that the problem is OOM and not enabling the SPARC backend)

7 years agoAuto merge of #38194 - sgrif:sg-no-span-mangling, r=nrc
bors [Mon, 19 Dec 2016 04:39:18 +0000 (04:39 +0000)]
Auto merge of #38194 - sgrif:sg-no-span-mangling, r=nrc

Don't perform span mangling when building field/tup access nodes

There are no guarantees that the two spans used to create the new one
come from the same place or are even valid.

Fixes #36081.

7 years agoAuto merge of #38140 - jseyfried:proc_macro_visibility, r=nrc
bors [Mon, 19 Dec 2016 01:23:32 +0000 (01:23 +0000)]
Auto merge of #38140 - jseyfried:proc_macro_visibility, r=nrc

Require `#[proc_macro_derive]` functions to be `pub`

r? @nrc

7 years agoAuto merge of #38051 - sanxiyn:unused-type-alias-3, r=eddyb
bors [Sun, 18 Dec 2016 22:06:34 +0000 (22:06 +0000)]
Auto merge of #38051 - sanxiyn:unused-type-alias-3, r=eddyb

 Warn unused type aliases, reimplemented

Reimplementation of #37631. Fix #37455.

7 years agoUse exec for the wrapper on UNIXes
Simonas Kazlauskas [Sun, 18 Dec 2016 21:45:39 +0000 (23:45 +0200)]
Use exec for the wrapper on UNIXes

This not only avoids the small – and unnecessary – constant overhead for each compiler invocation,
but also helps somewhat by only having “correct” rustc processes to look for in `/proc/`.

This also makes the wrapper behave effectively as a regular exec wrapper its intended to be.

7 years agoDocument platform-specific differences for `std::process::exit`.
Corey Farwell [Thu, 15 Dec 2016 21:07:37 +0000 (16:07 -0500)]
Document platform-specific differences for `std::process::exit`.

Fixes https://github.com/rust-lang/rust/issues/35046.

7 years agoAuto merge of #38369 - aturon:stab-1.15, r=alexcrichton
bors [Sun, 18 Dec 2016 17:37:25 +0000 (17:37 +0000)]
Auto merge of #38369 - aturon:stab-1.15, r=alexcrichton

Library stabilizations/deprecations for 1.15 release

Stabilized:

- `std::iter::Iterator::{min_by, max_by}`
- `std::os::*::fs::FileExt`
- `std::sync::atomic::Atomic*::{get_mut, into_inner}`
- `std::vec::IntoIter::{as_slice, as_mut_slice}`
- `std::sync::mpsc::Receiver::try_iter`
- `std::os::unix::process::CommandExt::before_exec`
- `std::rc::Rc::{strong_count, weak_count}`
- `std::sync::Arc::{strong_count, weak_count}`
- `std::char::{encode_utf8, encode_utf16}`
- `std::cell::Ref::clone`
- `std::io::Take::into_inner`

Deprecated:

- `std::rc::Rc::{would_unwrap, is_unique}`
- `std::cell::RefCell::borrow_state`

Closes #23755
Closes #27733
Closes #27746
Closes #27784
Closes #28356
Closes #31398
Closes #34931
Closes #35601
Closes #35603
Closes #35918
Closes #36105

7 years agoUpdate commit hash in cargotest
Seo Sanghyeon [Thu, 8 Dec 2016 06:59:40 +0000 (15:59 +0900)]
Update commit hash in cargotest

7 years agoFix Windows
Seo Sanghyeon [Thu, 15 Dec 2016 09:47:05 +0000 (18:47 +0900)]
Fix Windows

7 years agoAdd missing urls for thread doc module
Guillaume Gomez [Sat, 17 Dec 2016 17:09:05 +0000 (18:09 +0100)]
Add missing urls for thread doc module

7 years agoAuto merge of #37429 - camlorn:univariant_layout_optimization, r=eddyb
bors [Sun, 18 Dec 2016 07:59:32 +0000 (07:59 +0000)]
Auto merge of #37429 - camlorn:univariant_layout_optimization, r=eddyb

struct field reordering and optimization

This is work in progress.  The goal is to divorce the order of fields in source code from the order of fields in the LLVM IR, then optimize structs (and tuples/enum variants)by always ordering fields from least to most aligned.  It does not work yet.  I intend to check compiler memory usage as a benchmark, and a crater run will probably be required.

I don't know enough of the compiler to complete this work unaided.  If you see places that still need updating, please mention them.  The only one I know of currently is debuginfo, which I'm putting off intentionally until a bit later.

r? @eddyb

7 years agoAuto merge of #38440 - alexcrichton:fix-osx-nightlies, r=brson
bors [Sun, 18 Dec 2016 04:38:27 +0000 (04:38 +0000)]
Auto merge of #38440 - alexcrichton:fix-osx-nightlies, r=brson

rustbuild: Fix LC_ID_DYLIB directives on OSX

Currently libraries installed by rustbuild on OSX have an incorrect
`LC_ID_DYLIB` directive located in the dynamic libraries that are
installed. The directive we expect looks like:

    @rpath/libstd.dylib

Which means that if you want to find that dynamic library you should
look at the dylib's other `@rpath` directives. Typically our `@rpath`
directives look like `@loader_path/../lib` for the compiler as that's
where the installed libraries will be located. Currently, though,
rustbuild produces dylibs with the directive that looks like:

    /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/libstd-713ad88203512705.dylib

In other words, the build directory is encoded erroneously. The compiler
already [knows how] to change this directive, but it only passes that
argument when `-C rpath` is also passed. The rustbuild system, however,
explicitly [does not pass] this option explicitly and instead bakes its
own. This logic then also erroneously didn't pass `-Wl,-install_name`
like the compiler.

[knows how]: https://github.com/rust-lang/rust/blob/4a008cccaabc8b3fe65ccf5868b9d16319c9ac58/src/librustc_trans/back/linker.rs#L210-L214
[does not pass]: https://github.com/rust-lang/rust/blob/4a008cccaabc8b3fe65ccf5868b9d16319c9ac58/src/bootstrap/bin/rustc.rs#L133-L158

To fix this regression this patch introduces a new `-Z` flag, `-Z
osx-rpath-install-name` which basically just forces the compiler to take
the previous `-install_name` branch when creating a dynamic library.
Hopefully we can sort out a better rpath story in the future, but for
now this "hack" should suffice in getting our nightly builds back to the
same state as before.

Closes #38430

7 years agostage0.txt: typo fix
est31 [Sun, 18 Dec 2016 02:12:18 +0000 (03:12 +0100)]
stage0.txt: typo fix

7 years agoAuto merge of #38439 - alexcrichton:fix-nightlies, r=brson
bors [Sun, 18 Dec 2016 01:07:35 +0000 (01:07 +0000)]
Auto merge of #38439 - alexcrichton:fix-nightlies, r=brson

rustbuild: Create directories in mingw dist

Previously we accidentally relied on the mingw dist step running last, but the
step just needed to ensure the directories were created.

7 years agorustbuild: Fix LC_ID_DYLIB directives on OSX
Alex Crichton [Sat, 17 Dec 2016 22:11:02 +0000 (14:11 -0800)]
rustbuild: Fix LC_ID_DYLIB directives on OSX

Currently libraries installed by rustbuild on OSX have an incorrect
`LC_ID_DYLIB` directive located in the dynamic libraries that are
installed. The directive we expect looks like:

    @rpath/libstd.dylib

Which means that if you want to find that dynamic library you should
look at the dylib's other `@rpath` directives. Typically our `@rpath`
directives look like `@loader_path/../lib` for the compiler as that's
where the installed libraries will be located. Currently, though,
rustbuild produces dylibs with the directive that looks like:

    /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/libstd-713ad88203512705.dylib

In other words, the build directory is encoded erroneously. The compiler
already [knows how] to change this directive, but it only passes that
argument when `-C rpath` is also passed. The rustbuild system, however,
explicitly [does not pass] this option explicitly and instead bakes its
own. This logic then also erroneously didn't pass `-Wl,-install_name`
like the compiler.

[knows how]: https://github.com/rust-lang/rust/blob/4a008cccaabc8b3fe65ccf5868b9d16319c9ac58/src/librustc_trans/back/linker.rs#L210-L214
[does not pass]: https://github.com/rust-lang/rust/blob/4a008cccaabc8b3fe65ccf5868b9d16319c9ac58/src/bootstrap/bin/rustc.rs#L133-L158

To fix this regression this patch introduces a new `-Z` flag, `-Z
osx-rpath-install-name` which basically just forces the compiler to take
the previous `-install_name` branch when creating a dynamic library.
Hopefully we can sort out a better rpath story in the future, but for
now this "hack" should suffice in getting our nightly builds back to the
same state as before.

Closes #38430

7 years agorustbuild: Create directories in mingw dist
Alex Crichton [Sat, 17 Dec 2016 21:51:51 +0000 (13:51 -0800)]
rustbuild: Create directories in mingw dist

Previously we accidentally relied on the mingw dist step running last, but the
step just needed to ensure the directories were created.

7 years agoAuto merge of #38279 - KalitaAlexey:issue-8521, r=jseyfried
bors [Sat, 17 Dec 2016 21:49:51 +0000 (21:49 +0000)]
Auto merge of #38279 - KalitaAlexey:issue-8521, r=jseyfried

macros: allow a `path` fragment to be parsed as a type parameter bound

Allow a `path` fragment to be parsed as a type parameter bound.
Fixes #8521.

7 years agoUpdate beta bootstrap compiler
Alex Crichton [Sat, 17 Dec 2016 21:47:31 +0000 (13:47 -0800)]
Update beta bootstrap compiler

The current beta that rustc is bootstrapping from contains a bug in Cargo that
erroneously links to OpenSSL in /usr/local, but this is fixed in the most recent
1.14 beta, so let's use that.

7 years agoAuto merge of #38122 - brson:book-rustup, r=steveklabnik
bors [Sat, 17 Dec 2016 17:25:30 +0000 (17:25 +0000)]
Auto merge of #38122 - brson:book-rustup, r=steveklabnik

Update book for rustup

Supersedes https://github.com/rust-lang/rust/pull/37934

Don't land yet. Needs coordination with https://github.com/rust-lang/rust-www/pull/621

Fixes https://github.com/rust-lang/rust/issues/35653

r? @steveklabnik

7 years agoAuto merge of #38419 - alexcrichton:travis-osx-32-bit, r=brson
bors [Sat, 17 Dec 2016 11:10:11 +0000 (11:10 +0000)]
Auto merge of #38419 - alexcrichton:travis-osx-32-bit, r=brson

travis: Fix testing 32-bit OSX target

We passed --target when we meant to pass --build, meaning we tested only the
standard library for 32-bit, not the whole compiler like we intended.

7 years agoAuto merge of #38205 - jseyfried:fix_module_directory_regression, r=eddyb
bors [Sat, 17 Dec 2016 06:43:16 +0000 (06:43 +0000)]
Auto merge of #38205 - jseyfried:fix_module_directory_regression, r=eddyb

macros: fix the expected paths for a non-inline module matched by an `item` fragment

Fixes #38190.
r? @nrc

7 years agoAddress fallout
Aaron Turon [Wed, 14 Dec 2016 21:02:00 +0000 (13:02 -0800)]
Address fallout

7 years agotidy features: use 2-parameter form of internal try macro for open err
Zack M. Davis [Sat, 17 Dec 2016 01:45:59 +0000 (17:45 -0800)]
tidy features: use 2-parameter form of internal try macro for open err

This tiny patch merely applies @bluss's suggestion for how to get a more
informative error message when the feature check can't open a file, a
matter that had briefly annoyed the present author, leading to the
filing of #38417.

7 years agoReplace invalid use of `&mut` with `UnsafeCell` in `std::sync::mpsc`
Andrew Paseltiner [Fri, 16 Dec 2016 23:10:09 +0000 (18:10 -0500)]
Replace invalid use of `&mut` with `UnsafeCell` in `std::sync::mpsc`

Closes #36934

7 years agotravis: Fix testing 32-bit OSX target
Alex Crichton [Sat, 17 Dec 2016 00:32:40 +0000 (16:32 -0800)]
travis: Fix testing 32-bit OSX target

We passed --target when we meant to pass --build, meaning we tested only the
standard library for 32-bit, not the whole compiler like we intended.

7 years agoUpdate book for rustup
Brian Anderson [Fri, 2 Dec 2016 01:17:32 +0000 (01:17 +0000)]
Update book for rustup

7 years agoBook: rustup.sh -> rustup.rs
Steve Klabnik [Tue, 22 Nov 2016 18:31:09 +0000 (13:31 -0500)]
Book: rustup.sh -> rustup.rs

Fixes #35653

cc https://github.com/rust-lang/rust-www/pull/621

7 years agoflock needs repr(C)
Austin Hicks [Fri, 16 Dec 2016 20:50:14 +0000 (15:50 -0500)]
flock needs repr(C)

7 years agorustc: Link to Android ABI requirements.
Ralph Giles [Fri, 16 Dec 2016 19:27:12 +0000 (11:27 -0800)]
rustc: Link to Android ABI requirements.

Hopefully these references will be stable and provide guidance
when requirements change in the future.

7 years agorustc: Disable NEON on armv7 android.
Ralph Giles [Fri, 16 Dec 2016 18:54:48 +0000 (10:54 -0800)]
rustc: Disable NEON on armv7 android.

We thought Google's ABI for arvm7 required neon, but it is
currently optional, perhaps because there is a significant
population of Tegra 2 devices still in use.

This turns off neon code generation outside #[target-feature]
blocks just like we do on armv7-unknown-linux-gnu, but unlike
most other armv7 targets. LLVM defaults to +neon for this target,
so an explicit disable is necessary.

See https://developer.android.com/ndk/guides/abis.html#v7a
for instruction set extension requirements.

Closes #38402.

7 years agollvm: backport r280651
Jorge Aparicio [Fri, 16 Dec 2016 05:58:50 +0000 (00:58 -0500)]
llvm: backport r280651

fixes #38406

7 years agoRewrite, improve documentation for `core::hash::BuildHasherDefault`.
Corey Farwell [Tue, 13 Dec 2016 02:03:08 +0000 (21:03 -0500)]
Rewrite, improve documentation for `core::hash::BuildHasherDefault`.

Fixes https://github.com/rust-lang/rust/issues/31242.

7 years agoIncorporate review comments.
Austin Hicks [Fri, 16 Dec 2016 17:06:12 +0000 (12:06 -0500)]
Incorporate review comments.

7 years agoAllow path fragments to be parsed as type parameter bounds in macro expansion
Kalita Alexey [Fri, 16 Dec 2016 11:16:46 +0000 (14:16 +0300)]
Allow path fragments to be parsed as type parameter bounds in macro expansion

7 years agoAuto merge of #38359 - alexcrichton:sccache, r=brson
bors [Fri, 16 Dec 2016 07:26:41 +0000 (07:26 +0000)]
Auto merge of #38359 - alexcrichton:sccache, r=brson

rustbuild: Add sccache support

This commit adds support for sccache, a ccache-like compiler which works on MSVC
and stores results into an S3 bucket. This also switches over all Travis and
AppVeyor automation to using sccache to ensure a shared and unified cache over
time which can be shared across builders.

The support for sccache manifests as a new `--enable-sccache` option which
instructs us to configure LLVM differently to use a 'sccache' binary instead of
a 'ccache' binary. All docker images for Travis builds are updated to download
Mozilla's tooltool builds of sccache onto various containers and systems.
Additionally a new `rust-lang-ci-sccache` bucket is configured to hold all of
our ccache goodies.

---

Note that this does not currently change Windows [due to previously written up issues](https://github.com/rust-lang/rust/issues/38119#issuecomment-266631585). Despite that, however, I was curious to get timings for the builds on Travis to see what ranges we're working with. As a result, this is a WIP PR I'm using to gauge build times and such.

7 years agoAuto merge of #38357 - arielb1:deterministic-hash, r=michaelwoerister
bors [Fri, 16 Dec 2016 03:56:47 +0000 (03:56 +0000)]
Auto merge of #38357 - arielb1:deterministic-hash, r=michaelwoerister

make deterministic_hash host-architecture-independent

`DefPath::deterministic_hash` used to call `std::hash::Hash`, which depends on the current architecture in several ways, which would prevent metadata written on one host architecture from being successfully read on another one.

Use a hasher we control instead.

Fixes #38177.

r? @michaelwoerister

7 years agorustbuild: Fix `copy` helper with existing files
Alex Crichton [Fri, 16 Dec 2016 03:48:33 +0000 (19:48 -0800)]
rustbuild: Fix `copy` helper with existing files

This erroneously truncated files when the destination already existed and was an
existing hard link to the source. This in turn caused weird bugs!

Closes #37745

7 years agoAuto merge of #38352 - bluss:unaligned-metadata, r=eddyb
bors [Fri, 16 Dec 2016 00:52:35 +0000 (00:52 +0000)]
Auto merge of #38352 - bluss:unaligned-metadata, r=eddyb

Fix unaligned loads in librustc_metadata

Creating a `&[u32]` from an `&[u8]` is not necessarily valid, and crashes
on certain platforms if the data is not well aligned.

7 years agoAuto merge of #38394 - alexcrichton:fix-nightlies, r=brson
bors [Thu, 15 Dec 2016 19:43:28 +0000 (19:43 +0000)]
Auto merge of #38394 - alexcrichton:fix-nightlies, r=brson

rustbuild: Package rust-mingw by default

This fixes the `make dist` step on MinGW to package the `rust-mingw` component
by default. This should hopefully be the last step in fixing nightlies.

7 years agoStabilize std::io::Take::into_inner
Aaron Turon [Wed, 14 Dec 2016 20:39:16 +0000 (12:39 -0800)]
Stabilize std::io::Take::into_inner

7 years agoDeprecate std::cell::RefCell::borrow_state
Aaron Turon [Wed, 14 Dec 2016 20:38:14 +0000 (12:38 -0800)]
Deprecate std::cell::RefCell::borrow_state

7 years agoStabilize std::cell::Ref::clone
Aaron Turon [Wed, 14 Dec 2016 20:36:49 +0000 (12:36 -0800)]
Stabilize std::cell::Ref::clone

7 years agoStabilize std::char::{encode_utf8, encode_utf16}
Aaron Turon [Wed, 14 Dec 2016 20:34:02 +0000 (12:34 -0800)]
Stabilize std::char::{encode_utf8, encode_utf16}

7 years agoStabilize:
Aaron Turon [Wed, 14 Dec 2016 20:27:30 +0000 (12:27 -0800)]
Stabilize:

- `std::rc::Rc::{strong_count, weak_count}`
- `std::sync::Arc::{strong_count, weak_count}`

Deprecate:

- `std::rc::Rc::{would_unwrap, is_unique}`

7 years agoStabilize std::os::unix::process::CommandExt::before_exec
Aaron Turon [Wed, 14 Dec 2016 20:22:15 +0000 (12:22 -0800)]
Stabilize std::os::unix::process::CommandExt::before_exec

7 years agoStabilize std::sync::mpsc::Receiver::try_iter
Aaron Turon [Wed, 14 Dec 2016 20:20:38 +0000 (12:20 -0800)]
Stabilize std::sync::mpsc::Receiver::try_iter

7 years agoStabilize std::vec::IntoIter::{as_slice, as_mut_slice}
Aaron Turon [Wed, 14 Dec 2016 20:15:22 +0000 (12:15 -0800)]
Stabilize std::vec::IntoIter::{as_slice, as_mut_slice}

7 years agoStabilize std::sync::atomic::Atomic*::{get_mut, into_inner}
Aaron Turon [Wed, 14 Dec 2016 20:13:12 +0000 (12:13 -0800)]
Stabilize std::sync::atomic::Atomic*::{get_mut, into_inner}

7 years agoStabilize std::os::*::fs::FileExt
Aaron Turon [Wed, 14 Dec 2016 19:35:05 +0000 (11:35 -0800)]
Stabilize std::os::*::fs::FileExt

7 years agoStabilize Iterator::{min_by, max_by}
Aaron Turon [Wed, 14 Dec 2016 19:20:55 +0000 (11:20 -0800)]
Stabilize Iterator::{min_by, max_by}

7 years agoUse StableHasher everywhere
Ariel Ben-Yehuda [Tue, 13 Dec 2016 23:45:03 +0000 (01:45 +0200)]
Use StableHasher everywhere

The standard implementations of Hasher have architecture-dependent
results when hashing integers. This causes problems when the hashes are
stored within metadata - metadata written by one host architecture can't
be read by another.

To fix that, implement an architecture-independent StableHasher and use
it in all places an architecture-independent hasher is needed.

Fixes #38177.

7 years agorustbuild: Package rust-mingw by default
Alex Crichton [Thu, 15 Dec 2016 18:05:41 +0000 (10:05 -0800)]
rustbuild: Package rust-mingw by default

This fixes the `make dist` step on MinGW to package the `rust-mingw` component
by default. This should hopefully be the last step in fixing nightlies.

7 years agoAuto merge of #38331 - bluss:assume-stage, r=alexcrichton
bors [Thu, 15 Dec 2016 14:01:55 +0000 (14:01 +0000)]
Auto merge of #38331 - bluss:assume-stage, r=alexcrichton

rustbuild: Add cli option --keep-stage

This option is intended to be used like:

./x.py build --stage 1 --keep-stage 0

Which skips all stage 0 steps, so that stage 1 can be recompiled
directly (even if for example libcore has changes).

This is useful when working on `cfg(not(stage0))` parts of the
libraries or when re-running stage 1 tests in libraries in general.

Fixes #38326

7 years agoWarn unused type aliases
Seo Sanghyeon [Mon, 28 Nov 2016 15:46:09 +0000 (00:46 +0900)]
Warn unused type aliases

7 years agoRemove now unnecessary code
Seo Sanghyeon [Mon, 28 Nov 2016 14:30:48 +0000 (23:30 +0900)]
Remove now unnecessary code

This code was introduced in #27565 to mark types in paths alive. It is now unnecessary since #37676.

7 years agoAuto merge of #38185 - jsgf:test-list, r=alexcrichton
bors [Thu, 15 Dec 2016 09:26:25 +0000 (09:26 +0000)]
Auto merge of #38185 - jsgf:test-list, r=alexcrichton

libtest: add --list option to list tests and benchmarks

This option lists all the tests and benchmarks a binary provides without running any of them.
By default the listing is sent to stdout (intended for human consumption), but if `--logfile` is also specified, it is also written there in an easily parsable form.

If filters are specified, they're applied before the output is emitted. The human output will also include a summary unless `-q` is specified.

7 years agoAuto merge of #37702 - redox-os:redox, r=brson
bors [Thu, 15 Dec 2016 06:23:11 +0000 (06:23 +0000)]
Auto merge of #37702 - redox-os:redox, r=brson

Redox Support Preview

# Important - This is only a preview of a working `sys::redox`.

Compiling the Redox default distribution with this `libstd` results in a fully functioning distribution. As such, all further changes would be cosmetic or implementing features that have not been used by the default distribution (of which there are only a small number).

I do not expect this to be merged, but would like to discuss how it may be improved and get feedback.

There are a few `unimplemented!()` - `cloexec` for example. I have documented them below. These would be resolved before desiring a merge.

There are also issues with how the Redox syscall library is called - currently I am using a re-export in `libc` but that probably would not be desired.

7 years agoRequire `#[proc_macro_derive]` functions to be `pub`.
Jeffrey Seyfried [Sat, 3 Dec 2016 02:00:17 +0000 (02:00 +0000)]
Require `#[proc_macro_derive]` functions to be `pub`.

7 years agoAuto merge of #38375 - petrochenkov:prim, r=eddyb
bors [Thu, 15 Dec 2016 02:39:34 +0000 (02:39 +0000)]
Auto merge of #38375 - petrochenkov:prim, r=eddyb

Fix regression in resolution of primitive types

Fix often encountered ICE.
Extracted from https://github.com/rust-lang/rust/pull/38154
Fixes https://github.com/rust-lang/rust/issues/38155, fixes https://github.com/rust-lang/rust/issues/38188, fixes https://github.com/rust-lang/rust/issues/38277, fixes https://github.com/rust-lang/rust/issues/38280, fixes https://github.com/rust-lang/rust/issues/38292, fixes https://github.com/rust-lang/rust/issues/38311, fixes https://github.com/rust-lang/rust/issues/38344, fixes https://github.com/rust-lang/rust/issues/38363, fixes https://github.com/rust-lang/rust/issues/38372 (duplicates)

r? @jseyfried or @eddyb or @nrc

7 years agorustbuild: Add small description of --keep-stage
Ulrik Sverdrup [Thu, 15 Dec 2016 00:10:44 +0000 (01:10 +0100)]
rustbuild: Add small description of --keep-stage

7 years agorustbuild: Add sccache support
Alex Crichton [Mon, 12 Dec 2016 19:36:52 +0000 (11:36 -0800)]
rustbuild: Add sccache support

This commit adds support for sccache, a ccache-like compiler which works on MSVC
and stores results into an S3 bucket. This also switches over all Travis and
AppVeyor automation to using sccache to ensure a shared and unified cache over
time which can be shared across builders.

The support for sccache manifests as a new `--enable-sccache` option which
instructs us to configure LLVM differently to use a 'sccache' binary instead of
a 'ccache' binary. All docker images for Travis builds are updated to download
Mozilla's tooltool builds of sccache onto various containers and systems.
Additionally a new `rust-lang-ci-sccache` bucket is configured to hold all of
our ccache goodies.

7 years agoAuto merge of #38374 - alexcrichton:makefile-fix, r=brson
bors [Wed, 14 Dec 2016 23:37:21 +0000 (23:37 +0000)]
Auto merge of #38374 - alexcrichton:makefile-fix, r=brson

mk: Fix `make check`

When the rustc-unicode crate was renamed to std-unicode we just need to continue
to filter it out of the crates being tested.

7 years agoFix regression in resolution of primitive types
Vadim Petrochenkov [Wed, 14 Dec 2016 23:12:08 +0000 (02:12 +0300)]
Fix regression in resolution of primitive types

7 years agomk: Fix `make check`
Alex Crichton [Wed, 14 Dec 2016 23:05:20 +0000 (15:05 -0800)]
mk: Fix `make check`

When the rustc-unicode crate was renamed to std-unicode we just need to continue
to filter it out of the crates being tested.

7 years agoAuto merge of #38367 - alexcrichton:fix-nightiles, r=brson
bors [Wed, 14 Dec 2016 20:35:10 +0000 (20:35 +0000)]
Auto merge of #38367 - alexcrichton:fix-nightiles, r=brson

rustbuild: Run `dist` on a `distcheck`

This is what the nightly bots expect, so let's be sure to do that.

7 years agorustbuild: Run `dist` on a `distcheck`
Alex Crichton [Wed, 14 Dec 2016 18:59:17 +0000 (10:59 -0800)]
rustbuild: Run `dist` on a `distcheck`

This is what the nightly bots expect, so let's be sure to do that.

7 years agolibtest: add --list option to list tests and benchmarks
Jeremy Fitzhardinge [Mon, 5 Dec 2016 22:54:28 +0000 (14:54 -0800)]
libtest: add --list option to list tests and benchmarks

This option lists all the tests and benchmarks a binary provides. By default the listing
is sent to stdout, but if --logfile is also specified, it is written there.

If filters are specified, they're applied before the output is emitted.

7 years agoAuto merge of #38295 - dylanmckay:llvm-4.0-di-globalvar, r=michaelwoerister
bors [Wed, 14 Dec 2016 17:36:01 +0000 (17:36 +0000)]
Auto merge of #38295 - dylanmckay:llvm-4.0-di-globalvar, r=michaelwoerister

[LLVM 4.0] Update LLVM global variable debug info API for 4.0

This teaches Rust about an LLVM 4.0 API change for creating debug info
for global variables.

This change was made in upstream LLVM patch https://reviews.llvm.org/D20147

This is almost a 1:1 copy of how clang did it in http://reviews.llvm.org/D20415

7 years agoAdd a case to type-sizes to explicitly verify that field reordering triggers.
Austin Hicks [Wed, 7 Dec 2016 17:42:07 +0000 (12:42 -0500)]
Add a case to type-sizes to explicitly verify that field reordering triggers.

7 years agoFix computation of enum names based off the discrfield in the case of the null pointe...
Austin Hicks [Sat, 3 Dec 2016 00:24:24 +0000 (19:24 -0500)]
Fix computation of enum names based off the discrfield in the case of the null pointer optimization.  This functionality is needed by pretty printers for gdb and lldb.

7 years agoFix error introduced during last rebase
Austin Hicks [Wed, 30 Nov 2016 21:21:40 +0000 (16:21 -0500)]
Fix error introduced during last rebase

7 years agoFix -Z print-type-sizes and tests.
Austin Hicks [Sat, 26 Nov 2016 19:37:15 +0000 (14:37 -0500)]
Fix -Z print-type-sizes and tests.

This was done by sorting the fields by increasing offset; as a consequence, the order of -Z print-type-sizes matches memory order not source order.

7 years agoIncorporate review comments
Austin Hicks [Wed, 23 Nov 2016 22:43:36 +0000 (17:43 -0500)]
Incorporate review comments

7 years agoSome small fixes to how structs/enums are optimized
Austin Hicks [Wed, 23 Nov 2016 21:50:36 +0000 (16:50 -0500)]
Some small fixes to how structs/enums are optimized

7 years agoMake tidy
Austin Hicks [Wed, 23 Nov 2016 21:31:21 +0000 (16:31 -0500)]
Make tidy

7 years agoFix closure arguments which are immediate because of field reordering.
Austin Hicks [Wed, 23 Nov 2016 19:48:31 +0000 (14:48 -0500)]
Fix closure arguments which are immediate because of field reordering.

While building immediates goes through type_of::type_of, extracting them must account for field reorderings.

7 years agoFix having multiple reprs on the same type.
Austin Hicks [Wed, 23 Nov 2016 15:19:22 +0000 (10:19 -0500)]
Fix having multiple reprs on the same type.

This bug has applied to master for an indefinite period of time and is orthogonal to univariant layout optimization.

7 years agoChange how type-sizes works slightly: we want to ensure that [i16; 0] introduces...
Austin Hicks [Tue, 22 Nov 2016 20:18:28 +0000 (15:18 -0500)]
Change how type-sizes works slightly: we want to ensure that [i16; 0] introduces padding

7 years agoMake tidy
Austin Hicks [Tue, 22 Nov 2016 20:03:55 +0000 (15:03 -0500)]
Make tidy

7 years agoFix type-sizes test
Austin Hicks [Tue, 22 Nov 2016 19:53:42 +0000 (14:53 -0500)]
Fix type-sizes test

7 years agoFix checking to see if the last field of a struct can be unsized.
Austin Hicks [Tue, 22 Nov 2016 19:10:52 +0000 (14:10 -0500)]
Fix checking to see if the last field of a struct can be unsized.

7 years agoDon't optimize pairs
Austin Hicks [Tue, 22 Nov 2016 01:38:47 +0000 (20:38 -0500)]
Don't optimize pairs

7 years agoFirst attempt at detecting if structs can ever be unsized
Austin Hicks [Tue, 22 Nov 2016 00:26:56 +0000 (19:26 -0500)]
First attempt at detecting if structs can ever be unsized