]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRollup merge of #38457 - frewsxcv:include, r=GuillaumeGomez
Guillaume Gomez [Thu, 19 Jan 2017 10:56:00 +0000 (11:56 +0100)]
Rollup merge of #38457 - frewsxcv:include, r=GuillaumeGomez

Improvements to 'include' macro documentation.

None

7 years agoAuto merge of #38464 - clarcharr:ip_cmp, r=sfackler
bors [Thu, 19 Jan 2017 03:34:05 +0000 (03:34 +0000)]
Auto merge of #38464 - clarcharr:ip_cmp, r=sfackler

PartialEq and PartialOrd between IpAddr and Ipv[46]Addr.

PartialEq was rather useful, so, I figured that I'd implement it. I added PartialOrd for good measure.

7 years agoAuto merge of #38712 - clarcharr:duration_sum, r=sfackler
bors [Thu, 19 Jan 2017 01:09:46 +0000 (01:09 +0000)]
Auto merge of #38712 - clarcharr:duration_sum, r=sfackler

Sum for Duration

Implemented the `Sum` trait for `Duration`. Seems reasonable.

7 years agoAuto merge of #38168 - estebank:help-E0034, r=nrc
bors [Wed, 18 Jan 2017 04:45:25 +0000 (04:45 +0000)]
Auto merge of #38168 - estebank:help-E0034, r=nrc

E0034: provide disambiguated syntax for candidates

For a given file

```rust
trait A { fn foo(&self) {} }
trait B : A { fn foo(&self) {} }

fn bar<T: B>(a: &T) {
  a.foo()
}
```

provide the following output

```
error[E0034]: multiple applicable items in scope
 --> file.rs:6:5
  |
6 |   a.foo(1)
  |     ^^^ multiple `foo` found
  |
note: candidate #1 is defined in the trait `A`
 --> file.rs:2:11
  |
2 | trait A { fn foo(&self, a: usize) {} }
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: to use it here write `A::foo(&a, 1)` instead
 --> file.rs:6:5
  |
6 |   a.foo(1)
  |     ^^^
note: candidate #2 is defined in the trait `B`
 --> file.rs:3:15
  |
3 | trait B : A { fn foo(&self, a: usize) {} }
  |               ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: to use it here write `B::foo(&a, 1)` instead
 --> file.rs:6:5
  |
6 |   a.foo(1)
  |     ^^^
```

Fix #37767.

7 years agoAuto merge of #39019 - nikomatsakis:issue-38919, r=eddyb
bors [Wed, 18 Jan 2017 02:20:03 +0000 (02:20 +0000)]
Auto merge of #39019 - nikomatsakis:issue-38919, r=eddyb

only consider value items when searching for methods, not types

Fixes #38919

r? @eddyb

7 years agotolerate `None` return from `get_line`
Niko Matsakis [Tue, 17 Jan 2017 22:56:03 +0000 (17:56 -0500)]
tolerate `None` return from `get_line`

7 years agomore complete error message
Niko Matsakis [Tue, 17 Jan 2017 22:55:49 +0000 (17:55 -0500)]
more complete error message

7 years agoAuto merge of #37972 - bluss:iter-find-is-on-a-roll, r=sfackler
bors [Tue, 17 Jan 2017 21:52:03 +0000 (21:52 +0000)]
Auto merge of #37972 - bluss:iter-find-is-on-a-roll, r=sfackler

Improve the slice iterator's searching methods

Improve all, any, find, position, rposition by explicitly unrolling the loop for the slice iterators.

- Introduce a few extension methods and functions for raw pointers make the new code easy to express
- Introduce helper methods `search_while, rsearch_while` that generalize all the searching methods

LLVM doesn't unroll the loop in `.find()` by default (clang is the same), so performance benefits a lot from explicit unrolling here. An iterator method without conditional exits (like `.fold()`) does not need this on the other hand.

One of the raw pointer extension methods is `fn post_inc(&mut self) -> Self` which is the rustic equivalent of “`ptr++`”, and it is a nice way to express the raw pointer loop (see commit 3).

Specific development notes about `search_while`: I tried both computing an end pointer "rounded" to 4, as well as the `ptrdistance >= 4` loop condition, ptrdistance was better. I tried handling the last 0-3 elements unrolled or with a while loop, the loop was better.

7 years agoAuto merge of #39109 - michaelwoerister:incr-comp-cache-cleanup, r=nikomatsakis
bors [Tue, 17 Jan 2017 18:22:20 +0000 (18:22 +0000)]
Auto merge of #39109 - michaelwoerister:incr-comp-cache-cleanup, r=nikomatsakis

incr.comp.: Delete orphaned work-products.

The new partitioning scheme uncovered a hole in our incr. comp. cache directory garbage collection. So far, we relied on unneeded work products being deleted during the initial cache invalidation phase. However, we the new scheme, we get object files/work products that only contain code from upstream crates. Sometimes this code is not needed anymore (because all callers have been removed from the source) but because nothing that actually influences the contents of these work products had changed, we never deleted them from disk.

r? @nikomatsakis

7 years agoAuto merge of #39100 - Mark-Simulacrum:fix-stage1, r=eddyb
bors [Tue, 17 Jan 2017 14:38:29 +0000 (14:38 +0000)]
Auto merge of #39100 - Mark-Simulacrum:fix-stage1, r=eddyb

Fix stage 1 tests broken because i128 doesn't work in stage 1

Broken by https://github.com/rust-lang/rust/pull/38992.

7 years agoAuto merge of #39110 - petrochenkov:sum, r=eddyb
bors [Tue, 17 Jan 2017 12:31:15 +0000 (12:31 +0000)]
Auto merge of #39110 - petrochenkov:sum, r=eddyb

Merge ObjectSum and PolyTraitRef in AST/HIR + some other refactoring

`ObjectSum` and `PolyTraitRef` are the same thing (list of bounds), they exist separately only due to parser quirks. The second commit merges them.

