]> git.lizzy.rs Git - rust.git/log
rust.git
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

8 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

8 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

8 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?

8 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)

8 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

8 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

8 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

8 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.

8 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.

8 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`.

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

8 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

8 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

8 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

8 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

8 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

8 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")

8 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).

8 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.

8 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

8 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

8 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

8 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:

8 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

8 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

8 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

8 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.

8 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
```
```

8 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

8 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.

8 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

8 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

8 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

8 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

8 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:

8 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

8 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

8 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

8 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

8 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

8 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

8 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.

8 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.

8 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

8 years agoAuto merge of #34980 - cardoe:expose-target-options, r=alexcrichton
bors [Fri, 29 Jul 2016 06:18:52 +0000 (23:18 -0700)]
Auto merge of #34980 - cardoe:expose-target-options, r=alexcrichton

Convert built-in targets to JSON

Convert the built-in targets to JSON to ensure that the JSON parser is always fully featured. This follows on #32988 and #32847. The PR includes a number of extra commits that are just intermediate changes necessary for bisectibility and the ability to prove correctness of the change.

8 years agoRewrite `collections::LinkedList::append` doc example.
Corey Farwell [Fri, 29 Jul 2016 02:09:31 +0000 (22:09 -0400)]
Rewrite `collections::LinkedList::append` doc example.

8 years agoTry to clear up some awkward wording
Brett Cannon [Fri, 29 Jul 2016 02:02:25 +0000 (19:02 -0700)]
Try to clear up some awkward wording

8 years agoAuto merge of #34967 - TimNN:mipsel-musl-soft-float, r=alexcrichton
bors [Fri, 29 Jul 2016 01:31:54 +0000 (18:31 -0700)]
Auto merge of #34967 - TimNN:mipsel-musl-soft-float, r=alexcrichton

switch mipsel-musl to soft float

Closes #34922.

r? @alexcrichton

8 years agoAuto merge of #34956 - nikomatsakis:incr-comp-o-files, r=mw
bors [Thu, 28 Jul 2016 21:17:54 +0000 (14:17 -0700)]
Auto merge of #34956 - nikomatsakis:incr-comp-o-files, r=mw

Enable reuse of `.o` files if nothing has changed

This PR completes a first "spike" for incremental compilation by enabling us to reuse `.o` files when nothing has changed. When in incr. mode, we will save `.o` files into the temporary directory, then copy them back out again if they are still valid. The code is still a bit rough but it does seem to work. =)

r? @michaelwoerister

Fixes #34036
Fixes #34037
Fixes #34038

8 years agomake it possible to track where hash diverges
Niko Matsakis [Thu, 28 Jul 2016 19:39:34 +0000 (15:39 -0400)]
make it possible to track where hash diverges

8 years agohash def-path's better
Niko Matsakis [Thu, 28 Jul 2016 19:39:02 +0000 (15:39 -0400)]
hash def-path's better

actually we shouldn't even hash nested items at all, but that is
addressed in a followup PR

8 years agoAuto merge of #34485 - tbu-:pr_unicode_debug_str, r=alexcrichton
bors [Thu, 28 Jul 2016 18:20:33 +0000 (11:20 -0700)]
Auto merge of #34485 - tbu-:pr_unicode_debug_str, r=alexcrichton

Escape fewer Unicode codepoints in `Debug` impl of `str`

Use the same procedure as Python to determine whether a character is
printable, described in [PEP 3138]. In particular, this means that the
following character classes are escaped:

- Cc (Other, Control)
- Cf (Other, Format)
- Cs (Other, Surrogate), even though they can't appear in Rust strings
- Co (Other, Private Use)
- Cn (Other, Not Assigned)
- Zl (Separator, Line)
- Zp (Separator, Paragraph)
- Zs (Separator, Space), except for the ASCII space `' '` `0x20`

This allows for user-friendly inspection of strings that are not
English (e.g. compare `"\u{e9}\u{e8}\u{ea}"` to `"éèê"`).

Fixes #34318.
CC #34422.

[PEP 3138]: https://www.python.org/dev/peps/pep-3138/

8 years agoRevert "Remove unused methods from MultiSpan"
mcarton [Thu, 28 Jul 2016 17:33:31 +0000 (19:33 +0200)]
Revert "Remove unused methods from MultiSpan"

This reverts commit f7019a4e2f80577d38ec35fcebd64d5970b15f78.

This removed the only way to make a suggestion with more than one
substitute. Bring it back until we come up with a better solution.

8 years agoMove to {integer} and {float}
Jonathan Turner [Thu, 28 Jul 2016 16:49:31 +0000 (09:49 -0700)]
Move to {integer} and {float}

8 years agoKeep multiple files per work-product
Niko Matsakis [Mon, 25 Jul 2016 14:51:14 +0000 (10:51 -0400)]
Keep multiple files per work-product

In the older version, a `.o` and ` .bc` file were separate
work-products.  This newer version keeps, for each codegen-unit, a set
of files of different kinds. We assume that if any kinds are available
then all the kinds we need are available, since the precise set of
switches will depend on attributes and command-line switches.

Should probably test this: the effect of changing attributes in
particular might not be successfully tracked?

8 years agoAddress mw nits
Niko Matsakis [Fri, 22 Jul 2016 14:39:30 +0000 (10:39 -0400)]
Address mw nits

8 years agoAdd a testing mechanism and a simple spike test
Niko Matsakis [Thu, 21 Jul 2016 16:50:15 +0000 (12:50 -0400)]
Add a testing mechanism and a simple spike test

8 years agoModify trans to skip generating `.o` files
Niko Matsakis [Thu, 21 Jul 2016 16:49:59 +0000 (12:49 -0400)]
Modify trans to skip generating `.o` files

This checks the `previous_work_products` data from the dep-graph and
tries to simply copy a `.o` file if possible.  We also add new
work-products into the dep-graph, and create edges to/from the dep-node
for a work-product.

8 years agoAdd non-panicking abs() functions to all signed integer types.
Jethro Beekman [Tue, 26 Jul 2016 23:31:39 +0000 (16:31 -0700)]
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.

8 years agoCode to save/load the work-products map from disk
Niko Matsakis [Thu, 21 Jul 2016 16:44:59 +0000 (12:44 -0400)]
Code to save/load the work-products map from disk

Work products are deleted if any of their inputs are dirty.

8 years agoStore `crate_disambiguator` as an `InternedString`
Niko Matsakis [Thu, 21 Jul 2016 16:41:29 +0000 (12:41 -0400)]
Store `crate_disambiguator` as an `InternedString`

We used to use `Name`, but the session outlives the tokenizer, which
means that attempts to read this field after trans has complete
otherwise panic. All reads want an `InternedString` anyhow.

8 years agoExtend DepGraph so it can track "work-products"
Niko Matsakis [Thu, 21 Jul 2016 16:33:23 +0000 (12:33 -0400)]
Extend DepGraph so it can track "work-products"

A work product right now is just a `.o` file. In the future it probably
includes other kinds of files, such as `.bc` files saving the
unoptimized LLVM IR.

However, because WorkProductIds must be independent of DefIds, so that
they don't need translation, this system may not be suitable *as is* for
storing fine-grained information (such as the MIR for individual defs),
as it was originally intended. We will want to refactor some for that.

8 years agoRename _ to {numerics} for unknown numeric types
Jonathan Turner [Wed, 27 Jul 2016 23:59:33 +0000 (16:59 -0700)]
Rename _ to {numerics} for unknown numeric types

8 years agoAuto merge of #35086 - Manishearth:rollup, r=Manishearth
bors [Thu, 28 Jul 2016 15:19:33 +0000 (08:19 -0700)]
Auto merge of #35086 - Manishearth:rollup, r=Manishearth

Rollup of 7 pull requests

- Successful merges: #34951, #34963, #34969, #35013, #35037, #35040, #35058
- Failed merges:

8 years agoRollup merge of #35040 - soltanmm:couple-is-a-pun, r=nikomatsakis
Manish Goregaokar [Thu, 28 Jul 2016 10:50:11 +0000 (16:20 +0530)]
Rollup merge of #35040 - soltanmm:couple-is-a-pun, r=nikomatsakis

Use &mut for `CombineFields` in inference relations

Because dropping obligations on the floor makes a mess.

r? @nikomatsakis

8 years agoRollup merge of #35037 - ollie27:rustdoc_tuple_struct_where, r=alexcrichton
Manish Goregaokar [Thu, 28 Jul 2016 10:50:11 +0000 (16:20 +0530)]
Rollup merge of #35037 - ollie27:rustdoc_tuple_struct_where, r=alexcrichton

rustdoc: Fix tuple struct where clause rendering

For tuple structs the where clause comes after the definition.

Fixes #34928

8 years agoRollup merge of #35013 - tamird:coerce-match-valgrind, r=alexcrichton
Manish Goregaokar [Thu, 28 Jul 2016 10:50:11 +0000 (16:20 +0530)]
Rollup merge of #35013 - tamird:coerce-match-valgrind, r=alexcrichton

move coerce-match{,-calls} into run-pass-valgrind

Closes #21696.

8 years agoRollup merge of #34969 - jseyfried:fix_cfg_feature, r=nrc
Manish Goregaokar [Thu, 28 Jul 2016 10:50:10 +0000 (16:20 +0530)]
Rollup merge of #34969 - jseyfried:fix_cfg_feature, r=nrc

Avoid processing `feature`s on unconfigured crates

Fixes #34932, a regression caused by #34272.
r? @nrc

8 years agoRollup merge of #34963 - petrochenkov:useerr, r=jseyfried
Manish Goregaokar [Thu, 28 Jul 2016 10:50:10 +0000 (16:20 +0530)]
Rollup merge of #34963 - petrochenkov:useerr, r=jseyfried

resolve: Fix ICE and extra diagnostics happening when unresolved imports are used in patterns

Closes https://github.com/rust-lang/rust/issues/34933

r? @jseyfried

8 years agoRollup merge of #34951 - tomgarcia:covariant-vec, r=brson
Manish Goregaokar [Thu, 28 Jul 2016 10:50:10 +0000 (16:20 +0530)]
Rollup merge of #34951 - tomgarcia:covariant-vec, r=brson

Make vec::Drain and binary_heap::Drain covariant

I removed all mutable pointers/references, and added covariance tests similar to the ones in #32635. It builds and passes the tests, but I noticed that there weren't any tests of Drain's behaviour (at least not in libcollectionstest), so I'm not sure if my changes accidently broke Drain's behaviour. Should I add some tests for that (and if so, what should the tests include)?

8 years agoAdd documentation example for `str::Chars::as_str`.
Corey Farwell [Wed, 27 Jul 2016 02:52:56 +0000 (22:52 -0400)]
Add documentation example for `str::Chars::as_str`.

8 years agoAuto merge of #34951 - tomgarcia:covariant-vec, r=brson
bors [Thu, 28 Jul 2016 12:24:31 +0000 (05:24 -0700)]
Auto merge of #34951 - tomgarcia:covariant-vec, r=brson

Make vec::Drain and binary_heap::Drain covariant

I removed all mutable pointers/references, and added covariance tests similar to the ones in #32635. It builds and passes the tests, but I noticed that there weren't any tests of Drain's behaviour (at least not in libcollectionstest), so I'm not sure if my changes accidently broke Drain's behaviour. Should I add some tests for that (and if so, what should the tests include)?

8 years agoAdd OpenOptionsExt doc examples
Guillaume Gomez [Thu, 28 Jul 2016 11:04:24 +0000 (13:04 +0200)]
Add OpenOptionsExt doc examples

8 years agoAdd doc examples for std::fs::unix::OpenOptionsExt
Guillaume Gomez [Thu, 28 Jul 2016 10:55:58 +0000 (12:55 +0200)]
Add doc examples for std::fs::unix::OpenOptionsExt

8 years agoAuto merge of #34908 - jseyfried:improve_tt_matchers, r=nrc
bors [Thu, 28 Jul 2016 07:01:54 +0000 (00:01 -0700)]
Auto merge of #34908 - jseyfried:improve_tt_matchers, r=nrc

macros: Improve `tt` matchers

Fixes #5846, fixes #22819.
r? @nrc

8 years agorustbuild: Ensure PATH does not contain invalid character `"`
Aravind Gollakota [Sat, 23 Jul 2016 18:53:07 +0000 (11:53 -0700)]
rustbuild: Ensure PATH does not contain invalid character `"`

