]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoaudit LLVM C++ types in ArchiveWrapper and PassWrapper
Ariel Ben-Yehuda [Mon, 1 Aug 2016 21:16:16 +0000 (00:16 +0300)]
audit LLVM C++ types in ArchiveWrapper and PassWrapper

7 years agoremove the ExecutionEngine binding
Ariel Ben-Yehuda [Mon, 1 Aug 2016 18:43:57 +0000 (21:43 +0300)]
remove the ExecutionEngine binding

the code has no tests and will just bitrot by itself.

this is a [breaking-change]

7 years agoAuto merge of #35145 - jseyfried:avoid_extra_resolve_error, r=arielb1
bors [Tue, 2 Aug 2016 13:12:23 +0000 (06:12 -0700)]
Auto merge of #35145 - jseyfried:avoid_extra_resolve_error, r=arielb1

resolve: Avoid emitting an unhelpful cascading resolution error

Fixes #35142.

7 years agoAuto merge of #35084 - tbu-:pr_lowercase_wtf8_debug, r=brson
bors [Tue, 2 Aug 2016 09:30:17 +0000 (02:30 -0700)]
Auto merge of #35084 - tbu-:pr_lowercase_wtf8_debug, r=brson

Escape the unmatched surrogates with lower-case hexadecimal numbers

It's done the same way for the rest of the codepoint escapes.

7 years agoAuto merge of #34096 - eddyb:launch, r=nikomatsakis
bors [Tue, 2 Aug 2016 06:42:48 +0000 (23:42 -0700)]
Auto merge of #34096 - eddyb:launch, r=nikomatsakis

Switch to MIR-based translation by default.

This patch makes `-Z orbit` default to "on", which means that by default, functions will be translated from Rust to LLVM IR through the upcoming MIR backend, instead of the antiquated AST backend.

This switch is made possible by the recently merged #33622, #33905 and smaller fixes.

If you experience any issues, please file a report for each of them. You can switch to the old backend to work around problems by either setting `RUSTFLAGS="-Zorbit=off"` or by annotating specific functions with `#[rustc_no_mir]` (which requires `#![feature(rustc_attrs)]` at the crate-level).

I would like this PR to get into nightly soon so that we can get early feedback in this release cycle and focus on correctness fixes and performance improvements, with the potential for removing the old backend implementation before beta branches off.

cc @rust-lang/compiler

7 years agoIgnore the lang-items example in the book.
Eduard Burtescu [Tue, 2 Aug 2016 06:02:19 +0000 (09:02 +0300)]
Ignore the lang-items example in the book.

7 years agotests: mark the inline asm in run-pass/issue-14936 as volatile.
Eduard Burtescu [Tue, 2 Aug 2016 05:14:58 +0000 (08:14 +0300)]
tests: mark the inline asm in run-pass/issue-14936 as volatile.

7 years agorustc: parse -Z orbit=off.
Eduard Burtescu [Tue, 2 Aug 2016 02:18:23 +0000 (05:18 +0300)]
rustc: parse -Z orbit=off.

7 years agotests: don't use -Zorbit on run-pass/issue-28950, it stack overflows.
Eduard Burtescu [Tue, 2 Aug 2016 00:45:01 +0000 (03:45 +0300)]
tests: don't use -Zorbit on run-pass/issue-28950, it stack overflows.

7 years agorustc_trans: load C-like enums larger than usize from memory with -Zorbit.
Eduard Burtescu [Tue, 2 Aug 2016 00:28:50 +0000 (03:28 +0300)]
rustc_trans: load C-like enums larger than usize from memory with -Zorbit.

7 years agoMake --enable-orbit the default in ./configure.
Eduard Burtescu [Wed, 8 Jun 2016 12:18:51 +0000 (15:18 +0300)]
Make --enable-orbit the default in ./configure.

7 years agoAuto merge of #35054 - pwoolcoc:stringfromchars, r=brson
bors [Tue, 2 Aug 2016 03:05:57 +0000 (20:05 -0700)]
Auto merge of #35054 - pwoolcoc:stringfromchars, r=brson

implement `From<Vec<char>>` and `From<&'a [char]>` for `String`

Though there are ways to convert a slice or vec of chars into a string,
it would be nice to be able to just do `String::from(&['a', 'b', 'c'])`,
so this PR implements `From<Vec<char>>` and `From<&'a [char]>` for
String.

7 years agoTurn -Z orbit on by default.
Eduard Burtescu [Sat, 4 Jun 2016 16:55:20 +0000 (19:55 +0300)]
Turn -Z orbit on by default.

7 years agoAuto merge of #35018 - cgswords:rope_tstream, r=nrc
bors [Tue, 2 Aug 2016 00:17:28 +0000 (17:17 -0700)]
Auto merge of #35018 - cgswords:rope_tstream, r=nrc

Reimplement TokenStreams using ropes

Title says it all; a reimplementation of TokenStreams as ropes.

r? @nrc

7 years agoFix fallout in `ui/codemap_tests`.
Jeffrey Seyfried [Mon, 1 Aug 2016 18:42:16 +0000 (18:42 +0000)]
Fix fallout in `ui/codemap_tests`.

7 years agoReimplemented tokenstreams as ropes and reduced the exposed TokenStream API.
cgswords [Tue, 19 Jul 2016 22:50:34 +0000 (15:50 -0700)]
Reimplemented tokenstreams as ropes and reduced the exposed TokenStream API.

