Commit Graph

55370 Commits

Author SHA1 Message Date
Moritz Ulrich
3ea293ddf2 tcp-stress-test.rs: Only spawn 200 threads. 2016-08-01 09:43:19 +02:00
bors
d648a16cd5 Auto merge of #35130 - sanxiyn:unused-type-parameter-error, r=nrc
Suppress unused type parameter error when type has error field

Fix #35075.
2016-07-31 23:01:06 -07:00
Ryan Scheel (Havvy)
157f7c1b30 Add Derive not possible question to Copy
This adds a question and answer to the Q&A section of the Copy
docs. Specifically, it asks the question I asked while reading
the docs, and gives its answer.
2016-08-01 05:43:13 +00:00
bors
535cea0eec 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
2016-07-31 19:17:22 -07:00
Brendan Cully
e9d2c9654a Add libarena from local rust to stage0
This was needed at least when local rust was 1.9.0 on darwin.

Fixes #35149
2016-07-31 16:29:15 -07:00
Zack M. Davis
e960021d30 extended info for E0528, expected at least this-and-such many elements 2016-07-31 15:09:25 -07:00
Zack M. Davis
7093d1de84 add extended info for E0527, slice pattern element count expectations 2016-07-31 15:09:25 -07:00
Zack M. Davis
65e3ff4df4 add extended information for E0529, slice pattern expects array or slice 2016-07-31 15:09:25 -07:00
bors
7333c4ac25 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
2016-07-31 14:41:58 -07:00
Jeffrey Seyfried
d6b10beb88 Make "type aliases cannot be used for traits" a note instead of a span_label. 2016-07-31 21:29:01 +00:00
Jeffrey Seyfried
93fd214d61 Clean up resolve_trait_reference. 2016-07-31 20:40:03 +00:00
Jeffrey Seyfried
46bd5d3fa0 Avoid emitting a unhelpful cascading resolution error. 2016-07-31 20:17:08 +00:00
Ariel Ben-Yehuda
0a128f325e typeck: use a TypeVisitor in ctp
Fixes #35139
2016-07-31 23:01:02 +03:00
Eduard Burtescu
d1f341dd91 rustc_trans: apply the debug location for the MIR Assert panic call. 2016-07-31 22:17:29 +03:00
bors
2b87f031e7 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?
2016-07-31 11:45:19 -07:00
Moritz Ulrich
aaf8a6e108 tcp-stress-test: Factor out thread count as constant. 2016-07-31 20:28:39 +02:00
bors
379ac50809 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)
2016-07-31 08:50:46 -07:00
Vadim Petrochenkov
a80d329b68 Don't gate methods Fn(Mut,Once)::call(mut,once) with feature unboxed_closures
They are already gated with feature `fn_traits`
2016-07-31 17:48:20 +03:00
bors
5556554e25 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
2016-07-31 05:54:19 -07:00
Jonathan Giddy
b77b9b72fe Provide more explicit example of wildcard version in guessing game doc.
Beginners may try to adapt the tutorial to develop their own code.
When using different dependencies, they may use the wildcard for
versioning.  Since they are new to the language, they will not know
that the wildcard asterisk is a string, not a token.  Make the correct
format more explicit, to remove one potential source of frustration.
2016-07-31 12:44:41 +01:00
Tomasz Miąsko
443f1ca83c 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
2016-07-31 12:20:06 +02:00
bors
724f811794 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
2016-07-30 23:21:46 -07:00
Corey Farwell
2eea1f3097 Rewrite slice::chunks doc example to not require printing. 2016-07-30 23:21:48 -04:00
bors
c267ab4e3b Auto merge of #35004 - asomers:master, r=alexcrichton
Fix build of compiler-rt on FreeBSD

Broken since ee6011fc71 removed cmake from the
process.  There are likely other platforms still broken, but I didn't test on them.
2016-07-30 18:52:20 -07:00
bors
1225e122fd 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.
2016-07-30 15:58:20 -07:00
Zack M. Davis
661b4f09fb 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`.
2016-07-30 15:18:07 -07:00
Jorge Aparicio
eb6173806d return TargetResult 2016-07-30 15:44:59 -05:00
Jorge Aparicio
87fa075dba point the libc submodule back to rust-lang/libc 2016-07-30 15:39:13 -05:00
Jorge Aparicio
ea00993990 remove some anys that are no longer necessary 2016-07-30 15:39:13 -05:00
Jorge Aparicio
b38953709d rustc_back/target: remove musl_base
it's the same as linux_musl_base
2016-07-30 15:39:13 -05:00
Jorge Aparicio
f0ec906d18 arm-musl: statically link to libunwind 2016-07-30 15:39:13 -05:00
Jorge Aparicio
e50bcf3404 arm-musl: set max_atomic_width 2016-07-30 15:39:13 -05:00
Jorge Aparicio
9ffd0fe5a7 arm-musl targets now use cfg(env = "musl") 2016-07-30 15:39:13 -05:00
Timon Van Overveldt
f7247d1071 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).
2016-07-30 15:39:13 -05:00
Timon Van Overveldt
57cad5722d 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.
2016-07-30 15:39:13 -05:00
bors
9dba50b059 Auto merge of #35069 - wesleywiser:too_many_symbols, r=alexcrichton
Only export #[no_mangle] extern symbols during LTO

Fixes #34985
2016-07-30 13:04:30 -07:00
bors
7f7969ef44 Auto merge of #35117 - aravind-pg:path, r=alexcrichton
On Windows, ensure PATH does not contain invalid character `"`

Fixes #34959.

r? @alexcrichton
2016-07-30 10:11:33 -07:00
Seo Sanghyeon
03652157f9 Suppress unused type parameter error when type has error field 2016-07-31 00:58:30 +09:00
Guillaume Gomez
fda473f00f Add urls in std::io types 2016-07-30 13:38:04 +02:00
bors
ffcbd2deb5 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:
2016-07-30 04:35:39 -07:00
Guillaume Gomez
2bed205d3b Add io::Take doc example 2016-07-30 13:30:41 +02:00
Manish Goregaokar
0b64a561f6 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
2016-07-30 13:44:47 +05:30
Manish Goregaokar
ce79972314 Rollup merge of #35104 - frewsxcv:linked-list-append, r=steveklabnik
Rewrite `collections::LinkedList::append` doc example.

None
2016-07-30 13:44:47 +05:30
Manish Goregaokar
6ea3ef7ac2 Rollup merge of #35094 - mcarton:multispan, r=jonathandturner
Revert "Remove unused methods from MultiSpan"

This reverts commit f7019a4e2f.

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
2016-07-30 13:44:47 +05:30
Manish Goregaokar
e649a2535f Rollup merge of #35090 - michaelwoerister:get-rid-of-id-visitor, r=eddyb
intravisit: Fold functionality of IdVisitor into the regular Visitor.
2016-07-30 13:44:47 +05:30
Manish Goregaokar
26e22b8e2e 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
```
```
2016-07-30 13:44:46 +05:30
Manish Goregaokar
8c6421fb17 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
2016-07-30 13:44:46 +05:30
Manish Goregaokar
6234610252 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.
2016-07-30 13:44:46 +05:30
Manish Goregaokar
96e3972707 Rollup merge of #35049 - knight42:add-test, r=alexcrichton
Add a test for AddAssign on String

Fix #35047
2016-07-30 13:44:46 +05:30
bors
7580534c3a 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
2016-07-30 00:08:24 -07:00