8 years agoAdd regression test
Jeffrey Seyfried [Sun, 17 Jul 2016 18:28:48 +0000 (18:28 +0000)]
Add regression test

8 years agoAuto merge of #34946 - alexcrichton:fix-cfg, r=brson
bors [Thu, 28 Jul 2016 01:58:04 +0000 (18:58 -0700)]
Auto merge of #34946 - alexcrichton:fix-cfg, r=brson

std: Fix usage of SOCK_CLOEXEC

This code path was intended to only get executed on Linux, but unfortunately the
`cfg!` was malformed so it actually never got executed.

8 years agoAdd doc examples for std::fs::Metadata
Guillaume Gomez [Thu, 28 Jul 2016 00:53:34 +0000 (02:53 +0200)]
Add doc examples for std::fs::Metadata

8 years agoRename `char::escape` to `char::escape_debug` and add tracking issue
Tobias Bucher [Wed, 27 Jul 2016 10:10:31 +0000 (12:10 +0200)]
Rename `char::escape` to `char::escape_debug` and add tracking issue

8 years agoAdd test for string AddAssign
Knight [Tue, 26 Jul 2016 18:30:50 +0000 (02:30 +0800)]
Add test for string AddAssign

8 years agoAuto merge of #34907 - arielb1:found-parse-error, r=nikomatsakis
bors [Wed, 27 Jul 2016 21:28:06 +0000 (14:28 -0700)]
Auto merge of #34907 - arielb1:found-parse-error, r=nikomatsakis

