bors [Wed, 4 Jan 2017 20:06:21 +0000 (20:06 +0000)]
Auto merge of #38783 - alexcrichton:stabilize-proc-macro, r=nikomatsakis
rustc: Stabilize the `proc_macro` feature
This commit stabilizes the `proc_macro` and `proc_macro_lib` features in the
compiler to stabilize the "Macros 1.1" feature of the language. Many more
details can be found on the tracking issue, #35900.
bors [Wed, 4 Jan 2017 14:26:17 +0000 (14:26 +0000)]
Auto merge of #38670 - dotdash:transmute_align, r=eddyb
Fix transmute::<T, U> where T requires a bigger alignment than U
For transmute::<T, U> we simply pointercast the destination from a U
pointer to a T pointer, without providing any alignment information,
thus LLVM assumes that the destination is aligned to hold a value of
type T, which is not necessarily true. This can lead to LLVM emitting
machine instructions that assume said alignment, and thus cause aborts.
To fix this, we need to provide the actual alignment to store_operand()
and in turn to store() so they can set the proper alignment information
on the stores and LLVM can emit the proper machine instructions.
bors [Wed, 4 Jan 2017 06:29:14 +0000 (06:29 +0000)]
Auto merge of #38552 - eddyb:bad-blocks, r=arielb1
Don't leak the compiler's internal representation of scopes in error messages.
Fixes #37884 (actually fixes #27942, which was made worse by #37412) by handling more node types.
Ideally we'd turn the unknown node type situations into ICEs and fix them as they show up in errors.
But we might want to backport this patch so I was less aggressive.
Alex Crichton [Tue, 3 Jan 2017 22:16:05 +0000 (14:16 -0800)]
rustbuild: Update where we look for mtime changes
Recent versions of Cargo lift less output up into the "main" directory, so let's
look more inside the `deps` folder for changes to propagate differences.
Alex Crichton [Tue, 3 Jan 2017 22:07:30 +0000 (14:07 -0800)]
rustbuild: Allow create_sysroot in stage0
Despite what the comment says, we actually need to do this. We're not cleaning
out the stage0 compiler's sysroot, but rather just our own sysroot that we
assembled previously.
Some would argue that the inconsistency is æsthetically displeasing,
hence this trivial patch. (Note that run-pass/auxiliary/issue13507.rs
has an excuse; it's `use`d in run-pass/issue-13507-2.rs; the matter of
there being two different compile-fail tests with different name
conventions for issue no. 32829 is also neglected here for the sake of
keeping this trivial cleanup patch as trivial as possible for ease of
review.)
Alex Crichton [Mon, 2 Jan 2017 00:14:35 +0000 (16:14 -0800)]
rustc: Stabilize the `proc_macro` feature
This commit stabilizes the `proc_macro` and `proc_macro_lib` features in the
compiler to stabilize the "Macros 1.1" feature of the language. Many more
details can be found on the tracking issue, #35900.
bors [Mon, 2 Jan 2017 18:10:37 +0000 (18:10 +0000)]
Auto merge of #38760 - est31:ignorecfg, r=sanxiyn
Fix pre-cfg_attr notation in comment
Commit aa3b1261b164eeac3e68573bfc698d1ca943fb05 has changed notation
in the test from `#[ignore(cfg(ignorecfg))]` to `#[cfg_attr(ignorecfg, ignore)]`,
but missed to change the comment in the accompanying Makefile.
bors [Mon, 2 Jan 2017 13:51:43 +0000 (13:51 +0000)]
Auto merge of #38766 - eddyb:less-fake-hir, r=arielb1
Stop creating fake HIR pattern nodes.
This replaces all the HIR patterns `rustc_const_eval` creates with the more appropriate HAIR equivalent.
The only place left that creates HIR nodes is the "explicit lifetimes in function signature" suggestion, which only creates type nodes while rebuilding the signature, but that is only in case of an error.
bors [Sun, 1 Jan 2017 20:43:21 +0000 (20:43 +0000)]
Auto merge of #38765 - xen0n:i-dont-like-red-bots-2, r=alexcrichton
rustbuild: fix dist-analysis with full bootstrap disabled
Really fixes #38734, per discussion in #38752 which was solving the underlying problem the wrong way.
This just mirrors the [similar logic] in documentation building as suggested, that just takes the stage1 compiler artifacts instead in case of non-full-bootstrap builds. Actually copying the artifacts around seems to be unnecessary.
est31 [Sun, 1 Jan 2017 19:34:23 +0000 (20:34 +0100)]
Fix pre-cfg_attr notation in comment
Commit aa3b1261b164eeac3e68573bfc698d1ca943fb05 has changed notation
in the test from `#[ignore(cfg(ignorecfg))]` to `#[cfg_attr(ignorecfg, ignore)]`,
but missed to change the comment in the accompanying Makefile.
bors [Sun, 1 Jan 2017 11:58:02 +0000 (11:58 +0000)]
Auto merge of #38745 - CannedYerins:llvm-code-style, r=rkruppe
Improve naming style in rustllvm.
As per the LLVM style guide, use CamelCase for all locals and classes,
and camelCase for all non-FFI functions.
Also, make names of variables of commonly used types more consistent.
bors [Sun, 1 Jan 2017 09:56:18 +0000 (09:56 +0000)]
Auto merge of #38726 - japaric:sparc64, r=sanxiyn
sparc64-linux support
This is built on top of #38656 and depends on rust-lang/libc#483
Hello world works.
The libc-test test suite passes.
`panic!` doesn't fully work:
```
$ qemu-sparc64-static ./panic
thread 'main' panicked at 'explicit panic', panic.rs:1
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Illegal instruction (core dumped)
```
Backtraces don't work either, probably related to the previous point:
bors [Sat, 31 Dec 2016 22:08:32 +0000 (22:08 +0000)]
Auto merge of #38708 - alexcrichton:add-distcheck, r=brson
Gate on distcheck on Travis
This commit adds a new entry to the Travis matrix to gate on distcheck, the illustrious test process that has historically taken *8 hours* to complete and also breaks all the time on nightly. By adding it to Travis we should hope to never see nightly breakage (like https://github.com/rust-lang/rust/issues/38690) because of this ever again!
"But wait, surely we can't wait 8 hours for all PRs!" you might be thinking, and you are indeed correct. The distcheck added here is much more optimized for speed than the old buildbot instances for a number of reasons:
* We're not building *two host compilers* beforehand. The current distcheck bot does a cross for i686 Linux and x86_64 Linux before it actually runs distcheck, building 6 compilers and LLVM twice. None of this is done in parallel as well (e.g. `-j1`). Not doing any of this work will be a huge win!
* We're using sccache to compile LLVM, so it should be much faster. Distcheck on the bots didn't cache LLVM well and rebuilt it every time.
All in all, this version of "distcheck" should be exactly like other matrix entries that run tests except that it's a *little* slower to start as it has to create the source tarball then rebuild the build system in the distcheck dir. Overall this should be well under the 2 hours that Android is currently taking anyway.
bors [Sat, 31 Dec 2016 18:54:31 +0000 (18:54 +0000)]
Auto merge of #38482 - est31:i128, r=eddyb
i128 and u128 support
Brings i128 and u128 support to nightly rust, behind a feature flag. The goal of this PR is to do the bulk of the work for 128 bit integer support. Smaller but just as tricky features needed for stabilisation like 128 bit enum discriminants are left for future PRs.
Rebased version of #37900, which in turn was a rebase + improvement of #35954 . Sadly I couldn't reopen #37900 due to github. There goes my premium position in the homu queue...
Ian Kerins [Sat, 31 Dec 2016 17:01:23 +0000 (12:01 -0500)]
Improve naming style in rustllvm.
As per the LLVM style guide, use CamelCase for all locals and classes,
and camelCase for all non-FFI functions.
Also, make names of variables of commonly used types more consistent.
bors [Sat, 31 Dec 2016 12:44:32 +0000 (12:44 +0000)]
Auto merge of #38709 - alexcrichton:check-xsv, r=nikomatsakis
cargotest: Add xsv to tested crates
This was intended to land in #37149 but I ended up backing it out to land the
rollup (#38697) last night as I was itching to do so. This morning though xsv
has been fixed now (BurntSushi/xsv#53) so we should be able to add it!
Björn Steinbrink [Thu, 29 Dec 2016 01:20:26 +0000 (02:20 +0100)]
Fix transmute::<T, U> where T requires a bigger alignment than U
For transmute::<T, U> we simply pointercast the destination from a U
pointer to a T pointer, without providing any alignment information,
thus LLVM assumes that the destination is aligned to hold a value of
type T, which is not necessarily true. This can lead to LLVM emitting
machine instructions that assume said alignment, and thus cause aborts.
To fix this, we need to provide the actual alignment to store_operand()
and in turn to store() so they can set the proper alignment information
on the stores and LLVM can emit the proper machine instructions.
bors [Sat, 31 Dec 2016 08:21:59 +0000 (08:21 +0000)]
Auto merge of #38667 - alexcrichton:stage0-tools, r=brson
rustbuild: Compile all support tools in stage0
This commit changes all tools and such to get compiled in stage0, not in
later stages. The purpose of this commit is to cut down dependencies on later
stages for future modifications to the build system. Notably we're going to be
adding builders that produce a full suite of cross-compiled artifacts for a
particular host, and that shouldn't compile the `x86_64-unknown-linux-gnu`
compiler more than once. Currently dependencies on, for example, the error index
end up compiling the `x86_64-unknown-linux-gnu` compiler more than necessary.
As a result here we move many dependencies on these tools to being produced by a
stage0 compiler, not a stage1+ compiler. None of these tools actually need to be
staged at all, so they'll exhibit consistent behavior across the stages.
bors [Sat, 31 Dec 2016 04:44:52 +0000 (04:44 +0000)]
Auto merge of #38729 - alexcrichton:android-steps, r=brson
rustbuild: Add more deps on android-copy-libs
The android-copy-libs step is crucial for running tests on the Android target as
it copies necessary scripts and such to the emulator. We must run that before
running any tests there, but we erroneously only did it for compiletest test
suites!
Alex Crichton [Sat, 31 Dec 2016 02:54:05 +0000 (18:54 -0800)]
rustbuild: Add more deps on android-copy-libs
The android-copy-libs step is crucial for running tests on the Android target as
it copies necessary scripts and such to the emulator. We must run that before
running any tests there, but we erroneously only did it for compiletest test
suites!
Since discriminants do not support i128 yet, lets just calculate the boundaries within the 64 bits
that are supported. This also avoids an issue with bootstrapping on 32 bit systems due to #38727.
bors [Sat, 31 Dec 2016 00:50:46 +0000 (00:50 +0000)]
Auto merge of #38601 - schulzch:master, r=brson
Partial fix for #38489.
Fixes script name resolution for windows by invoking `emcc.bat` instead of `emcc`, etc.
Remaining issue:
```
Traceback (most recent call last):
File "C:\Program Files\Emscripten\emscripten\1.35.0\\emcc", line 1309, in <module>
final = shared.Building.llvm_opt(final, link_opts, DEFAULT_FINAL)
File "C:\Program Files\Emscripten\emscripten\1.35.0\tools\shared.py", line 1471, in llvm_opt
assert os.path.exists(target), 'Failed to run llvm optimizations: ' + output
AssertionError: Failed to run llvm optimizations:
```
Alex Crichton [Fri, 30 Dec 2016 17:56:43 +0000 (09:56 -0800)]
cargotest: Add xsv to tested crates
This was intended to land in #37149 but I ended up backing it out to land the
rollup (#38697) last night as I was itching to do so. This morning though xsv
has been fixed now (BurntSushi/xsv#53) so we should be able to add it!
Alex Crichton [Fri, 30 Dec 2016 17:26:25 +0000 (09:26 -0800)]
travis: Add a distcheck target
This commit adds a new entry to the Travis matrix which performs a "distcheck",
which basically means that we create a tarball, extract that tarball, and then
build/test inside there. This ensures that the tarballs we produce are actually
able to be built/tested!
Along the way this also updates the rustbuild distcheck definition to propagate
the configure args from the top-level invocation.
Alex Crichton [Fri, 30 Dec 2016 17:29:21 +0000 (09:29 -0800)]
rustbuild: Fix source tarballs and the vendor dir
The source tarball creation step would attempt to skip a number of files that we
want to ignore ourselves, but once we've hit the vendor directory we don't want
to skip anything so be sure to vendor everything inside that directory.
Alex Crichton [Wed, 28 Dec 2016 23:01:21 +0000 (15:01 -0800)]
rustbuild: Compile all support tools in stage0
This commit changes all tools and such to get compiled in stage0, not in
later stages. The purpose of this commit is to cut down dependencies on later
stages for future modifications to the build system. Notably we're going to be
adding builders that produce a full suite of cross-compiled artifacts for a
particular host, and that shouldn't compile the `x86_64-unknown-linux-gnu`
compiler more than once. Currently dependencies on, for example, the error index
end up compiling the `x86_64-unknown-linux-gnu` compiler more than necessary.
As a result here we move many dependencies on these tools to being produced by a
stage0 compiler, not a stage1+ compiler. None of these tools actually need to be
staged at all, so they'll exhibit consistent behavior across the stages.
est31 [Wed, 7 Dec 2016 15:28:45 +0000 (16:28 +0100)]
libcompiler_builtins: don't codegen dead code call to eh_personality
There was a linker error on 32 bit platforms with optimisations turned off,
complaining that there was an undefined reference to "rust_eh_personality",
when compiling the rustc_const_math as stage1 artifact.
Apparently the compiler_builtins crate includes a call to "rust_eh_personality".
If compiled for 64 bits, this call doesn't appear, which explains why the linker
error only happens on 32 bit platforms, and optimisations will get it removed
on 32 bit as well.
There were two origins of the call:
1. A for loop where apparently the compiler wasn't sure
whether next() could panic or not, and therefore generated a landing
pad for the worst case. The minimal reproducible example is "for _ in 0..sr { }".
2. A default impl of uabs where the compiler apparently wasn't sure either
whether iabs() could panic or not. Many thanks to nagisa for
contributing the fix.
This commit also puts extern "C" to the intrinsics, as this is generally a
good thing to do.
est31 [Mon, 5 Dec 2016 23:48:54 +0000 (00:48 +0100)]
Try to fix some things
* shift so that no panics are generated (otherwise results in linker error)
* no_std as insurance to not get into issues with errors like "cannot satisfy dependencies so `rustc_i128` only shows up once" (pure guessing here, but it doesn't hurt...)