Commit Graph

63369 Commits

Author SHA1 Message Date
bors
4ed95009d8 Auto merge of #41245 - estebank:multiline-trim, r=nikomatsakis
Reduce visual clutter of multiline start when possible

When a span starts on a line with nothing but whitespace to the left,
and there are no other annotations in that line, simplify the visual
representation of the span.

Go from:

```rust
error[E0072]: recursive type `A` has infinite size
 --> file2.rs:1:1
  |
1 |   struct A {
  |  _^ starting here...
2 | |     a: A,
3 | | }
  | |_^ ...ending here: recursive type has infinite size
  |
```

To:

```rust
error[E0072]: recursive type `A` has infinite size
 --> file2.rs:1:1
  |
1 | / struct A {
2 | |     a: A,
3 | | }
  | |_^ recursive type has infinite size
```

Re: #38246.

r? @nikomatsakis CC @jonathandturner
2017-04-21 06:59:25 +00:00
Esteban Küber
cc07c357e4 Reduce visual clutter of multiline start when possible
When a span starts on a line with nothing but whitespace to the left,
and there are no other annotations in that line, simplify the visual
representation of the span.

Go from:

```rust
error[E0072]: recursive type `A` has infinite size
 --> file2.rs:1:1
  |
1 |   struct A {
  |  _^ starting here...
2 | |     a: A,
3 | | }
  | |_^ ...ending here: recursive type has infinite size
  |
```

To:

```rust
error[E0072]: recursive type `A` has infinite size
 --> file2.rs:1:1
  |
1 | / struct A {
2 | |     a: A,
3 | | }
  | |_^ recursive type has infinite size
```

Remove `starting here...`/`...ending here` labels from all multiline
diagnostics.
2017-04-20 17:31:20 -07:00
bors
535ee6c7f0 Auto merge of #41342 - GuillaumeGomez:btree-debug-infinite, r=alexcrichton
Fix debug infinite loop

Fixes #41338.
2017-04-20 23:40:06 +00:00
bors
ddc5d7bd4b Auto merge of #41424 - frewsxcv:rollup, r=frewsxcv
Rollup of 2 pull requests

- Successful merges: #40812, #40987
- Failed merges:
2017-04-20 17:33:58 +00:00
Corey Farwell
9d918223a8 Rollup merge of #40987 - maccoda:convert-docs, r=steveklabnik
API docs: Convert

Clean up of the convert module documentation following points in #29349
2017-04-20 13:33:13 -04:00
Corey Farwell
83e22b8b24 Rollup merge of #40812 - mgattozzi:ChildDocs, r=steveklabnik
Update `Child` docs to not have a note section

In #29370 it's noted that for "the Note shouldn't be one, and should come before
the examples." This commit changes the positioning of the section and removes
wording that said take note in order for it to flow better with the surrounding
text and it's new position.
2017-04-20 13:33:12 -04:00
bors
968ae7babe Auto merge of #41191 - seanmonstar:spec-extend-vec-intoiter, r=alexcrichton
specialize Extend for Vec with IntoIter

Before, `vec.extend(&other_vec)` was quite a bit faster than `vec.extend(other_vec)`. This allows extending by consuming a vec to use the same code as extending from a slice.
2017-04-20 13:08:07 +00:00
bors
fa6b50fc62 Auto merge of #41413 - frewsxcv:rollup, r=frewsxcv
Rollup of 5 pull requests

- Successful merges: #41214, #41369, #41377, #41378, #41390
- Failed merges:
2017-04-20 06:28:16 +00:00
Corey Farwell
204243fcac Rollup merge of #41390 - scottmcm:toowned-clone-into, r=alexcrichton
Override ToOwned::clone_into for Path and OsStr

The only non-overridden one remaining is the CStr impl, which cannot
be optimized as doing so would break CString's second invariant.