7 years agoAuto merge of #35163 - sanxiyn:rollup, r=sanxiyn
bors [Mon, 1 Aug 2016 15:57:32 +0000 (08:57 -0700)]
Auto merge of #35163 - sanxiyn:rollup, r=sanxiyn

Rollup of 8 pull requests

- Successful merges: #34802, #35033, #35085, #35114, #35134, #35140, #35141, #35157
- Failed merges:

7 years agoRollup merge of #35157 - sanxiyn:remove-workaround, r=eddyb
Seo Sanghyeon [Mon, 1 Aug 2016 15:12:41 +0000 (00:12 +0900)]
Rollup merge of #35157 - sanxiyn:remove-workaround, r=eddyb

Remove CMake workaround

This isn't needed anymore as we aren't using CMake to build compiler-rt since #34873.

7 years agoRollup merge of #35141 - eddyb:assert-mir-debug, r=nagisa
Seo Sanghyeon [Mon, 1 Aug 2016 15:12:40 +0000 (00:12 +0900)]
Rollup merge of #35141 - eddyb:assert-mir-debug, r=nagisa

rustc_trans: apply the debug location for the MIR Assert panic call.

Helps `libcore` build with MIR trans and debuginfo; libcore has the body of `panic`, which resulted in:
```
inlinable function call in a function with debug info must have a !dbg location
  call void @_ZN4core9panicking5panic17h585bd70cda921012E({ %str_slice, %str_slice, i32 }* @panic_loc12745)
LLVM ERROR: Broken function found, compilation aborted!
```

7 years agoRollup merge of #35140 - the-kenny:tcp-stress-test-const-thread-count, r=alexcrichton
Seo Sanghyeon [Mon, 1 Aug 2016 15:12:40 +0000 (00:12 +0900)]
Rollup merge of #35140 - the-kenny:tcp-stress-test-const-thread-count, r=alexcrichton

tcp-stress-test: Pull out thread count as a constant

This PR factors out the number of concurrent threads used in `tcp-stress-test.rs` to a constant at the top of the file.

We at @NixOS had to lower our thread count as the chrooted-builds don't allow that many threads.

This change will make it easier to lower/increase the count in the future (I actually forgot to change the second `1000` when I was working on this). Another benefit is the removal of magic numbers in the test suite.

This is related to https://github.com/rust-lang/rust/issues/35107

7 years agoRollup merge of #35134 - frewsxcv:slice-chunks, r=GuillaumeGomez
Seo Sanghyeon [Mon, 1 Aug 2016 15:12:40 +0000 (00:12 +0900)]
Rollup merge of #35134 - frewsxcv:slice-chunks, r=GuillaumeGomez

Rewrite `slice::chunks` doc example to not require printing.

None

7 years agoRollup merge of #35114 - michaelwoerister:inline-meta-to-hir-map, r=eddyb
Seo Sanghyeon [Mon, 1 Aug 2016 15:12:39 +0000 (00:12 +0900)]
Rollup merge of #35114 - michaelwoerister:inline-meta-to-hir-map, r=eddyb

Move caching of inlined HIR into CrateStore

So far we've had separate HIR-inlining caches for each codegen unit and the caching for things inlined during constant evaluation had some holes. Consequently, things would be inlined multiple times if they were used from different codegen units, etc, leading to
- wasted memory,
- multiple `NodeId`s per `DefId` and,
- for things inlined during constant evaluation, no way to map a `NodeId` back to it's original `DefId`.

This PR moves all caching into the CrateStore, solving all of the above problems. It also fixes some bugs in the inlining code, like cyclic in the parent-chains in the HIR map and some `NodeId`'s being translated to more or less random values. There are assertions in place now that should prevent this kind of thing in the future.

This PR based on top of #35090, which contains some necessary fixes.

7 years agoRollup merge of #35085 - dns2utf8:git_clone_depth, r=alexcrichton
Seo Sanghyeon [Mon, 1 Aug 2016 15:12:39 +0000 (00:12 +0900)]
Rollup merge of #35085 - dns2utf8:git_clone_depth, r=alexcrichton

Reduce git clone --depth from 50 (default) to 1

This should speedup the builds a little.

7 years agoRollup merge of #35033 - jakllsch:remaining_cpu_x86-64, r=alexcrichton
Seo Sanghyeon [Mon, 1 Aug 2016 15:12:39 +0000 (00:12 +0900)]
Rollup merge of #35033 - jakllsch:remaining_cpu_x86-64, r=alexcrichton

Use "x86-64" as the target CPU for NetBSD and Bitrig on amd64.

Using "generic" disables a number of features that are present on all
x86_64 cpus, the "x86-64" target cpu is the common denominator for that
arch.

Refs #20777

7 years agoRollup merge of #34802 - petrochenkov:call, r=eddyb
Seo Sanghyeon [Mon, 1 Aug 2016 15:12:39 +0000 (00:12 +0900)]
Rollup merge of #34802 - petrochenkov:call, r=eddyb

Methods `Fn(Mut,Once)::call(mut,once)` are gated with two feature gates, remove one of them

Methods `Fn::call`, `FnMut::call_mut` and `FnOnce::call_once` are gated with usual library feature `fn_traits` and also hardcoded in the compiler and gated once more with feature `unboxed_closures`
This patch removes the `unboxed_closures`feature gate from these methods (`unboxed_closures` is still used for other things though), now they are gated only with `fn_traits`.