Centralize and clean type error reporting

Refactors the code that handles type errors to be cleaner and fixes various edge cases.

This made the already-bad "type mismatch resolving" error message somewhat uglier. I want to fix that in another commit before this PR is merged.

Fixes #31173

r? @jonathandturner, cc @nikomatsakis

8 years agoMention debug_assert! in assert! doc
Panashe M. Fundira [Wed, 27 Jul 2016 19:16:11 +0000 (15:16 -0400)]
Mention debug_assert! in assert! doc

8 years agoRevert section about panic! in assert! doc
Panashe M. Fundira [Wed, 27 Jul 2016 19:03:23 +0000 (15:03 -0400)]
Revert section about panic! in assert! doc

8 years agoCorrect minor typo in debug_assert doc
Panashe M. Fundira [Wed, 27 Jul 2016 19:01:43 +0000 (15:01 -0400)]
Correct minor typo in debug_assert doc

8 years agoremove claim about searching through nested fields for the nullable type, even though...
Alex Burka [Wed, 27 Jul 2016 17:57:14 +0000 (13:57 -0400)]
remove claim about searching through nested fields for the nullable type, even though that is how it works

8 years agofix typo
Alex Burka [Wed, 27 Jul 2016 17:52:13 +0000 (13:52 -0400)]
fix typo