The first commit replaces `Path` with `Ty` in (not yet supported) equality predicates. They are parsed as types anyway and arbitrary types can always be disguised as paths using aliases, so this doesn't add any new functionality.

The third commit uses `Vec` instead of `P<[T]>` in AST. AST is not immutable like HIR and `Vec`s are more convenient for it, unnecessary conversions are also avoided.

The last commit renames `parse_ty_sum` (which is used for parsing types in general) into `parse_ty`, and renames `parse_ty` (which is used restricted contexts where `+` is not permitted due to operator priorities or other reasons) into `parse_ty_no_plus`.

This is the first part of https://github.com/rust-lang/rust/issues/39085#issuecomment-272743755 and https://github.com/rust-lang/rust/issues/39080 focused on data changes and mechanical renaming, I'll submit a PR with parser changes a bit later.

r? @eddyb

7 years agoAuto merge of #39095 - nagisa:fix-ub-in-testhelp, r=alexcrichton
bors [Tue, 17 Jan 2017 10:10:32 +0000 (10:10 +0000)]
Auto merge of #39095 - nagisa:fix-ub-in-testhelp, r=alexcrichton

Fix UB in test helpers

Macro expansion producing defined has undefined behavior in C/C++.

7 years agoAuto merge of #39050 - alexcrichton:travis-nightly, r=brson
bors [Tue, 17 Jan 2017 08:01:04 +0000 (08:01 +0000)]
Auto merge of #39050 - alexcrichton:travis-nightly, r=brson

travis: Pass --release-channel=nightly on deploy

This commit passes the `--release-channel=nightly` flag to all images which have
the `DEPLOY` flag set. This means that we'll name artifacts and the compiler
appropriately.

This reworks a bit how arguments are passed, but for now doesn't change what's
already being passed. Eventually we'll want to avoid enabling debug assertions
and llvm assertions for *all* releases, but I figure we can tackle that a little
bit more down the road.

7 years agoRename ObjectSum into TraitObject in AST/HIR
Vadim Petrochenkov [Tue, 17 Jan 2017 07:41:44 +0000 (10:41 +0300)]
Rename ObjectSum into TraitObject in AST/HIR

7 years agotravis: Pass --release-channel=nightly on deploy
Alex Crichton [Fri, 13 Jan 2017 23:35:58 +0000 (15:35 -0800)]
travis: Pass --release-channel=nightly on deploy

This commit passes the `--release-channel=nightly` flag to all images which have
the `DEPLOY` flag set. This means that we'll name artifacts and the compiler
appropriately.

This reworks a bit how arguments are passed, but for now doesn't change what's
already being passed. Eventually we'll want to avoid enabling debug assertions
and llvm assertions for *all* releases, but I figure we can tackle that a little
bit more down the road.

7 years agoAuto merge of #39090 - solson:exprkind-array, r=eddyb
bors [Tue, 17 Jan 2017 05:55:56 +0000 (05:55 +0000)]
Auto merge of #39090 - solson:exprkind-array, r=eddyb

Rename ExprKind::Vec to Array in HIR and HAIR.

This is a clearer name since they represent `[a, b, c]` array literals.

r? @eddyb

7 years agoAuto merge of #39087 - nrc:qquote-empty-delim, r=jseyfried
bors [Tue, 17 Jan 2017 03:29:42 +0000 (03:29 +0000)]
Auto merge of #39087 - nrc:qquote-empty-delim, r=jseyfried

proc macros/qquote: Handle empty delimited tokens

r? @jseyfried

7 years agoAuto merge of #38949 - GuillaumeGomez:fix_linker, r=nagisa
bors [Tue, 17 Jan 2017 00:50:52 +0000 (00:50 +0000)]
Auto merge of #38949 - GuillaumeGomez:fix_linker, r=nagisa

Fix linker failure on windows

Fixes #38933.

r? @ollie27

7 years agosyntax: Rename parse_ty -> parse_ty_no_plus, parse_ty_sum -> parse_ty
Vadim Petrochenkov [Mon, 16 Jan 2017 23:13:41 +0000 (02:13 +0300)]
syntax: Rename parse_ty -> parse_ty_no_plus, parse_ty_sum -> parse_ty

7 years agoUse resizable Vec instead of P<[T]> in AST
Vadim Petrochenkov [Mon, 16 Jan 2017 22:54:59 +0000 (01:54 +0300)]
Use resizable Vec instead of P<[T]> in AST

7 years agoincr.comp.: Delete orphaned work-products.
Michael Woerister [Mon, 16 Jan 2017 22:54:20 +0000 (17:54 -0500)]
incr.comp.: Delete orphaned work-products.

7 years agoAST/HIR: Merge ObjectSum and PolyTraitRef
Vadim Petrochenkov [Mon, 16 Jan 2017 20:33:45 +0000 (23:33 +0300)]
AST/HIR: Merge ObjectSum and PolyTraitRef

7 years agoAuto merge of #39108 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Mon, 16 Jan 2017 22:21:51 +0000 (22:21 +0000)]
Auto merge of #39108 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 6 pull requests

- Successful merges: #38247, #39028, #39065, #39084, #39105, #39106
- Failed merges:

7 years agoRollup merge of #39106 - istankovic:patch-2, r=GuillaumeGomez
Guillaume Gomez [Mon, 16 Jan 2017 21:48:26 +0000 (22:48 +0100)]
Rollup merge of #39106 - istankovic:patch-2, r=GuillaumeGomez

libcollections: btree/set: fix a typo

7 years agoRollup merge of #39105 - istankovic:patch-1, r=sfackler
Guillaume Gomez [Mon, 16 Jan 2017 21:48:25 +0000 (22:48 +0100)]
Rollup merge of #39105 - istankovic:patch-1, r=sfackler

libcollections: btree/map: fix typos