All unnecessary `#![feature(unboxed_closures)]`s are removed, many of them are old and were already unnecessary before the change this PR does.

7 years agoAuto merge of #34743 - badboy:llvm-upgrade, r=eddyb
bors [Mon, 1 Aug 2016 11:47:48 +0000 (04:47 -0700)]
Auto merge of #34743 - badboy:llvm-upgrade, r=eddyb

LLVM upgrade

As discussed in https://internals.rust-lang.org/t/need-help-with-emscripten-port/3154/46 I'm trying to update the used LLVM checkout in Rust.

I basically took @shepmaster's code and applied it on top (though I did the commits manually, the [original commits have better descriptions](https://github.com/rust-lang/rust/compare/master...avr-rust:avr-support).

With these changes I was able to build rustc. `make check` throws one last error on `run-pass/issue-28950.rs`. Output: https://gist.github.com/badboy/bcdd3bbde260860b6159aa49070a9052

I took the metadata changes as is and they seem to work, though it now uses the module in another step. I'm not sure if this is the best and correct way.

Things to do:

* [x] ~~Make `run-pass/issue-28950.rs` pass~~ unrelated
* [x] Find out how the `PositionIndependentExecutable` setting is now used
* [x] Is the `llvm::legacy` still the right way to do these things?

cc @brson @alexcrichton

7 years agoRemove CMake workaround
Seo Sanghyeon [Mon, 1 Aug 2016 09:03:22 +0000 (18:03 +0900)]
Remove CMake workaround

7 years agoAuto merge of #34830 - michaelwoerister:internal-closures, r=nikomatsakis
bors [Mon, 1 Aug 2016 08:53:18 +0000 (01:53 -0700)]
Auto merge of #34830 - michaelwoerister:internal-closures, r=nikomatsakis

trans: Avoid weak linkage for closures when linking with MinGW.

This PR proposes one possible solution to #34793, the problem that prevents https://github.com/servo/servo/pull/12393 from landing. It applies the same strategy, that we already use for monomorphizations, to closures, that is, instead of emitting symbols with `weak_odr` linkage in order to avoid symbol conflicts, we emit them with `internal` linkage, with the side effect that we have to copy code instead of just linking to it, if more than one codegen unit is involved.
With this PR, the compiler will only apply this strategy for targets where we would actually run into a problem when using `weak_odr` linkage, in other words nothing will change for platforms except for MinGW.

The solution implemented here has one restriction that could be lifted with some more effort, but it does not seem to be worth the trouble since it will go away once we use only MIR-trans: If someone compiles code

1. on MinGW,
2. with more than one codegen unit,
3. *not* using MIR-trans,
4. and runs into a closure inlined from another crate

then the compiler will abort and suggest to compile either with just one codegen unit or `-Zorbit`.

What's nice about this is that I lays a foundation for also doing the same for generics: using weak linkage where possible and thus enabling some more space optimizations that the linker can do.

~~This PR also contains a test case for compiling a program that contains more than 2^15 closures. It's a huge, generated file with almost 100K LOCs. I did not commit the script for generating the file but could do so. Alternatively, maybe someone wants to come up with a way of doing this with macros.~~
The test file is implemented via macros now (thanks @alexcrichton!)

Opinions?

Fixes #34793.

cc @rust-lang/compiler

7 years agoAdd test case for large number of closures within one codegen unit
Michael Woerister [Tue, 12 Jul 2016 21:39:08 +0000 (17:39 -0400)]
Add test case for large number of closures within one codegen unit

7 years agotrans: Avoid weak linkage for closures when linking with MinGW.
Michael Woerister [Wed, 13 Jul 2016 21:03:02 +0000 (17:03 -0400)]
trans: Avoid weak linkage for closures when linking with MinGW.

7 years agoUpgrade LLVM once more to get a bugfix
Jan-Erik Rediger [Mon, 1 Aug 2016 08:14:30 +0000 (10:14 +0200)]
Upgrade LLVM once more to get a bugfix

@tmiasko did some digging and discovered that
https://reviews.llvm.org/D22858 may be relevant.

7 years agoMove caching of HIR-inlining into CStore in order to avoid duplicating inlined HIR.
Michael Woerister [Tue, 26 Jul 2016 14:58:35 +0000 (10:58 -0400)]
Move caching of HIR-inlining into CStore in order to avoid duplicating inlined HIR.

7 years agotcp-stress-test.rs: Only spawn 200 threads.
Moritz Ulrich [Mon, 1 Aug 2016 07:43:19 +0000 (09:43 +0200)]
tcp-stress-test.rs: Only spawn 200 threads.

7 years agoAuto merge of #35130 - sanxiyn:unused-type-parameter-error, r=nrc
bors [Mon, 1 Aug 2016 06:01:06 +0000 (23:01 -0700)]
Auto merge of #35130 - sanxiyn:unused-type-parameter-error, r=nrc

Suppress unused type parameter error when type has error field

Fix #35075.

7 years agoAuto merge of #35151 - bcully:bcully/pr-35149, r=alexcrichton
bors [Mon, 1 Aug 2016 02:17:22 +0000 (19:17 -0700)]
Auto merge of #35151 - bcully:bcully/pr-35149, r=alexcrichton

Add libarena from local rust to stage0

This was needed at least when local rust was 1.9.0 on darwin.