8 years agorevert libc changes
Alex Burka [Wed, 27 Jul 2016 17:51:48 +0000 (13:51 -0400)]
revert libc changes

8 years agohack to make example compile
Alex Burka [Tue, 14 Jun 2016 19:53:55 +0000 (15:53 -0400)]
hack to make example compile

8 years agochange confusing wording about discriminant
Alex Burka [Tue, 14 Jun 2016 01:38:04 +0000 (21:38 -0400)]
change confusing wording about discriminant

8 years agoextern fns require named parameters
Alex Burka [Tue, 14 Jun 2016 01:10:12 +0000 (21:10 -0400)]
extern fns require named parameters

Not sure the example is going to stay, but I can try to pass Travis for the bragging rights.

8 years agoforeign function interface interface
Alex Burka [Mon, 13 Jun 2016 22:00:07 +0000 (18:00 -0400)]
foreign function interface interface

8 years agonot just a single field
Alex Burka [Mon, 13 Jun 2016 21:54:39 +0000 (17:54 -0400)]
not just a single field

8 years agorecursion
Alex Burka [Mon, 13 Jun 2016 21:47:18 +0000 (17:47 -0400)]
recursion

8 years agoexpand nullable pointer example
Alex Burka [Mon, 13 Jun 2016 20:13:20 +0000 (16:13 -0400)]
expand nullable pointer example

8 years agogenerics-agnostic description
Alex Burka [Mon, 13 Jun 2016 19:05:22 +0000 (15:05 -0400)]
generics-agnostic description

8 years agobook/ffi: nullable pointer, libc cleanups
Alex Burka [Mon, 13 Jun 2016 17:22:38 +0000 (13:22 -0400)]
book/ffi: nullable pointer, libc cleanups

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

Change examples to use std::os::raw instead of libc, when applicable.