Commit Graph

63887 Commits

Author SHA1 Message Date
Alexis Beingessner
e8234e0e47 update to latest nomicon 2017-05-04 23:54:55 -04:00
Alexis Beingessner
c7cffc5f4e Deprecate heap::EMPTY in favour of Unique::empty or otherwise. 2017-05-04 23:54:54 -04:00
Alexis Beingessner
4ff583b116 fallout from NonZero/Unique/Shared changes 2017-05-04 23:54:54 -04:00
Corey Farwell
ed1b78c16b Move unicode Python script into libstd_unicode crate.
The only place this Python script is used is inside the libstd_unicode
crate, so lets move it there.
2017-05-04 22:37:55 -04:00
Esteban Küber
f7108e18cd Only point at the fields that cause infinite size
* clean up code
* point only fields that cause the type to be of infinite size
* fix unittests
2017-05-04 19:11:59 -07:00
Esteban Küber
ed6ad0952f Point at fields that make the type recursive
On recursive types of infinite size, point at all the fields that make
the type recursive.

```rust
struct Foo {
    bar: Bar,
}

struct Bar {
    foo: Foo,
}
```

outputs

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

error[E0072]: recursive type `Bar` has infinite size
 --> file.rs:5:1
  |
5 |   struct Bar {
  |  _^ starting here...
6 | |     foo: Foo,
  | |     -------- recursive here
7 | | }
  | |_^ ...ending here: recursive type has infinite size
  |
  = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Bar` representable
```
2017-05-04 19:11:58 -07:00
Corey Farwell
3cd7f37482 Rollup merge of #41754 - nikomatsakis:incr-comp-cleanup-cell, r=arielb1
kill some unused fields in TyCtxt
2017-05-04 21:35:31 -04:00
Corey Farwell
9659c806b8 Rollup merge of #41749 - frewsxcv:option-simplify-types, r=GuillaumeGomez
Simplify types in `std::option` doc comment example.

None
2017-05-04 21:35:30 -04:00
Corey Farwell
a9b0b5e4c3 Rollup merge of #41746 - tommyip:master, r=petrochenkov
Remove use of `Self: Sized` from libsyntax

The bound is not required for compiling but it prevents using `next_token()` from a trait object.

Fixes #33506.
2017-05-04 21:35:29 -04:00
Corey Farwell
63e477d51d Rollup merge of #41741 - rap2hpoutre:patch-3, r=steveklabnik
join method returns a thread::Result

Join method returns a std:🧵:Result, not a std::result::Result: https://doc.rust-lang.org/std/thread/struct.JoinHandle.html#method.join Maybe I misunderstood something.

I have seen this mistake(?) because I wanted to tackle this issue https://github.com/rust-lang/rust/issues/29378 (about Result). It's still one of my first PR. Sorry if I missed something.
2017-05-04 21:35:28 -04:00
bors
50b9858718 Auto merge of #41751 - alexcrichton:unstable-flags, r=eddyb
rustc: Forbid `-Z` flags on stable/beta channels