Fixes #35149

7 years agoAdd libarena from local rust to stage0
Brendan Cully [Sun, 31 Jul 2016 23:15:29 +0000 (16:15 -0700)]
Add libarena from local rust to stage0

This was needed at least when local rust was 1.9.0 on darwin.

Fixes #35149

7 years agoAuto merge of #35143 - arielb1:rfc447-regions, r=eddyb
bors [Sun, 31 Jul 2016 21:41:58 +0000 (14:41 -0700)]
Auto merge of #35143 - arielb1:rfc447-regions, r=eddyb

typeck: use a TypeVisitor in ctp

Use a TypeVisitor in ctp instead of `ty::walk`

This fixes a few cases where a region could be projected out of a trait while not being constrained by the type parameters, violating rust-lang/rfcs#447 and breaking soundness. As such, this is a [breaking-change].

Fixes #35139

r? @eddyb

7 years agoMake "type aliases cannot be used for traits" a note instead of a span_label.
Jeffrey Seyfried [Sun, 31 Jul 2016 21:29:01 +0000 (21:29 +0000)]
Make "type aliases cannot be used for traits" a note instead of a span_label.

7 years agoClean up `resolve_trait_reference`.
Jeffrey Seyfried [Sun, 31 Jul 2016 20:40:03 +0000 (20:40 +0000)]
Clean up `resolve_trait_reference`.

7 years agoAvoid emitting a unhelpful cascading resolution error.
Jeffrey Seyfried [Sun, 31 Jul 2016 20:11:38 +0000 (20:11 +0000)]
Avoid emitting a unhelpful cascading resolution error.

7 years agotypeck: use a TypeVisitor in ctp
Ariel Ben-Yehuda [Sun, 31 Jul 2016 20:01:02 +0000 (23:01 +0300)]
typeck: use a TypeVisitor in ctp

Fixes #35139

7 years agorustc_trans: apply the debug location for the MIR Assert panic call.
Eduard Burtescu [Sun, 31 Jul 2016 19:17:29 +0000 (22:17 +0300)]
rustc_trans: apply the debug location for the MIR Assert panic call.

7 years agoAuto merge of #34986 - nikomatsakis:issue-34349, r=arielb1
bors [Sun, 31 Jul 2016 18:45:19 +0000 (11:45 -0700)]
Auto merge of #34986 - nikomatsakis:issue-34349, r=arielb1

Avoid writing a temporary closure kind

We used to write a temporary closure kind into the inference table, but
this could lead to obligations being incorrectled resolved before
inference had completed. This result could then be cached, leading to
further trouble. This patch avoids writing any closure kind until the
computation is complete.

Fixes #34349.

r? @arielb1 -- what do you think?

7 years agotcp-stress-test: Factor out thread count as constant.
Moritz Ulrich [Sat, 30 Jul 2016 07:01:13 +0000 (09:01 +0200)]
tcp-stress-test: Factor out thread count as constant.

7 years agoAuto merge of #34251 - zackmdavis:forbidden_on_whose_authority, r=Manishearth
bors [Sun, 31 Jul 2016 15:50:46 +0000 (08:50 -0700)]
Auto merge of #34251 - zackmdavis:forbidden_on_whose_authority, r=Manishearth

diagnostically note source of overruling outer forbid

When we emit E0453 (lint level attribute overruled by outer `forbid`
lint level), it could be helpful to note where the `forbid` level was
set, for the convenience of users who, e.g., believe that the correct
fix is to weaken the `forbid` to `deny`.