7 years agoRollup merge of #39084 - sphela:book-update-patterns, r=steveklabnik
Guillaume Gomez [Mon, 16 Jan 2017 21:48:24 +0000 (22:48 +0100)]
Rollup merge of #39084 - sphela:book-update-patterns, r=steveklabnik

An update to patterns documentation

As it is written the current pattern page creates a lot of confusion, even for someone with previous rust experience. It's so hard because it introduces an entirely new language feature without explaining. Someone could update it within the span of a few minutes by just explaining the newly introduced feature.

```rust
match c {
    x => println!("x: {} c: {}", x, c),
}
```
No where in the book up to this point has it explained that identifiers match patterns with just a name create an irrefutable pattern. The page uses this feature without explanation, it just assumes that readers would immediately understand it. To confuse the issue even further the topic uses this feature to explain shadowing, placing two x's from different scopes and different meanings without ever explaining why there is shadowing.

What follows comes across as utterly nonsensical given everything the reader would know about Rust about this point:

```rust
the result:
x: c c: c
x: x
```

x is c? What? Yes even if you understand that x here is not the x in the previous scope why would x equal 'c' here? What previous chapter explained this? The previous chapter on 'matching' only mentions the catch all '_' and never in any shape or form mentioned that a name here creates an irrefutable pattern and binds a value.

There are numerous examples of people not understanding this section, not finding answers and looking for them online about `x: c c: c`:

https://github.com/rust-lang/book/issues/316

https://stackoverflow.com/questions/35563141/match-shadowing-example-in-the-patterns-section-of-the-rust-book-is-very-perplex

https://users.rust-lang.org/t/confusion-about-match-and-patterns/3937

https://www.bountysource.com/issues/38852461-question-on-patterns-section-shadowing-example-existing-book