First deprecated in rustc 1.8.0 the intention was to never allow `-Z` flags make
their way to the stable channel (or unstable options). After a year of warnings
we've seen one of the main use cases, `-Z no-trans`, stabilized as `cargo
check`. Otherwise while other use cases remain the sentiment is that now's the
time to start forbidding `-Z` by default on stable/beta.

Closes #31847
2017-05-05 01:00:13 +00:00
Andy Russell
4c1a5054f0
add regression test for issue #24106
Fixes #24106.
2017-05-04 19:34:48 -04:00
Alexis Beingessner
6e2efe3aa4 refactor NonZero, Shared, and Unique APIs
Major difference is that I removed Deref impls, as apparently LLVM has
trouble maintaining metadata with a `&ptr -> &ptr` API. This was cited
as a blocker for ever stabilizing this API. It wasn't that ergonomic
anyway.

* Added `get` to NonZero to replace Deref impl
* Added `as_ptr` to Shared/Unique to replace Deref impl
* Added Unique's `as_ref` and `as_mut` conveniences to Shared
* Added `::empty()` convenience constructor for Unique/Shared
* Deprecated `as_mut_ptr` on Shared in favour of `as_ptr`
* Improved documentation of types

Note that Shared now only refers to *mut, and not *const
2017-05-04 14:56:02 -04:00
bors
59f1a2f948 Auto merge of #41739 - TimNN:update-llvm, r=aturon
Update llvm to pull in various backports

Fixes #41672
Fixes #41630
Fixes #41685
2017-05-04 18:46:17 +00:00
Alex Crichton
ccbcc720a6 rustc: Forbid -Z flags on stable/beta channels
First deprecated in rustc 1.8.0 the intention was to never allow `-Z` flags make
their way to the stable channel (or unstable options). After a year of warnings
we've seen one of the main use cases, `-Z no-trans`, stabilized as `cargo
check`. Otherwise while other use cases remain the sentiment is that now's the
time to start forbidding `-Z` by default on stable/beta.

Closes #31847
2017-05-04 11:04:20 -07:00
Niko Matsakis
0f6d4ac88d kill some unused fields in TyCtxt 2017-05-04 13:14:24 -04:00
Corey Farwell
7b94d6cf19 Simplify types in std::option doc comment example. 2017-05-04 11:53:24 -04:00
bors
838e9c5123 Auto merge of #41268 - mmatyas:test_on_device, r=alexcrichton
Run non-native tests on real device

After #40733, I've made some hacks to the QEMU client-server tools to allow running the tests on a real device when cross compiling Rust. The address and port of the remote server can be set using an environment variable.

I've made this mainly for local testing purposes, if you're interested in merging this, I'd clean it a bit more (eg. renaming the functions from `qemu-` to something else). I'm not asking for CI integration or adding ARM boards to the build system; it's just that I used these modifications and I was wondering if you'd find them useful too.
2017-05-04 14:50:33 +00:00
Tommy Ip
05329e5780 Remove use of Self: Sized from libsyntax
The bound is not required for compiling but it prevents using `next_token()` from a trait object.

Fixes #33506.
2017-05-04 13:19:36 +01:00
Raphaël Huchet
93e179a8c1 Update mod.rs 2017-05-04 14:04:03 +02:00
bors
222971f7d2 Auto merge of #41687 - rillian:no-elf-tls, r=aturon
Remove obsolete --disable-elf-tls configure switch.

Support for disabling ELF-style thread local storage in
the standard library at configure time was removed in
pulls #30417 and #30678, in favour of a member in
the TargetOptions database. The new mentod respects
MACOSX_DEPLOYMENT_TARGET on macOS, addressing the
original use case for this configure optionl

However, those commits left the configure option itself
in place. It's no longer referenced anywhere and can
be removed.
2017-05-04 11:51:34 +00:00
Mátyás Mustoha
b194def3a2 Add remote device testing support 2017-05-04 12:43:22 +02:00
Raphaël Huchet
3a07155a9d create link to Result 2017-05-04 11:33:26 +02:00
bors
ac46091e82 Auto merge of #41733 - nikomatsakis:incr-comp-remove-ast-ty-to-ty-cache, r=eddyb
Remove ast-ty-to-ty cache

As discussed on IRC, this basically just removes the cache, and rewrites rustdoc and save-analysis so call into the astconv code. It *might* make sense for this to be a more fine-grained query, but that would (at least) require us to be using `HirId` and not `NodeId`.

(Perhaps I should open a FIXME?)

I didn't measure perf impact (yet?). I did observe that the cache seems to hit *rarely* -- and only in between items (I experimented with a cache "per def-id", but that had zero hits). In other words, every single hit on the cache is a dependency bug, since it is "shuttling" information between items without dependency edges.

r? @eddyb
2017-05-04 09:15:23 +00:00
Raphaël Huchet
a3998ad6e5 Join method returns a thread::Result 2017-05-04 11:11:14 +02:00
Tim Neumann
16ad2c8fad Update llvm to pull in various backports 2017-05-04 08:12:17 +02:00
Niko Matsakis
3f2dd4d24a remove ast_ty_to_ty_cache entirely 2017-05-03 21:33:17 -04:00
Niko Matsakis
3039398c68 convert save-analysis to use ItemCtxt and not ast_ty_to_ty_cache 2017-05-03 21:33:15 -04:00
Niko Matsakis
196c98d314 remove use of ast_ty_to_ty_cache from librustdoc 2017-05-03 21:26:28 -04:00
Niko Matsakis
5efc86a838 expose a method for converting hir::Ty to Ty<'tcx>
Also, remove a lot of `pub` things from `librustc_typeck`.
2017-05-03 21:12:00 -04:00
bors
b16c7a235f Auto merge of #41735 - frewsxcv:rollup, r=frewsxcv
Rollup of 6 pull requests

- Successful merges: #41543, #41600, #41715, #41720, #41721, #41730
- Failed merges:
2017-05-03 23:05:07 +00:00
Corey Farwell
e20b282330 Rollup merge of #41730 - bholley:arc_comment, r=aturon
Document the reasoning for the Acquire/Release handshake when dropping Arcs.

Split out from #41714. r? @aturon
2017-05-03 18:34:04 -04:00
Corey Farwell
a7c8bd149a Rollup merge of #41721 - mgattozzi:stdin-stdout-update, r=steveklabnik
Update ChildStdin/ChildStdout docs to be clearer

This is part of https://github.com/rust-lang/rust/issues/29370 and continues the work from https://github.com/rust-lang/rust/pull/40829
2017-05-03 18:34:03 -04:00
Corey Farwell
3bfc72fba6 Rollup merge of #41720 - frewsxcv:duration-doc-examples, r=steveklabnik
Improvements to `std::time::Duration` doc examples.

Opened primarily for the last commit, in response to comments in https://github.com/rust-lang/rust/issues/39949.
2017-05-03 18:34:02 -04:00
Corey Farwell
e2cedb249f Rollup merge of #41715 - martinhath:master, r=aturon
Fix @martinhath's mailmap entry

I stumbled upon a name duplication issue in [rust-lang-nursery/thanks](https://github.com/rust-lang-nursery/thanks/), and realized that this problem is easily fixable. I've (hopefully) done the right thing here. It works locally (`git shortlog | grep "Thoresen"` only returns one entry instead of two).

I didn't bother creating an issue in the `thanks` repository, since I did the `.mailmap` editing myself.
2017-05-03 18:34:01 -04:00
Corey Farwell
10fde3393b Rollup merge of #41600 - ranma42:xz-dist, r=alexcrichton
Generate XZ-compressed tarballs

Integrate the new `rust-installer` and extend manifests with keys for xz-compressed tarballs.

One of the steps required for https://github.com/rust-lang/rust/issues/21724
2017-05-03 18:34:00 -04:00
Corey Farwell
9f06dfb451 Rollup merge of #41543 - z1mvader:master, r=steveklabnik
Rewrote the thread struct docs

https://github.com/rust-lang/rust/issues/29378
2017-05-03 18:33:59 -04:00
Niko Matsakis
79de56a14b remove pub modifier (and last use thereof) 2017-05-03 16:42:46 -04:00
Niko Matsakis
50df5f85d0 correct the new graphs resulting from various tests
(Now that variances are not part of signature.)
2017-05-03 16:42:07 -04:00
Niko Matsakis
e8f6fbb255 allow dep-graph assertions on fields 2017-05-03 16:42:07 -04:00
Niko Matsakis
3819ccda9c allow tests to refer to ItemVariances 2017-05-03 16:42:07 -04:00
Niko Matsakis
898f978c97 add back variance testing mechanism
make it work for traits etc uniformly
2017-05-03 16:42:07 -04:00
Niko Matsakis
4355169f8a kill the old visit_all_item_likes infrastructure 2017-05-03 16:42:07 -04:00
Niko Matsakis
4824a199ca factor variances into a proper query
There are now two queries: crate and item. The crate one computes the
variance of all items in the crate; it is sort of an implementation
detail, and not meant to be used. The item one reads from the crate one,
synthesizing correct deps in lieu of the red-green algorithm.

At the same time, remove the `variance_computed` flag, which was a
horrible hack used to force invariance early on (e.g. when type-checking
constants). This is only needed because of trait applications, and
traits are always invariant anyway. Therefore, we now change to take
advantage of the query system:

- When asked to compute variances for a trait, just return a vector
  saying 'all invariant'.
- Remove the corresponding "inferreds" from traits, and tweak the
  constraint generation code to understand that traits are always
  inferred.
2017-05-03 16:42:07 -04:00
Andrea Canciani
98dd82c013 Retry brew commands upon failure
Wrap the installation on macOS with `travis_retry`.
2017-05-03 22:38:41 +02:00
bors
2d4ed8e0cb Auto merge of #41728 - sirideain:inference-failure-for-loops-test, r=alexcrichton
Add test for an inference failure.

Fixes #22066
2017-05-03 19:58:35 +00:00
Niko Matsakis
55412a201a track CurrentItem, not just Generics 2017-05-03 15:28:17 -04:00
Niko Matsakis
b175aef0c4 make transitive relation use a hash map 2017-05-03 15:28:16 -04:00
Bobby Holley
7b05b88ce7 Document the reasoning for the Acquire/Release handshake when dropping Arcs. 2017-05-03 11:02:23 -07:00
Charlie Sheridan
3e03b1abb7 Add test for an inference failure. 2017-05-03 13:07:30 -04:00