Follow-up to 7ec27ae (PR #41009).

r? @alexcrichton
2017-04-20 01:39:56 -04:00
Corey Farwell
1b7e6c3898 Rollup merge of #41378 - eddyb:byval-is-not-like-sret, r=arielb1
rustc_trans: do not treat byval as using up registers.

Perhaps not that well-documented, `byval` pointer arguments *are not* the same as pointer arguments used by pass-by-ref, but rather the pointer is only used by LLVM to pass the *contents* on the stack.

Fixes #41375.
2017-04-20 01:39:56 -04:00
Corey Farwell
348d66c73f Rollup merge of #41377 - nikomatsakis:issue-41298-ICE-inference, r=eddyb
Fix ICE building gluon_vm

The problem was due to various places we were failing to propagate obligations. I think I got them mostly correct, but I didn't get around to writing test cases for each case.

r? @eddyb or @arielb1
2017-04-20 01:39:55 -04:00
Corey Farwell
1987fc1019 Rollup merge of #41369 - cuviper:arm-stage0, r=alexcrichton
Bump stage0 to fix ARM LLVM

There was a serious ARM codegen bug in LLVM that was fixed by #40779,
also backported to beta.  This updates stage0 to 1.17.0-beta.3 to pick
up that change, so ARM can bootstrap natively again.

Fixes #41291
cc @arielb1
2017-04-20 01:39:54 -04:00
Corey Farwell
236978e411 Rollup merge of #41214 - estebank:less-multiline, r=petrochenkov
Add a way to get shorter spans until `char` for pointing at defs

```rust
error[E0072]: recursive type `X` has infinite size
  --> file.rs:10:1
   |
10 | struct X {
   | ^^^^^^^^ recursive type has infinite size
   |
   = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `X` representable
```

vs

```rust
error[E0072]: recursive type `X` has infinite size
  --> file.rs:10:1
   |
10 |   struct X {
   |  _^ starting here...
11 | |     x: X,
12 | | }
   | |_^ ...ending here: recursive type has infinite size
   |
   = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `X` representable
```

Re: #35965,  #38246. Follow up to #38328.

r? @jonathandturner
2017-04-20 01:39:53 -04:00
bors
1bb1530239 Auto merge of #41411 - frewsxcv:rollup, r=frewsxcv
Rollup of 7 pull requests

- Successful merges: #41295, #41348, #41374, #41380, #41391, #41398, #41403
- Failed merges: #41376
2017-04-20 01:56:59 +00:00
Corey Farwell
1c69895f86 Rollup merge of #41403 - mbrickn:patch-1, r=petrochenkov
Updated links to use https

I just updated a few links to use https instead of http.

Thank you! 😄
2017-04-19 21:55:42 -04:00
Corey Farwell
7b5ec6c07e Rollup merge of #41398 - aidanhs:aphs-no-git-caches-again, r=alexcrichton
Disable git caches again

The appveyor ones aren't working anyway (I need to talk to appveyor about them being corrupt) and the travis cache is taking too long to restore and is being killed, which is sometimes causing bad things to happen because the integrity checking made assumptions that restore was atomic.

I could fix the integrity checks, but we clearly need a different approach if restore is taking too long. Let's disable it all for now.
2017-04-19 21:55:41 -04:00
Corey Farwell
80fa79821a Rollup merge of #41391 - durka:patch-40, r=petrochenkov
remove disclaimer from bootstrap/README.md
2017-04-19 21:55:40 -04:00
Corey Farwell
16710bea14 Rollup merge of #41380 - ollie27:stability, r=BurntSushi
Fix a few stability attributes

These show up in rustdoc so need to be correct.
2017-04-19 21:55:39 -04:00
Corey Farwell
5eab9ba471 Rollup merge of #41374 - steveklabnik:update-mdbook, r=frewsxcv
update mdbook

Ship some more improvements.

r? @rust-lang/docs
2017-04-19 21:55:38 -04:00
Corey Farwell
e1168da5e3 Rollup merge of #41348 - lukaramu:std-path-docs, r=frewsxcv
Improve std::path docs

Fixes #29368.

This PR contains a pretty significant redistribution of some of the module docs to more appropriate places, as well as general expansion, clarification, and additional examples.

For more details, see the commit descriptions.

r? @steveklabnik
2017-04-19 21:55:37 -04:00
Corey Farwell
a97309d8c8 Rollup merge of #41295 - frewsxcv:frewsxcxv-unstability, r=steveklabnik
Add top level sections to the Unstable Book.

Prior to this commit, the contents of the Unstable Book were assumed to
be unstable features. This commit moves features into 'language features'
or 'library features' subsections. It also moves the 'linker_flavor'
compiler flag into a new 'Compiler Flags' subsection.

Even though it was helpful, I removed the tidy check that
cross-references the SUMMARY.md links with the Unstable Book directory
contents just because it would be difficult to maintain.

Relevant PR: https://github.com/rust-lang/rust/issues/41142.
2017-04-19 21:55:36 -04:00
Maxwell Paul Brickner
f7e9041cd2 Updated links to use https
I just updated a few links to use https instead of http. 

Thank you! ^ _ ^
2017-04-19 17:45:48 -04:00
Sean McArthur
f85a5337ab specialize Extend for Vec with IntoIter 2017-04-19 11:57:29 -07:00
Michael Gattozzi
df383b9547
Fix link for wait 2017-04-19 14:00:50 -04:00
Guillaume Gomez
a850cdcb7e Fix debug infinite loop 2017-04-19 18:50:01 +02:00
Corey Farwell
2e2a670073 Remove platform-specific directory separator. 2017-04-19 12:42:07 -04:00
Aidan Hobson Sayers
24640b306e Disable git caches again 2017-04-19 16:29:47 +01:00
Niko Matsakis
93e10977d8 propagate other obligations that were left out
cc #32730 -- I left exactly one instance where I wasn't sure of the
right behavior.
2017-04-19 07:20:36 -04:00
Niko Matsakis
aa6c2b1cb7 propagate obligations during overlap check 2017-04-19 07:20:36 -04:00
bors
452bf0852e Auto merge of #41354 - alexcrichton:tool-no-debug, r=aturon
Disable debuginfo when compiling tools

Currently the Cargo binary has jumped from 14M to 34M on the beta channel, which
appears to be due to the fact that we're compiling tools with debug information
inside them. This additionally means that the `rls` binary is 62M right now!

This wasn't an intentional change, so be sure to disable debuginfo when
compiling tools as it's just intended for the standard library and compile for
now.
2017-04-19 11:07:08 +00:00
bors
467aaab50e Auto merge of #41325 - eddyb:isolate-snapshots-for-good, r=arielb1
Ban registering obligations during InferCtxt snapshots.

Back in #33852, a flag was added to `InferCtxt` to prevent rolling back a snapshot if obligations were added to some `FulfillmentContext` during the snapshot, to prevent leaking fresh inference variables (created during that snapshot, so their indices would get reused) in obligations, which could ICE or worse.

But that isn't enough in the long run, as type-checking ends up relying on success implying that eager side-effects are fine, and while stray obligations *do* get caught nowadays, those errors prevent, e.g. the speculative coercions from #37658, which *have to* be rolled back *even* if they succeed.

We can't just allow those obligations to stay around though, because we end up, again, in ICEs or worse.
Instead, this PR modifies `lookup_method_in_trait_adjusted` to return `InferOk` containing the obligations that `Autoderef::finalize_as_infer_ok` can propagate to deref coercions.

As there shouldn't be *anything* left that registers obligations during snapshots, it's completely banned.

r? @nikomatsakis @arielb1
2017-04-19 08:40:27 +00:00
bors
5f22d46e4b Auto merge of #41170 - Nashenas88:master, r=alexcrichton
Use the existing path when removing the prefix fails

This allows the use of out-of-tree paths to be specified. I found this while trying to build with a modified version of `rls-data`, which is currently pointing to a version on crates.io.

cc @alexcrichton

Also, it wasn't clear if I needed to add a test for this (or how). I didn't see any tests that took paths into consideration.
2017-04-19 05:54:23 +00:00
Alex Burka
d6b8d9f75d remove disclaimer from bootstrap/README.md 2017-04-19 01:45:34 -04:00
Scott McMurray
295bcdb715 Override ToOwned::clone_into for Path and OsStr
The only non-overridden one remaining is the CStr impl, which cannot
be optimized as doing so would break CString's second invariant.
2017-04-18 21:02:18 -07:00
bors
84be2df0e9 Auto merge of #41236 - cengizIO:master, r=nikomatsakis
Move E0101 and E0102 logic into new E0282 mechanism #40013

Hello there!

## What's this?
Previously, me and @nikomatsakis worked on error messages of uninferred locals. (#38812)

This aims to build up on that by moving certain type checks from `writeback`.

With this, `E0101` and `E0102` errors are getting obsoleted and no longer thrown.

They're replaced with customized versions of `E0282`s instead.

## Sample Error Messages

#### `E0101` is getting converted into:
```rust
error[E0282]: type annotations needed
 --> test.rs:2:14
  |
2 |     let x = |_| {};
  |              ^ consider giving this closure parameter a type

error: aborting due to previous error
```

#### `E0102` is getting converted into:
```rust
error[E0282]: type annotations needed
 --> test.rs:2:9
  |
2 |     let x = [];
  |         ^
  |         |
  |         consider giving `x` a type
  |         cannot infer type for `[_; 0]`

error: aborting due to previous error
```

## Annoyances
- I think we need to change our way of type name resolving in relevant places, because that `[_; 0]` looks horrible IMHO.
- I'm not terribly happy with the note ordering of errors. So please do point to code that might help me accomplish this.

## Tests
Tests of `E0101` and `E0102` are getting converted from `compile-fail` to `ui` tests.

## Documentation
Please help me with documentation update. There are some confusing places that needed an update but I'm not sure if I did the right ones.

Please do comment on messages, layouts and other details.

## Appreciation
Huge thanks goes to @nikomatsakis for being a patient and humble mentor along this long journey. 🍻
2017-04-19 01:27:08 +00:00
Corey Farwell
bf202c880c Bump book and reference. 2017-04-18 21:26:10 -04:00
Corey Farwell
fea3576633 Add top level sections to the Unstable Book.
Prior to this commit, the contents of the Unstable Book were assumed to
be unstable features. This commit moves features into 'language features'
or 'library features' subsections. It also moves the 'linker_flavor'
compiler flag into a new 'Compiler Flags' subsection.

Even though it was helpful, I removed the tidy check that
cross-references the SUMMARY.md links with the Unstable Book directory
contents just because it would be difficult to maintain.

Relevant PR: https://github.com/rust-lang/rust/issues/41142.
2017-04-18 21:26:09 -04:00
Eduard-Mihai Burtescu
cba0c6ad6d rustc_trans: do not treat byval as using up registers. 2017-04-19 02:22:59 +03:00
Oliver Middleton
fd325a1b48 Fix a few stability attributes
These show up in rustdoc so need to be correct.
2017-04-18 23:33:38 +01:00
Cengiz Can
3092ac40b6 change note for patterns 2017-04-18 21:43:22 +03:00
Cengiz Can
8b45a21bd1 comment out removed error codes 2017-04-18 21:43:22 +03:00
Cengiz Can
6383de15b1 fixes #40013 2017-04-18 21:43:22 +03:00
bors
9f2abadca2 Auto merge of #41373 - frewsxcv:rollup, r=frewsxcv
Rollup of 6 pull requests

- Successful merges: #40290, #41353, #41356, #41360, #41361, #41364
- Failed merges:
2017-04-18 18:20:04 +00:00
Corey Farwell
20718c81de Rollup merge of #41364 - alexcrichton:less-backtrace-prune, r=petrochenkov
std: Back out backtrace pruning logic

It was discovered #40264 that this backtrace pruning logic is a little too
aggressive, so while we figure how out to handle #40264 this commit backs out
the changes to prune frames. Note that other cosmetic changes, such as better
path printing and such remain.
2017-04-18 14:05:46 -04:00
Corey Farwell
f448cdff9d Rollup merge of #41361 - arielb1:move-mir-init, r=pnkfelix
lower `move_val_init` during MIR construction

Because of its "magic" order-of-evaluation semantics, `move_val_init` must be lowered during MIR construction in order to work without needing a temporary.

r? @eddyb
2017-04-18 14:05:45 -04:00
Corey Farwell
ceaa55ea45 Rollup merge of #41360 - nikomatsakis:incr-comp-issue-40746-visitors, r=eddyb
convert calls to `visit_all_item_likes_in_krate`

We no longer need to track the tasks in these cases since these
particular tasks have no outputs (except, potentially, errors...)  and
they always execute.

cc #40746

r? @eddyb
2017-04-18 14:05:44 -04:00
Corey Farwell
ddf4781c1b Rollup merge of #41356 - richo:darwin-no-cputype-hack, r=alexcrichton
bootstrap: Don't workaround uname -m on Darwin

This no longer manifests on any versions of OSX that I could find.

How far back is Rust officially supported? I can try to get copies to test when this behaviour changed.

(Fun fact, at a minimum the comment already lies, since the flag is `-m` :))
2017-04-18 14:05:44 -04:00
Corey Farwell
2e4b0d57ac Rollup merge of #41353 - redox-os:master, r=alexcrichton
Improve Process::spawn with piped stdio on Redox

- Adds `dup2`, and uses it for stdio piping
- Removes `O_CLOEXEC` from piped stdio, as `dup` on Redox does not disable O_CLOEXEC
2017-04-18 14:05:43 -04:00
Corey Farwell
353bdb30e3 Rollup merge of #40290 - 3Hren:master, r=aturon
Add `as_bytes()` for `FromUtf8Error`.

This change allows to obtain an underlying invalid UTF-8 bytes without `FromUtf8Error` destruction. Such method may be useful for example in a library that attempts to save both valid and invalid UTF-8 strings in some struct and to be able to provide immutable access to it without destruction.

Personally without this change I ended with `Result<String, (Vec<u8>, Utf8Error)`, which almost copies the functionality of `FromUtf8Error`, but allows immutable view access.
2017-04-18 14:05:42 -04:00
Josh Stone
0a69bf4cdd Bump stage0 to fix ARM LLVM
There was a serious ARM codegen bug in LLVM that was fixed by #40779,
also backported to beta.  This updates stage0 to 1.17.0-beta.3 to pick
up that change, so ARM can bootstrap natively again.

Fixes #41291
cc @arielb1
2017-04-18 08:57:56 -07:00