![forbidden_on_whose_authority](https://cloud.githubusercontent.com/assets/1076988/15995312/2d847376-30ce-11e6-865e-b68cfebc0291.png)

7 years agoDon't gate methods `Fn(Mut,Once)::call(mut,once)` with feature `unboxed_closures`
Vadim Petrochenkov [Wed, 13 Jul 2016 14:07:11 +0000 (17:07 +0300)]
Don't gate methods `Fn(Mut,Once)::call(mut,once)` with feature `unboxed_closures`

They are already gated with feature `fn_traits`

7 years agoAuto merge of #35129 - tmiasko:suggest-print-target-list, r=nagisa
bors [Sun, 31 Jul 2016 12:54:19 +0000 (05:54 -0700)]
Auto merge of #35129 - tmiasko:suggest-print-target-list, r=nagisa

Suggest use of `--print target-list` when target is not found.

If given target could not be found suggest using `--print target-list`.
Previously, error has been reported as:

$ rustc --target 86-unknown-linux-gnu
error: Error loading target specification: Could not find specification for target "86-unknown-linux-gnu"

After changes it looks as follows:

$ rustc --target 86-unknown-linux-gnu
error: Error loading target specification: Could not find specification for target "x86-unknown-linux-gnu". Use `--print target-list` for a list of supported targets

7 years agoSuggest use of `--print target-list` when target is not found.
Tomasz MiÄ…sko [Sat, 30 Jul 2016 11:06:49 +0000 (13:06 +0200)]
Suggest use of `--print target-list` when target is not found.

If given target could not be found suggest using `--print target-list`.
Previously, error has been reported as:

$ rustc --target x86-unknown-linux-gnu
error: Error loading target specification: Could not find specification for target "x86-unknown-linux-gnu"

After changes it looks as follows:

rustc --target x86-unknown-linux-gnu
error: Error loading target specification: Could not find specification for target "x86-unknown-linux-gnu"
help: Use `--print target-list` for a list of built-in targets

7 years agoAuto merge of #35060 - japaric:arm-musl, r=alexcrichton
bors [Sun, 31 Jul 2016 06:21:46 +0000 (23:21 -0700)]
Auto merge of #35060 - japaric:arm-musl, r=alexcrichton

Add ARM MUSL targets

Rebase of #33189.

I tested this by producing a std for `arm-unknown-linux-musleabi` then I cross compiled Hello world to said target. Checked that the produced binary was statically linked and verified that the binary worked under QEMU.

This depends on rust-lang/libc#341. I'll have to update this PR after that libc PR is merged.

I'm also working on generating ARM musl cross toolchain via crosstool-ng. Once I verified those work, I'll send a PR to rust-buildbot.

r? @alexcrichton
cc @timonvo

7 years agoRewrite `slice::chunks` doc example to not require printing.
Corey Farwell [Sun, 31 Jul 2016 03:21:48 +0000 (23:21 -0400)]
Rewrite `slice::chunks` doc example to not require printing.

7 years agoAuto merge of #35004 - asomers:master, r=alexcrichton
bors [Sun, 31 Jul 2016 01:52:20 +0000 (18:52 -0700)]
Auto merge of #35004 - asomers:master, r=alexcrichton

Fix build of compiler-rt on FreeBSD

Broken since ee6011fc71e02485f2dffcc25be64631c2008775 removed cmake from the
process.  There are likely other platforms still broken, but I didn't test on them.

7 years agoAuto merge of #34904 - petrochenkov:rustcall, r=nikomatsakis
bors [Sat, 30 Jul 2016 22:58:20 +0000 (15:58 -0700)]
Auto merge of #34904 - petrochenkov:rustcall, r=nikomatsakis

Properly feature gate all unstable ABIs

Fixes https://github.com/rust-lang/rust/issues/34900
[breaking-change]
r? @pnkfelix

---
Function-visiting machinery for AST/HIR is surprisingly error-prone, it's *very* easy to miss some cases or visit something twice while writing a visitor. This is the true problem behind https://github.com/rust-lang/rust/issues/34900. I'll try to restructure these visitors a bit and send one more PR later.

7 years agodiagnostically note source of overruling outer forbid
Zack M. Davis [Mon, 13 Jun 2016 00:46:43 +0000 (17:46 -0700)]
diagnostically note source of overruling outer forbid

When we emit E0453 (lint level attribute overruled by outer `forbid`
lint level), it could be helpful to note where the `forbid` level was
set, for the convenience of users who, e.g., believe that the correct
fix is to weaken the `forbid` to `deny`.

7 years agoreturn TargetResult
Jorge Aparicio [Sat, 30 Jul 2016 20:44:59 +0000 (15:44 -0500)]
return TargetResult

7 years agopoint the libc submodule back to rust-lang/libc
Jorge Aparicio [Wed, 27 Jul 2016 16:39:58 +0000 (11:39 -0500)]
point the libc submodule back to rust-lang/libc

7 years agoremove some `any`s that are no longer necessary
Jorge Aparicio [Wed, 27 Jul 2016 16:37:15 +0000 (11:37 -0500)]
remove some `any`s that are no longer necessary

7 years agorustc_back/target: remove musl_base
Jorge Aparicio [Wed, 27 Jul 2016 02:30:02 +0000 (21:30 -0500)]
rustc_back/target: remove musl_base

it's the same as linux_musl_base

7 years agoarm-musl: statically link to libunwind
Jorge Aparicio [Wed, 27 Jul 2016 01:09:50 +0000 (20:09 -0500)]
arm-musl: statically link to libunwind

7 years agoarm-musl: set max_atomic_width
Jorge Aparicio [Wed, 27 Jul 2016 00:27:43 +0000 (19:27 -0500)]
arm-musl: set max_atomic_width

7 years agoarm-musl targets now use cfg(env = "musl")
Jorge Aparicio [Tue, 26 Jul 2016 21:17:14 +0000 (16:17 -0500)]
arm-musl targets now use cfg(env = "musl")

7 years agoAdd ARM MUSL targets.
Timon Van Overveldt [Thu, 28 Apr 2016 01:02:31 +0000 (18:02 -0700)]
Add ARM MUSL targets.

The targets are:
- `arm-unknown-linux-musleabi`
- `arm-unknown-linux-musleabihf`
- `armv7-unknown-linux-musleabihf`

These mirror the existing `gnueabi` targets.

All of these targets produce fully static binaries, similar to the
x86 MUSL targets.

For now these targets can only be used with `--rustbuild` builds, as
https://github.com/rust-lang/compiler-rt/pull/22 only made the
necessary compiler-rt changes in the CMake configs, not the plain
GNU Make configs.

I've tested these targets GCC 5.3.0 compiled again musl-1.1.12
(downloaded from http://musl.codu.org/). An example `./configure`
invocation is:

```
./configure \
    --enable-rustbuild
    --target=arm-unknown-linux-musleabi \
    --musl-root="$MUSL_ROOT"
```

where `MUSL_ROOT` points to the `arm-linux-musleabi` prefix.
Usually that path will be of the form
`/foobar/arm-linux-musleabi/arm-linux-musleabi`.

Usually the cross-compile toolchain will live under
`/foobar/arm-linux-musleabi/bin`. That path should either by added
to your `PATH` variable, or you should add a section to your
`config.toml` as follows:

```
[target.arm-unknown-linux-musleabi]
cc = "/foobar/arm-linux-musleabi/bin/arm-linux-musleabi-gcc"
cxx = "/foobar/arm-linux-musleabi/bin/arm-linux-musleabi-g++"
```

As a prerequisite you'll also have to put a cross-compiled static
`libunwind.a` library in `$MUSL_ROOT/lib`. This is similar to [how
the x86_64 MUSL targets are built]
(https://doc.rust-lang.org/book/advanced-linking.html).

7 years agoUpdate gcc crate dependency to 0.3.27.
Timon Van Overveldt [Thu, 28 Apr 2016 01:02:31 +0000 (18:02 -0700)]
Update gcc crate dependency to 0.3.27.

This is to pull in changes to support ARM MUSL targets.

This change also commits a couple of other cargo-generated changes
to other dependencies in the various Cargo.toml files.

7 years agoAuto merge of #35069 - wesleywiser:too_many_symbols, r=alexcrichton
bors [Sat, 30 Jul 2016 20:04:30 +0000 (13:04 -0700)]
Auto merge of #35069 - wesleywiser:too_many_symbols, r=alexcrichton

Only export #[no_mangle] extern symbols during LTO

Fixes #34985

7 years agoAuto merge of #35117 - aravind-pg:path, r=alexcrichton
bors [Sat, 30 Jul 2016 17:11:33 +0000 (10:11 -0700)]
Auto merge of #35117 - aravind-pg:path, r=alexcrichton

On Windows, ensure PATH does not contain invalid character `"`

Fixes #34959.

r? @alexcrichton

7 years agoSuppress unused type parameter error when type has error field
Seo Sanghyeon [Sat, 30 Jul 2016 15:58:30 +0000 (00:58 +0900)]
Suppress unused type parameter error when type has error field

7 years agoAuto merge of #35127 - Manishearth:rollup, r=Manishearth
bors [Sat, 30 Jul 2016 11:35:39 +0000 (04:35 -0700)]
Auto merge of #35127 - Manishearth:rollup, r=Manishearth

Rollup of 8 pull requests

- Successful merges: #35049, #35058, #35063, #35080, #35090, #35094, #35104, #35106
- Failed merges:

7 years agoRollup merge of #35106 - xen0n:issue-35082, r=alexcrichton
Manish Goregaokar [Sat, 30 Jul 2016 08:14:47 +0000 (13:44 +0530)]
Rollup merge of #35106 - xen0n:issue-35082, r=alexcrichton

syntax_ext: format: fix ICE with bad named arguments

Fixes #35082 by guarding against a new case of malformed invocation not previously covered.

r? @alexcrichton

7 years agoRollup merge of #35104 - frewsxcv:linked-list-append, r=steveklabnik
Manish Goregaokar [Sat, 30 Jul 2016 08:14:47 +0000 (13:44 +0530)]
Rollup merge of #35104 - frewsxcv:linked-list-append, r=steveklabnik

Rewrite `collections::LinkedList::append` doc example.

None

7 years agoRollup merge of #35094 - mcarton:multispan, r=jonathandturner
Manish Goregaokar [Sat, 30 Jul 2016 08:14:47 +0000 (13:44 +0530)]
Rollup merge of #35094 - mcarton:multispan, r=jonathandturner

Revert "Remove unused methods from MultiSpan"

This reverts commit f7019a4e2f80577d38ec35fcebd64d5970b15f78.

That commit removed the only way to make a suggestion with more than one substitute. That feature is not used directly by rustc but exists and is used by Clippy. Bring it back until we come up with a better solution (suggestions don't use span labels, so it would make sense for them to use their own type).
Rational there: https://github.com/Manishearth/rust-clippy/pull/1119.

r? @jonathandturner
Cc @Manishearth

7 years agoRollup merge of #35090 - michaelwoerister:get-rid-of-id-visitor, r=eddyb
Manish Goregaokar [Sat, 30 Jul 2016 08:14:47 +0000 (13:44 +0530)]
Rollup merge of #35090 - michaelwoerister:get-rid-of-id-visitor, r=eddyb

intravisit: Fold functionality of IdVisitor into the regular Visitor.

7 years agoRollup merge of #35080 - jonathandturner:fix_numeric_expected_found, r=nikomatsakis
Manish Goregaokar [Sat, 30 Jul 2016 08:14:46 +0000 (13:44 +0530)]
Rollup merge of #35080 - jonathandturner:fix_numeric_expected_found, r=nikomatsakis

Rename _ to {integer} and {float} for unknown numeric types

This PR renames _ to {integer} or {float} for unknown numeric types, to help people parse error messages that have numeric types that haven't been nailed down.

Example:
```rust
fn main() {
    let x: String = 4;
}
```

Before:
```
error[E0308]: mismatched types
 --> quicktest.rs:2:21
  |
2 |     let x: String = 4;
  |                     ^ expected struct `std::string::String`, found integral variable
  |
  = note: expected type `std::string::String`
  = note:    found type `_`

error: aborting due to previous error
```

after:
```
error[E0308]: mismatched types
 --> quicktest.rs:2:21
  |
2 |     let x: String = 4;
  |                     ^ expected struct `std::string::String`, found integral variable
  |
  = note: expected type `std::string::String`
  = note:    found type `{integer}`

error: aborting due to previous error
```
```

7 years agoRollup merge of #35063 - jseyfried:avoid_importing_inaccessible_names, r=nrc
Manish Goregaokar [Sat, 30 Jul 2016 08:14:46 +0000 (13:44 +0530)]
Rollup merge of #35063 - jseyfried:avoid_importing_inaccessible_names, r=nrc

resolve: Exclude inaccessible names from single imports

If a single import resolves to an inaccessible name in some but not all namespaces, avoid importing the name in the inaccessible namespaces.

Currently, the inaccessible namespaces are imported but cause a privacy error when used.

r? @nrc

7 years agoRollup merge of #35058 - jethrogb:no_panic_abs, r=alexcrichton
Manish Goregaokar [Sat, 30 Jul 2016 08:14:46 +0000 (13:44 +0530)]
Rollup merge of #35058 - jethrogb:no_panic_abs, r=alexcrichton

Add non-panicking abs() functions to all signed integer types.

Currently, calling abs() on one of the signed integer types might panic (in
debug mode at least) because the absolute value of the largest negative value
can not be represented in that signed type. Unlike all other integer
operations, there is currently not a non-panicking version on this function.
This seems to just be an oversight in the design, therefore just adding it now.

7 years agoRollup merge of #35049 - knight42:add-test, r=alexcrichton
Manish Goregaokar [Sat, 30 Jul 2016 08:14:46 +0000 (13:44 +0530)]
Rollup merge of #35049 - knight42:add-test, r=alexcrichton

Add a test for AddAssign on String

Fix #35047

7 years agoAuto merge of #35051 - japaric:backtrace, r=alexcrichton
bors [Sat, 30 Jul 2016 07:08:24 +0000 (00:08 -0700)]
Auto merge of #35051 - japaric:backtrace, r=alexcrichton

rustbuild: make backtraces (RUST_BACKTRACE) optional

but keep them enabled by default to maintain the status quo.

When disabled shaves ~56KB off every x86_64-unknown-linux-gnu
binary.

To disable backtraces you have to use a config.toml (see
src/bootstrap/config.toml.example for details) when building rustc/std:

$ python bootstrap.py --config=config.toml

---

r? @alexcrichton
cc rust-lang/rfcs#1417

7 years agoAuto merge of #35032 - vadimcn:rusty-ehabi, r=alexcrichton
bors [Sat, 30 Jul 2016 03:29:43 +0000 (20:29 -0700)]
Auto merge of #35032 - vadimcn:rusty-ehabi, r=alexcrichton

Implement ARM personality routine in Rust.

Remove the `eh_personality_catch` lang item.
Use a simplified version of `cfg_if!` in libunwind.

Closes #34786

7 years agoAuto merge of #34842 - cgswords:attr_enc, r=nrc
bors [Fri, 29 Jul 2016 23:26:38 +0000 (16:26 -0700)]
Auto merge of #34842 - cgswords:attr_enc, r=nrc

Better attribute and metaitem encapsulation throughout the compiler

This PR refactors most (hopefully all?) of the `MetaItem` interactions outside of `libsyntax` (and a few inside) to interact with MetaItems through the provided traits instead of directly creating / destruct / matching against them. This is a necessary first step to eventually converting `MetaItem`s to internally use `TokenStream` representations (which will make `MetaItem` interactions much nicer for macro writers once the new macro system is in place).

r? @nrc

7 years agoAuto merge of #35100 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Fri, 29 Jul 2016 10:28:01 +0000 (03:28 -0700)]
Auto merge of #35100 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 7 pull requests

- Successful merges: #34258, #34894, #35050, #35062, #35066, #35072, #35087
- Failed merges:

7 years agoRollup merge of #35103 - brettcannon:patch-1, r=Manishearth
Guillaume Gomez [Fri, 29 Jul 2016 09:57:54 +0000 (11:57 +0200)]
Rollup merge of #35103 - brettcannon:patch-1, r=Manishearth

Try to clear up some awkward wording

7 years agoRollup merge of #35087 - GuillaumeGomez:fs_docs, r=steveklabnik
Guillaume Gomez [Fri, 29 Jul 2016 09:57:54 +0000 (11:57 +0200)]
Rollup merge of #35087 - GuillaumeGomez:fs_docs, r=steveklabnik

Fs docs

Fixes #29356.

r? @steveklabnik

7 years agoRollup merge of #35072 - munyari:assert_debug, r=steveklabnik
Guillaume Gomez [Fri, 29 Jul 2016 09:57:54 +0000 (11:57 +0200)]
Rollup merge of #35072 - munyari:assert_debug, r=steveklabnik

Update docs for assert! and debug_assert!

Refer to #34455

7 years agoRollup merge of #35066 - vadimcn:fix-typos, r=apasel422
Guillaume Gomez [Fri, 29 Jul 2016 09:57:54 +0000 (11:57 +0200)]
Rollup merge of #35066 - vadimcn:fix-typos, r=apasel422

Fix typos

r? @steveklabnik

7 years agoRollup merge of #35062 - frewsxcv:chars-as-str, r=GuillaumeGomez
Guillaume Gomez [Fri, 29 Jul 2016 09:57:53 +0000 (11:57 +0200)]
Rollup merge of #35062 - frewsxcv:chars-as-str, r=GuillaumeGomez

Add documentation example for `str::Chars::as_str`.

None

7 years agoRollup merge of #35050 - knight42:improve-fmt-doc, r=steveklabnik
Guillaume Gomez [Fri, 29 Jul 2016 09:57:53 +0000 (11:57 +0200)]
Rollup merge of #35050 - knight42:improve-fmt-doc, r=steveklabnik

More intuitive explantion of strings formatting

7 years agoRollup merge of #34258 - durka:patch-25, r=steveklabnik
Guillaume Gomez [Fri, 29 Jul 2016 09:57:53 +0000 (11:57 +0200)]
Rollup merge of #34258 - durka:patch-25, r=steveklabnik

book/ffi: nullable pointer cleanup

Expand the "nullable pointer optimization" section with a code example. Fixes #34250.

I also noticed that many of the examples use the libc crate just for types such as `c_char` and `c_int`, which are now available through `std::os::raw`. I changed the ones that don't need to rely on libc. I'm glad to revert that part of the commit if it's unwanted churn.

7 years agointravisit: Fold functionality of IdVisitor into the regular Visitor.
Michael Woerister [Thu, 28 Jul 2016 09:58:45 +0000 (05:58 -0400)]
intravisit: Fold functionality of IdVisitor into the regular Visitor.

7 years agosyntax_ext: format: fix ICE with bad named arguments
Wang Xuerui [Fri, 29 Jul 2016 08:40:10 +0000 (16:40 +0800)]
syntax_ext: format: fix ICE with bad named arguments

7 years agoUpdate LLVM again
Jan-Erik Rediger [Fri, 29 Jul 2016 08:26:56 +0000 (10:26 +0200)]
Update LLVM again

7 years agotest: Fix a test on MSVC
Alex Crichton [Tue, 26 Jul 2016 22:09:39 +0000 (15:09 -0700)]
test: Fix a test on MSVC

Apparently MSVC now has namespaces in backtraces!

7 years ago[LLVM-3.9] Use llvm-3.9 branch
Jan-Erik Rediger [Tue, 26 Jul 2016 22:18:19 +0000 (00:18 +0200)]
[LLVM-3.9] Use llvm-3.9 branch

7 years agoRemove NO_FILE_METADATA; always use unknown_file_metadata instead of passing 0
Vladimir Vukicevic [Thu, 7 Jul 2016 12:15:10 +0000 (08:15 -0400)]
Remove NO_FILE_METADATA; always use unknown_file_metadata instead of passing 0

7 years agollvm: Remove no longer existent LLVMAddTargetData binding
Alex Crichton [Tue, 26 Jul 2016 01:36:03 +0000 (18:36 -0700)]
llvm: Remove no longer existent LLVMAddTargetData binding

7 years agoUpdate parsing llvm-config output
Alex Crichton [Mon, 25 Jul 2016 22:37:12 +0000 (15:37 -0700)]
Update parsing llvm-config output

Now it prints full paths on MSVC, but we're only interested in path names

7 years agorustc: Update LLVM to the LLVM 3.9 release branch
Alex Crichton [Mon, 25 Jul 2016 17:23:34 +0000 (10:23 -0700)]
rustc: Update LLVM to the LLVM 3.9 release branch

The 3.9 release of LLVM isn't out yet, but this moves us onto that branch to
start tracking it.

7 years agotest: Remove the execution-engine test
Alex Crichton [Mon, 25 Jul 2016 20:32:59 +0000 (13:32 -0700)]
test: Remove the execution-engine test

We don't actually officially support this at all, and the execution engine
support in LLVM we've had to gut as it's not compiling on MinGW, so just delete
this test for now.

7 years agorustc: Fix data-layout for AArch64 targets
Alex Crichton [Mon, 25 Jul 2016 17:21:31 +0000 (10:21 -0700)]
rustc: Fix data-layout for AArch64 targets

Also relax the assertion whenever we have a custom LLVM root as LLVM may
disagree about exact specifics.

7 years agoconfigure: Fix grep invocation for llvm-mc argument
Alex Crichton [Mon, 25 Jul 2016 17:20:05 +0000 (10:20 -0700)]
configure: Fix grep invocation for llvm-mc argument

7 years agoForce check of error
Jan-Erik Rediger [Sun, 24 Jul 2016 20:34:37 +0000 (22:34 +0200)]
Force check of error

The passed error needs to be checked.
Otherwise it will force an abort when it is deconstructed, but a
success value.

7 years agoUse C type when passing value to LLVM pass
Jan-Erik Rediger [Sun, 24 Jul 2016 20:31:16 +0000 (22:31 +0200)]
Use C type when passing value to LLVM pass

Previously the C type LLVMRelocMode (available as RelocMode in Rust)
was passed as is to the function.
However createTargetMachine expects a Reloc::Model, which is an enum
just one value short.
Additionally, the function was marked as requiring Reloc::Model in the
C code, but RelocMode on the Rust-side.

We now use the correct C type LLVMRelocMode and convert it to an
Optional<Reloc::Model> as expected by the createTargetMachine call the
same the original LLVMCreateTargetMachine function does.
See
https://github.com/llvm-mirror/llvm/blob/c9b262bfbd5b9fb6f10749dba1465569f39bd625/lib/Target/TargetMachineC.cpp#L104-L121

This was found by @eddyb.

7 years agoUse correct error handling type
Jan-Erik Rediger [Thu, 21 Jul 2016 09:24:51 +0000 (11:24 +0200)]
Use correct error handling type