And a [google search for `rust x: c c: c`](https://www.google.com/search?q=rust+%22x:+c+c:+c%22) finds many more people being tripped up, including people who speak a language other than English. I am confident that this page has resulted in questions on the irc channel more than once. Given rust already has a pretty big learning curve I recommend this be fixed.

I was asked to create PR from where I made this same case in the [rust book repository issue](https://github.com/rust-lang/book/issues/316) (I didn't realize this was a separate project).

7 years agoRollup merge of #39065 - frewsxcv:libstd-os-unix-ffi-docs, r=GuillaumeGomez
Guillaume Gomez [Mon, 16 Jan 2017 21:48:23 +0000 (22:48 +0100)]
Rollup merge of #39065 - frewsxcv:libstd-os-unix-ffi-docs, r=GuillaumeGomez

Add doc examples & description in `std::os::unix::ffi`.

None

7 years agoRollup merge of #39028 - frewsxcv:libstd-env-docs, r=brson
Guillaume Gomez [Mon, 16 Jan 2017 21:48:22 +0000 (22:48 +0100)]
Rollup merge of #39028 - frewsxcv:libstd-env-docs, r=brson

Minor improvements to docs in std::env structures/functions.

* Call functions "functions" instead of "methods".
* Link structures to their constructor functions
* Add other misc. documentation links

7 years agoRollup merge of #38247 - federicomenaquintero:assert-eq-argument-docs, r=GuillaumeGomez
Guillaume Gomez [Mon, 16 Jan 2017 21:48:21 +0000 (22:48 +0100)]
Rollup merge of #38247 - federicomenaquintero:assert-eq-argument-docs, r=GuillaumeGomez

Document the optional extra arguments to assert_eq!() / assert_ne!()

And clarify that those arguments in assert!() are in fact formattable.

7 years agolibcollections: btree/set: fix a typo
Ivan Stankovic [Mon, 16 Jan 2017 20:26:43 +0000 (21:26 +0100)]
libcollections: btree/set: fix a typo

7 years agolibcollections: btree/map: fix typos
Ivan Stankovic [Mon, 16 Jan 2017 20:24:18 +0000 (21:24 +0100)]
libcollections: btree/map: fix typos

7 years agoAuto merge of #39094 - nagisa:i128-fix-endianness, r=eddyb
bors [Mon, 16 Jan 2017 20:23:09 +0000 (20:23 +0000)]
Auto merge of #39094 - nagisa:i128-fix-endianness, r=eddyb

(Shot at) Fix endian bugs in i128 intrinsic impls

Attempt to fix the endianness issues on big-endian machines such as power pc. Could not test if it actually makes stuff work on the powerpc, because setting up cross-compiler for ppc seems to be nigh-impossible on arch.

7 years agoFix stage 0 and 1 tests broken because i128 doesn't work in stages less than 2
Mark Simulacrum [Mon, 16 Jan 2017 16:47:05 +0000 (09:47 -0700)]
Fix stage 0 and 1 tests broken because i128 doesn't work in stages less than 2

Broken by https://github.com/rust-lang/rust/pull/38992.

7 years agoAST/HIR: Replace Path with Type in WhereEqPredicate
Vadim Petrochenkov [Mon, 16 Jan 2017 18:32:13 +0000 (21:32 +0300)]
AST/HIR: Replace Path with Type in WhereEqPredicate

7 years agoAuto merge of #39102 - alexcrichton:netbsd-mirror, r=alexcrichton
bors [Mon, 16 Jan 2017 18:08:59 +0000 (18:08 +0000)]
Auto merge of #39102 - alexcrichton:netbsd-mirror, r=alexcrichton

travis: Mirror some NetBSD artifacts

This mirrors a few artifacts that have been flaky to download recently
on our own S3 bucket, which has historically been more reliable.

Closes #39097

7 years agotravis: Mirror some NetBSD artifacts
Alex Crichton [Mon, 16 Jan 2017 18:06:54 +0000 (10:06 -0800)]
travis: Mirror some NetBSD artifacts

This mirrors a few artifacts that have been flaky to download recently
on our own S3 bucket, which has historically been more reliable.

Closes #39097

7 years agoAuto merge of #39076 - ollie27:rustdoc_stab_prim, r=GuillaumeGomez
bors [Mon, 16 Jan 2017 13:22:29 +0000 (13:22 +0000)]
Auto merge of #39076 - ollie27:rustdoc_stab_prim, r=GuillaumeGomez

rustdoc: Give primitive types stability attributes

This is especially important for i128/u128 to make it clear they are
unstable in the docs.

7 years agoAuto merge of #39072 - radix:patch-1, r=GuillaumeGomez
bors [Mon, 16 Jan 2017 11:17:34 +0000 (11:17 +0000)]
Auto merge of #39072 - radix:patch-1, r=GuillaumeGomez

Minor improvement to strange grammar in E0525

Hi, I just ran into this error from rustc, and it had some strange grammar, so I cleaned it up a bit.

7 years agoFix UB in test helpers
Simonas Kazlauskas [Mon, 16 Jan 2017 09:46:00 +0000 (11:46 +0200)]
Fix UB in test helpers

Macro expansion producing defined has undefined behavior in C/C++.

7 years agoFix endian bugs in i128 intrinsic impls
Simonas Kazlauskas [Mon, 16 Jan 2017 09:32:38 +0000 (11:32 +0200)]
Fix endian bugs in i128 intrinsic impls

7 years agoAuto merge of #39071 - est31:master, r=GuillaumeGomez
bors [Mon, 16 Jan 2017 09:16:44 +0000 (09:16 +0000)]
Auto merge of #39071 - est31:master, r=GuillaumeGomez

Mark safe_suggestion and pushpop_unsafe as removed in feature_gate.rs

This removes two features from feature_gate.rs: `safe_suggestion` and `pushpop_unsafe`. Both had been removed in other places already, but were forgotten to be removed from feature_gate.rs.

* `safe_suggestion` was added in commit 164f0105bb65f31b89e5fb7f368c9e6f5833a3f8 and then removed again in commit c11fe553df269d6f47b4c48f5c47c08efdd373dc both in the same PR #38099.

* `pushpop_unsafe` was added in commit 1829fa5199bae5a192c771807c532badce14be37 and removed again in commit d399098fd82e0bf3ed61bbbbcdbb0b6adfa4c808

Removes two elements from the whitelist of non gate tested unstable lang features (issue #39059).

7 years agoRename ExprKind::Vec to Array in HIR and HAIR.
Scott Olson [Mon, 16 Jan 2017 07:36:10 +0000 (23:36 -0800)]
Rename ExprKind::Vec to Array in HIR and HAIR.

This is a clearer name since they represent [a, b, c] array literals.

7 years agoAuto merge of #39069 - GuillaumeGomez:missing_blank_space, r=Manishearth
bors [Mon, 16 Jan 2017 07:18:48 +0000 (07:18 +0000)]
Auto merge of #39069 - GuillaumeGomez:missing_blank_space, r=Manishearth

Fix missing blank space issue

r? @Manishearth

7 years agoAuto merge of #38806 - comex:lint-attr-fix, r=nrc
bors [Mon, 16 Jan 2017 05:17:39 +0000 (05:17 +0000)]
Auto merge of #38806 - comex:lint-attr-fix, r=nrc

Fix lint attributes on non-item nodes.

Currently, late lint checking uses two HIR visitors: LateContext and
IdVisitor.  IdVisitor only overrides visit_id, and for each node searches
for builtin lints previously added to the session; LateContext overrides
a number of methods, and runs late lints.  When LateContext encounters an
item, it first has IdVisitor walk everything in it except nested items
(OnlyBodies), then recurses into it itself - i.e. there are two separate
walks.

Aside from apparently being unnecessary, this separation prevents lint
attributes (allow/deny/warn) on non-item HIR nodes from working
properly.  Test case:

```rust
// generates warning without this change
fn main() { #[allow(unreachable_code)] loop { break; break; } }
```

LateContext contains logic to merge attributes seen into the current lint
settings while walking (with_lint_attrs), but IdVisitor does not.  So
such attributes will affect late lints (because they are called from
LateContext), and if the node contains any items within it, they will
affect builtin lints within those items (because that IdVisitor is run
while LateContext is within the attributed node), but otherwise the
attributes will be ignored for builtin lints.

This change simply removes IdVisitor and moves its visit_id into
LateContext itself.  Hopefully this doesn't break anything...

Also added walk calls to visit_lifetime and visit_lifetime_def
respectively, so visit_lifetime_def will recurse into the lifetime and
visit_lifetime will recurse into the name.  In principle this could
confuse lint plugins.  This is "necessary" because walk_lifetime calls
visit_id on the lifetime; of course, an alternative would be directly
calling visit_id (which would require manually iterating over the
lifetimes in visit_lifetime_def), but that seems less clean.

7 years agoproc macros/qquote: Handle empty delimited tokens
Nick Cameron [Mon, 16 Jan 2017 00:54:36 +0000 (13:54 +1300)]
proc macros/qquote: Handle empty delimited tokens

7 years agoAuto merge of #39042 - alexcrichton:upload-more, r=brson
bors [Sun, 15 Jan 2017 23:49:24 +0000 (23:49 +0000)]
Auto merge of #39042 - alexcrichton:upload-more, r=brson

travis: Expand dist builder coverage

This commit adds six new travis matrix entires for doing cross-compiled
distribution builds of the compiler. The support added in #38731 allows us to
quickly compile a complete suite of distribution artifacts for cross-compiled
platforms, and currently each matrix entry (when fully cached) clocks in around
an hour to finish. Note that a full test run typically takes about two hours
right now.

With further optimizations coming down the pike in #39026 this commit also
starts doubling up cross-compiled distribution builders on each matrix entry. We
initially planned to do one build per entry, but it's looking like we may be
able to get by with more than one in each entry. Depending on how long these
builds take we may even be able to up it to three, but we'll start with two
first.

This commit then completes the suite of cross-compiled compilers that we're
going to compile, adding it for a whole litany of platforms detailed in the
changes to the docker files here. The existing `cross` image is also trimmed
down quite a bit to avoid duplicate work, and we'll eventually provision it for
far more cross compilation as well.

Note that the gcc toolchains installed to compile most of these compilers are
inappropriate for actualy distribution. The glibc they pull in is much newer
than we'd like, so before we turn nightlies off we'll need to tweak these docker
files to custom build toolchains like the current `linux-cross` docker image
does.

7 years agoAuto merge of #38610 - djzin:master, r=sfackler
bors [Sun, 15 Jan 2017 21:44:51 +0000 (21:44 +0000)]
Auto merge of #38610 - djzin:master, r=sfackler

Implementation of plan in issue #27787 for btree_range

Still some ergonomics to be worked on, the ::<str,_> is particularly unsightly

7 years agoAn update to patterns documentation
Bjorn Tipling [Sun, 15 Jan 2017 20:27:41 +0000 (12:27 -0800)]
An update to patterns documentation

As it is written it creates a lot of confusion.

7 years agotravis: Expand dist builder coverage
Alex Crichton [Fri, 13 Jan 2017 17:18:09 +0000 (09:18 -0800)]
travis: Expand dist builder coverage

This commit adds six new travis matrix entires for doing cross-compiled
distribution builds of the compiler. The support added in #38731 allows us to
quickly compile a complete suite of distribution artifacts for cross-compiled
platforms, and currently each matrix entry (when fully cached) clocks in around
an hour to finish. Note that a full test run typically takes about two hours
right now.

With further optimizations coming down the pike in #39026 this commit also
starts doubling up cross-compiled distribution builders on each matrix entry. We
initially planned to do one build per entry, but it's looking like we may be
able to get by with more than one in each entry. Depending on how long these
builds take we may even be able to up it to three, but we'll start with two
first.

This commit then completes the suite of cross-compiled compilers that we're
going to compile, adding it for a whole litany of platforms detailed in the
changes to the docker files here. The existing `cross` image is also trimmed
down quite a bit to avoid duplicate work, and we'll eventually provision it for
far more cross compilation as well.

Note that the gcc toolchains installed to compile most of these compilers are
inappropriate for actualy distribution. The glibc they pull in is much newer
than we'd like, so before we turn nightlies off we'll need to tweak these docker
files to custom build toolchains like the current `linux-cross` docker image
does.

7 years agoFix missing blank space issue
Guillaume Gomez [Sat, 14 Jan 2017 22:05:30 +0000 (23:05 +0100)]
Fix missing blank space issue

7 years agoAuto merge of #39063 - ruuda:covered-switch, r=alexcrichton
bors [Sun, 15 Jan 2017 15:03:10 +0000 (15:03 +0000)]
Auto merge of #39063 - ruuda:covered-switch, r=alexcrichton

Fix covered-switch-default warnings in RustWrapper

These switch statements cover all possible values, so the default case is dead code (it contains an `llvm_unreachable anyway`), triggering a `-Wcovered-switch-default` warning that pollutes the build output. Moving the unreachable after the switch resolves these warnings.

r? @rkruppe

7 years agoAuto merge of #39055 - aidanhs:aphs-deinit-before-init, r=alexcrichton
bors [Sun, 15 Jan 2017 13:00:49 +0000 (13:00 +0000)]
Auto merge of #39055 - aidanhs:aphs-deinit-before-init, r=alexcrichton

If submodule init fails, try from scratch

See #39051

I wonder if the cause could be some strange not-quite-checked-out state in a submodule. Try and fix this by force deinitialising everything before initialising (this will not throw away downloaded objects, git will skip them on the next attempt at cloning).

r? @alexcrichton

7 years agoAuto merge of #39052 - alexcrichton:fix-rebuild, r=brson
bors [Sun, 15 Jan 2017 11:03:48 +0000 (11:03 +0000)]
Auto merge of #39052 - alexcrichton:fix-rebuild, r=brson

rustbuild: Skip the build_helper crate in tests

I've been noticing some spurious recompiles of the final stage on Travis lately
and in debugging them I found a case where we were a little to eager to update
a stamp file due to the build_helper library being introduced during the testing
phase.

Part of the rustbuild system detects when libstd is recompiled and automatically
cleans out future directories to ensure that dirtyness propagation works. To do
this rustbuild doesn't know the artifact name of the standard library so it just
probes everything in the target directory, looking to see if anything changed.

The problem here happened where:

* First, rustbuild would compile everything (a normal build)
* Next, rustbuild would run all tests
* During testing, the libbuild_helper library was introduced into the target
  directory, making it look like a change happened because a file is newer
  than the newest was before
* Detecting a change, the next compilation would then cause rustbuild to clean
  out old artifacts and recompile everything again.

This commit fixes this problem by correcting rustbuild to just not test the
build_helper crate at all. This crate doesn't have any unit tests, nor is it
intended to. That way the target directories should stay the same throughout
testing after a previous build.

7 years agorustdoc: Give primitive types stability attributes
Oliver Middleton [Sun, 15 Jan 2017 09:08:29 +0000 (09:08 +0000)]
rustdoc: Give primitive types stability attributes

This is especially important for i128/u128 to make it clear they are
unstable in the docs.

7 years agoAuto merge of #39045 - redox-os:process_try_wait, r=brson
bors [Sun, 15 Jan 2017 08:01:19 +0000 (08:01 +0000)]
Auto merge of #39045 - redox-os:process_try_wait, r=brson

Add try_wait to Redox process

This implements Process::try_wait on Redox

7 years agoAuto merge of #39040 - estebank:relevant-impl-multiline, r=nikomatsakis
bors [Sun, 15 Jan 2017 05:48:34 +0000 (05:48 +0000)]
Auto merge of #39040 - estebank:relevant-impl-multiline, r=nikomatsakis

Use multiline Diagnostic for "relevant impl" list

Provide the following output:

```
error[E0277]: the trait bound `Bar: Foo<usize>` is not satisfied
  --> $DIR/issue-21659-show-relevant-trait-impls-2.rs:38:8
   |
38 |     f1.foo(1usize);
   |        ^^^ the trait `Foo<usize>` is not implemented for `Bar`
   |
   = help: the following implementations were found:
             <Bar as Foo<i8>>
             <Bar as Foo<i16>>
             <Bar as Foo<i32>>
             <Bar as Foo<u8>>
           and 2 others

error: aborting due to previous error
```

instead of

```
error[E0277]: the trait bound `Bar: Foo<usize>` is not satisfied
  --> $DIR/issue-21659-show-relevant-trait-impls-2.rs:38:8
   |
38 |     f1.foo(1usize);
   |        ^^^ the trait `Foo<usize>` is not implemented for `Bar`
   |
   = help: the following implementations were found:
   = help:   <Bar as Foo<i8>>
   = help:   <Bar as Foo<i16>>
   = help:   <Bar as Foo<i32>>
   = help:   <Bar as Foo<u8>>
   = help: and 2 others

error: aborting due to previous error
```

7 years ago"where it didn't" -> "but didn't"
Christopher Armstrong [Sun, 15 Jan 2017 04:00:04 +0000 (22:00 -0600)]
"where it didn't" -> "but didn't"

7 years agoAdd doc examples & description in `std::os::unix::ffi`.
Corey Farwell [Sat, 14 Jan 2017 17:40:40 +0000 (12:40 -0500)]
Add doc examples & description in `std::os::unix::ffi`.

7 years agoMark the pushpop_unsafe feature as "removed"
est31 [Sun, 15 Jan 2017 00:03:33 +0000 (01:03 +0100)]
Mark the pushpop_unsafe feature as "removed"

This marks the pushpop_unsafe feature as removed inside the feature_gate.
It was added in commit 1829fa5199bae5a192c771807c532badce14be37 and then
removed again in commit d399098fd82e0bf3ed61bbbbcdbb0b6adfa4c808 .
Seems that the second commit forgot to mark it as removed in feature_gate.rs.

This enables us to remove another element from the whitelist of non gate
tested unstable lang features (issue #39059).

7 years agoRemove the safe_suggestion feature
est31 [Sat, 14 Jan 2017 23:50:17 +0000 (00:50 +0100)]
Remove the safe_suggestion feature

This removes the safe_suggestion feature from feature_gate.rs.
It was added in commit 164f0105bb65f31b89e5fb7f368c9e6f5833a3f8
and then removed again in commit c11fe553df269d6f47b4c48f5c47c08efdd373dc .

As the removal was in the same PR #38099 as the addition, we don't move it to
the "removed" section.

Removes an element from the whitelist of non gate tested unstable lang features (issue #39059).

7 years agoMinor improvement to strange grammar in E0525
Christopher Armstrong [Sun, 15 Jan 2017 00:59:33 +0000 (18:59 -0600)]
Minor improvement to strange grammar in E0525

7 years agoAuto merge of #39026 - alexcrichton:more-less-cross-stage0, r=aturon
bors [Sun, 15 Jan 2017 00:18:04 +0000 (00:18 +0000)]
Auto merge of #39026 - alexcrichton:more-less-cross-stage0, r=aturon

rustbuild: Actually don't build stage0 target rustc

This was attempted in #38853 but erroneously forgot one more case of where the
compiler was compiled. This commit fixes that up and adds a test to ensure this
doesn't sneak back in.

7 years agoMerge branch 'master' into lint-attr-fix
comex [Sat, 14 Jan 2017 23:04:27 +0000 (18:04 -0500)]
Merge branch 'master' into lint-attr-fix

7 years agoAuto merge of #39020 - michaelwoerister:dep-graph-dfs-caching, r=nikomatsakis
bors [Sat, 14 Jan 2017 22:00:43 +0000 (22:00 +0000)]
Auto merge of #39020 - michaelwoerister:dep-graph-dfs-caching, r=nikomatsakis

incr.comp.: Add some caching to Predecessors construction.

This speeds up the "serialize dep graph" pass for libsyntax from 45 secs to 15 secs on my machine. Still far from ideal, but things will get better when we change the metadata hashing strategy.

The `CACHING_THRESHOLD` value of 60 has been arrived at experimentally. It seemed to give the best speedup.

r? @nikomatsakis

7 years agoAuto merge of #38992 - nagisa:i128-minvallit, r=eddyb
bors [Sat, 14 Jan 2017 19:47:23 +0000 (19:47 +0000)]
Auto merge of #38992 - nagisa:i128-minvallit, r=eddyb

Fix two const-eval issues related to i128 negation

First issue here was the fact that we’d only allow negating integers in i64 range in case the
integer was not infered yes. While this is not the direct cause of the issue, its still good to fix
it.

The real issue here is the code handling specifically the `min_value` literals. While I128_OVERFLOW
has the expected value (0x8000_..._0000), match using this value as a pattern is handled
incorrectly by the stage1 compiler (it seems to be handled correctly, by the stage2 compiler). So
what we do here is extract this pattern into an explicit `==` until the next snapshot.

Fixes #38987

7 years agoadd required imports & feature
Djzin [Sat, 14 Jan 2017 17:40:52 +0000 (17:40 +0000)]
add required imports & feature

7 years agoAuto merge of #38982 - clarcharr:expect_err, r=aturon
bors [Sat, 14 Jan 2017 17:33:46 +0000 (17:33 +0000)]
Auto merge of #38982 - clarcharr:expect_err, r=aturon

expect_err for Result.

This adds an `expect_err` method to `Result`. Considering how `unwrap_err` already exists, this seems to make sense. Inconsistency noted in Manishearth/rust-clippy#1435.

7 years agoupdate array_vec to use new rangeargument
djzin [Sat, 14 Jan 2017 17:06:00 +0000 (17:06 +0000)]
update array_vec to use new rangeargument

7 years agoupdate docs with new syntax
djzin [Tue, 27 Dec 2016 15:37:36 +0000 (15:37 +0000)]
update docs with new syntax

7 years agoupdate docs with new syntax
djzin [Tue, 27 Dec 2016 15:28:58 +0000 (15:28 +0000)]
update docs with new syntax

7 years agofix warnings in doctests
djzin [Tue, 27 Dec 2016 15:27:18 +0000 (15:27 +0000)]
fix warnings in doctests

7 years agoshorten range syntax
djzin [Tue, 27 Dec 2016 11:35:56 +0000 (11:35 +0000)]
shorten range syntax

7 years agomake rangeargument methods non-default; simplify impl
djzin [Tue, 27 Dec 2016 10:22:17 +0000 (10:22 +0000)]
make rangeargument methods non-default; simplify impl

7 years agosimplify some ranges
djzin [Tue, 27 Dec 2016 10:05:49 +0000 (10:05 +0000)]
simplify some ranges

7 years agofix failing test
djzin [Mon, 26 Dec 2016 11:44:23 +0000 (11:44 +0000)]
fix failing test

7 years agoadd type annotations to doctest
djzin [Sun, 25 Dec 2016 09:37:35 +0000 (09:37 +0000)]
add type annotations to doctest

7 years agoadd test for range_mut
djzin [Sat, 24 Dec 2016 23:46:00 +0000 (23:46 +0000)]
add test for range_mut

7 years agouse str range for string btreemap in test
djzin [Sat, 24 Dec 2016 23:45:30 +0000 (23:45 +0000)]
use str range for string btreemap in test

7 years agouse rangeargument for range_mut
djzin [Sat, 24 Dec 2016 23:10:00 +0000 (23:10 +0000)]
use rangeargument for range_mut

7 years agoallow unsized types in `RangeArgument`
djzin [Sat, 24 Dec 2016 16:18:24 +0000 (16:18 +0000)]
allow unsized types in `RangeArgument`

7 years agofix up tests
djzin [Sat, 24 Dec 2016 16:17:22 +0000 (16:17 +0000)]
fix up tests

7 years agofix up tests
djzin [Fri, 23 Dec 2016 23:51:32 +0000 (23:51 +0000)]
fix up tests

7 years agochange argument for btree_range
djzin [Fri, 23 Dec 2016 23:51:00 +0000 (23:51 +0000)]
change argument for btree_range

7 years agoimpl RangeArgument for (Bound<T>, Bound<T>)
djzin [Fri, 23 Dec 2016 21:19:21 +0000 (21:19 +0000)]
impl RangeArgument for (Bound<T>, Bound<T>)

7 years agohave RangeArgument return a Bound<&T> from each of its methods
djzin [Fri, 23 Dec 2016 19:15:56 +0000 (19:15 +0000)]
have RangeArgument return a Bound<&T> from each of its methods

7 years agoAuto merge of #38952 - nrc:save-impl-fix, r=eddyb
bors [Sat, 14 Jan 2017 15:28:11 +0000 (15:28 +0000)]
Auto merge of #38952 - nrc:save-impl-fix, r=eddyb

save-analysis: handle paths in type/trait context more correctly

TBH, this is still not perfect, witness the FIXME, but it is an improvement. In particular it means we get information about trait references in impls.

7 years agoFix covered-switch-default warnings in RustWrapper
Ruud van Asseldonk [Sat, 14 Jan 2017 14:38:12 +0000 (15:38 +0100)]
Fix covered-switch-default warnings in RustWrapper

These switch statements cover all possible values, so the default case
is dead code (it contains an llvm_unreachable anyway), triggering a
-Wcovered-switch-default warning. Moving the unreachable after the
switch resolves these warnings. This keeps the build output clean.

7 years agoAuto merge of #38944 - michaelwoerister:incr-generics-partitioning, r=nikomatsakis
bors [Sat, 14 Jan 2017 13:17:16 +0000 (13:17 +0000)]
Auto merge of #38944 - michaelwoerister:incr-generics-partitioning, r=nikomatsakis

trans: Treat generics like regular functions, not like #[inline] function, during CGU partitioning

This PR makes generics be treated just like regular functions during CGU partitioning:

+ the function instantiation is placed in a codegen unit based on the function's DefPath,
+ unless it is marked with `#[inline]`  -- which causes a private copy of the function to be placed in every referencing codegen unit.

This has the following effects:
+ Multi codegen unit builds will become faster because code for generic functions is duplicated less.
+ Multi codegen unit builds might have lower runtime performance, since generics are not available for inlining automatically any more.
+ Single codegen unit builds are not affected one way or the other.

This partitioning scheme is particularly good for incremental compilation as it drastically reduces the number of false positives during codegen unit invalidation.

I'd love to have a benchmark suite for estimating the effect on runtime performance for changes like this one.

r? @nikomatsakis

cc @rust-lang/compiler

7 years agoAuto merge of #38935 - redox-os:fix_path_redox, r=brson
bors [Sat, 14 Jan 2017 11:03:25 +0000 (11:03 +0000)]
Auto merge of #38935 - redox-os:fix_path_redox, r=brson

Fix is_absolute on Redox

Due to not using prefixes on Redox, yet, it must be added as an exception to Path::is_absolute.

7 years agoAuto merge of #38927 - petrochenkov:leven, r=jseyfried
bors [Sat, 14 Jan 2017 08:48:28 +0000 (08:48 +0000)]
Auto merge of #38927 - petrochenkov:leven, r=jseyfried

resolve: Levenshtein-based suggestions for non-import paths

This patch addresses both items from https://github.com/rust-lang/rust/issues/30197#issuecomment-264846000 and therefore implements the largest part of https://github.com/rust-lang/rust/issues/30197.

r? @jseyfried

7 years agoAuto merge of #38914 - est31:tidy-gate-tests, r=nikomatsakis
bors [Sat, 14 Jan 2017 06:43:03 +0000 (06:43 +0000)]
Auto merge of #38914 - est31:tidy-gate-tests, r=nikomatsakis

Make tidy check for lang gate tests

Add gate tests to the checks that tidy performs. Excerpt from the commit message of the main commit:

    Require compile-fail tests for new lang features

    Its non trivial to test lang feature gates, and people
    forget to add such tests. So we extend the features lint
    of the tidy tool to ensure that all new lang features
    contain a new compile-fail test.

    Of course, one could drop this requirement and just
    grep all tests in run-pass for #![feature(abc)] and
    then run this test again, removing the mention,
    requiring that it fails.

    But this only tests for the existence of a compilation
    failure. Manual tests ensure that also the correct lines
    spawn the error, and also test the actual error message.

    For library features, it makes no sense to require such
    a test, as here code is used that is generic for all
    library features.

The tidy lint extension now checks the compile-fail test suite for occurences of "gate-test-X" where X is a feature. Alternatively, it also accepts file names with the form "feature-gate-X.rs". If a lang feature is found that has no such check, we emit a tidy error.

I've applied the markings to all tests I could find in the test suite. I left a small (20 elements) whitelist of features that right now have no gate test, or where I couldn't find one. Once this PR gets merged, I'd like to close issue #22820 and open a new one on suggestion of @nikomatsakis to track the removal of all elements from that whitelist (already have a draft). Writing such a small test can be a good opportunity for a first contribution, so I won't touch it (let others have the fun xD).

cc @brson , @pnkfelix (they both discussed about this in the issue linked above).

7 years agoAuto merge of #39021 - alexcrichton:try-debug-travis, r=brson
bors [Sat, 14 Jan 2017 04:29:44 +0000 (04:29 +0000)]
Auto merge of #39021 - alexcrichton:try-debug-travis, r=brson

travis: Attempt to debug OSX linker segfaults

This commit attempts to debug the segfaults that we've been seeing on OSX on
Travis. I have no idea what's going on here mostly, but let's try to look at
core dumps and get backtraces to see what's going on. This commit itself is
mostly a complete shot in the dark, I'm not sure if this even works...

cc #38878

7 years agoIf submodule init fails, try from scratch
Aidan Hobson Sayers [Sat, 14 Jan 2017 03:10:45 +0000 (03:10 +0000)]
If submodule init fails, try from scratch

7 years agoAuto merge of #38854 - Mark-Simulacrum:immediate-refactor, r=eddyb
bors [Sat, 14 Jan 2017 02:18:04 +0000 (02:18 +0000)]
Auto merge of #38854 - Mark-Simulacrum:immediate-refactor, r=eddyb

Simplify type_is_immediate and type_is_fat_ptr

r? @eddyb

7 years agoAuto merge of #39030 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Fri, 13 Jan 2017 23:56:11 +0000 (23:56 +0000)]
Auto merge of #39030 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 10 pull requests

- Successful merges: #38362, #38636, #38877, #38946, #38965, #38986, #38994, #38995, #39024, #39027
- Failed merges:

7 years agoAvoid using load/stores on first class aggregates
Björn Steinbrink [Sat, 7 Jan 2017 18:06:28 +0000 (11:06 -0700)]
Avoid using load/stores on first class aggregates

LLVM usually prefers using memcpys over direct loads/store of first
class aggregates. The check in type_is_immediate to mark certain small
structs was originally part of the code to handle such immediates in
function arguments, and it had a counterpart in load_ty/store_ty to
actually convert small aggregates to integers.

But since then, the ABI handling has been refactored and takes care of
converting small aggregates to integers. During that refactoring, the
code to handle small aggregates in load_ty/store_ty has been removed,
and so we accidentally started using loads/stores on FCA values.

Since type_is_immediate() is no longer responsible for ABI-related
conversions, and using a memcpy even for small aggregates is usually
better than performing a FCA load/store, we can remove that code part
and only handle simple types as immediates there.

This integrates PR #38906 onto this branch.

Fixes #38906.

7 years agorustbuild: Skip the build_helper crate in tests
Alex Crichton [Fri, 13 Jan 2017 23:11:34 +0000 (15:11 -0800)]
rustbuild: Skip the build_helper crate in tests

I've been noticing some spurious recompiles of the final stage on Travis lately
and in debugging them I found a case where we were a little to eager to update
a stamp file due to the build_helper library being introduced during the testing
phase.

Part of the rustbuild system detects when libstd is recompiled and automatically
cleans out future directories to ensure that dirtyness propagation works. To do
this rustbuild doesn't know the artifact name of the standard library so it just
probes everything in the target directory, looking to see if anything changed.

The problem here happened where:

* First, rustbuild would compile everything (a normal build)
* Next, rustbuild would run all tests
* During testing, the libbuild_helper library was introduced into the target
  directory, making it look like a change happened because a file is newer
  than the newest was before
* Detecting a change, the next compilation would then cause rustbuild to clean
  out old artifacts and recompile everything again.

This commit fixes this problem by correcting rustbuild to just not test the
build_helper crate at all. This crate doesn't have any unit tests, nor is it
intended to. That way the target directories should stay the same throughout
testing after a previous build.

7 years agoAdd try_wait to Redox process
Jeremy Soller [Fri, 13 Jan 2017 22:41:50 +0000 (15:41 -0700)]
Add try_wait to Redox process

7 years agoFix is_absolute on Redox
Jeremy Soller [Mon, 9 Jan 2017 00:43:30 +0000 (17:43 -0700)]
Fix is_absolute on Redox

7 years agoexpect_err for Result.
Clar Charr [Wed, 11 Jan 2017 03:17:47 +0000 (22:17 -0500)]
expect_err for Result.