Commit Graph

67948 Commits

Author SHA1 Message Date
Michael Woerister
b9816c5fab incr.comp.: Already hash HIR bodies during metadata export so they don't have to be hashed in downstream crates. 2017-09-18 11:26:11 +02:00
Michael Woerister
e3f913167c Fix issues uncovered by rebasing:
- Don't hash traits in scope as part of HIR hashing any more.
- Some queries returned DefIndexes from other crates.
- Provide a generic way of stably hashing maps (not used everywhere yet).
2017-09-18 11:25:34 +02:00
Michael Woerister
3cc3ae22bd incr.comp.: Move result fingerprinting to DepGraph::with_task().
This makes sure that we don't introduce strange cases where we have
nodes outside the query system that could break red/green tracking
and it will allow to keep red/green neatly encapsulated within the
DepGraph implementation.
2017-09-18 11:25:34 +02:00
Michael Woerister
e6c9a53d1a incr.comp.: Compute hashes of all query results. 2017-09-18 11:23:08 +02:00
Michael Woerister
3cf28f3002 Use DefId instead of NodeId as identifier in resolve_lifetime::Region.
These Region values end up in crate metadata so they should not use NodeId.
2017-09-18 11:17:02 +02:00
bors
3a7b960731 Auto merge of #44441 - tamird:cargo-bitflags, r=alexcrichton
Remove rustc_bitflags; use the bitflags crate

r? @alexcrichton
2017-09-18 07:00:28 +00:00
Will Speak
ebd0e4f199 Add Example of IntoIterator as Trait Bound to Docs
Part of #44600.
2017-09-18 07:41:38 +01:00
bors
caad2560bf Auto merge of #43628 - oli-obk:orbital_standard_library, r=alexcrichton
Run the miri test suite on the aux builder and travis

Reopen of #38350

see https://github.com/rust-lang/rust/pull/43340#issuecomment-316940762 for earlier discussion

Rationale for running miri's test suite in rustc's CI is that miri currently contains many features that we want in const eval in the future, and these features would break if the test suite is not run.

fixes #44077

r? @nikomatsakis

cc @eddyb
2017-09-18 01:50:29 +00:00
Trevor Merrifield
6ae9fc2772 Remove st_mode mask 2017-09-17 20:13:33 -04:00
Trevor Merrifield
04c01e0b1f Add test case for unix permissions 2017-09-17 20:13:29 -04:00
bors
e8a76d8acc Auto merge of #44529 - alexcrichton:trans-query, r=michaelwoerister
Refactor translation unit partitioning/collection as a query

This commit is targeted at #44486 with the ultimate goal of making the `collect_and_partition_translation_items` function a query. This mostly just involved query-ifying a few other systems along with plumbing the tcx instead of `SharedCrateContext` in a few locations.

Currently this only tackles the first bullet of #44486 and doesn't add a dedicated query for a particular codegen unit. I wasn't quite sure how to do that yet but figured this was good to put up.

Closes #44486
2017-09-17 22:05:31 +00:00
Guillaume Gomez
e47279f512 Add more links and put the link character to the left 2017-09-17 22:11:37 +02:00
Oliver Schneider
01555b1da1
Rebase fallout 2017-09-17 21:45:54 +02:00
Oliver Schneider
a9df19b42f
Update miri submodule 2017-09-17 21:42:35 +02:00
Oliver Schneider
68fc65eaf2
Prevent distribution if miri is enabled 2017-09-17 21:41:45 +02:00
Oliver Schneider
13921dafbf
-Zmir-emit-validate is in stage 0 2017-09-17 21:41:45 +02:00
Oliver Schneider
ab018c76e1
Add a file to trivially disable tool building or testing 2017-09-17 21:41:45 +02:00
Oliver Schneider
f0b5402283
Improve documentation 2017-09-17 21:40:13 +02:00
Oliver Schneider
f381744d91
Get the miri test suite to run inside the rustc dev environment 2017-09-17 21:40:13 +02:00
Oliver Schneider
2787a285bd
Add <*const T>::align_offset and use it in memchr 2017-09-17 21:30:58 +02:00
Tamir Duberstein
231d9e7e5d
Remove rustc_bitflags; use the bitflags crate 2017-09-17 14:19:24 -04:00
Alex Crichton
6d614ddc2e rustc: Move codegen to a query
This commit moves the actual code generation in the compiler behind a query
keyed by a codegen unit's name. This ended up entailing quite a few internal
refactorings to enable this, along with a few cut corners:

* The `OutputFilenames` structure is now tracked in the `TyCtxt` as it affects a
  whole bunch of trans and such. This is now behind a query and threaded into
  the construction of the `TyCtxt`.

* The `TyCtxt` now has a channel "out the back" intended to send data to worker
  threads in rustc_trans. This is used as a sort of side effect of the codegen
  query but morally what's happening here is the return value of the query
  (currently unit but morally a path) is only valid once the background threads
  have all finished.

* Dispatching work items to the codegen threads was refactored to only rely on
  data in `TyCtxt`, which mostly just involved refactoring where data was
  stored, moving it from the translation thread to the controller thread's
  `CodegenContext` or the like.

* A new thread locals was introduced in trans to work around the query
  system. This is used in the implementation of `assert_module_sources` which
  looks like an artifact of the old query system and will presumably go away
  once red/green is up and running.
2017-09-17 10:25:50 -07:00
Tamir Duberstein
e788fa7b6c
bootstrap: plumb verbosity into submodule ops
Fix some lints while I'm here.
2017-09-17 13:15:06 -04:00
bors
cfcac37204 Auto merge of #44607 - alexcrichton:rustbuild-no-j, r=Mark-Simulacrum
rustbuild: Don't pass `-j` if called by `make`

In these situations Cargo just prints out a warning about ignoring the flag
anyway, so let `make` take care of jobs and whatnot instead of getting warnings
printed.
2017-09-17 17:15:01 +00:00
Tamir Duberstein
4a8933f4a7
Use double quotes to appease some TOML parsers 2017-09-17 13:14:37 -04:00
Alex Crichton
3021c1d0bf rustc: Attach an mpsc channel to TyCtxt
This commit attaches a channel to the LLVM workers to the `TyCtxt` which will
later be used during the codegen query to actually send work to LLVM workers.
Otherwise this commit is just plumbing this channel throughout the compiler to
ensure it reaches the right consumers.
2017-09-17 09:41:44 -07:00
Alex Crichton
2eada58706 rustc: Remove another global map from trans
This commit removes the `crate_trans_items` field from the `CrateContext` of
trans. This field, a big map, was calculated during partioning and was a set of
all translation items. This isn't quite incremental-friendly because the map may
change a lot but not have much effect on downstream consumers.

Instead a new query was added for the one location this map was needed, along
with a new comment explaining what the location is doing!
2017-09-17 09:41:43 -07:00
Alex Crichton
19727c84dd rustc: Move a comment to the right spot in trans
I believe this comment here is mostly talking about the `ptrcast` function call
below, so move the comment down to that block.
2017-09-17 09:41:43 -07:00
Alex Crichton
afb85cfd33 rustc: Mostly remove ExportedSymbols
This is a big map that ends up inside of a `CrateContext` during translation for
all codegen units. This means that any change to the map may end up causing an
incremental recompilation of a codegen unit! In order to reduce the amount of
dependencies here between codegen units and the actual input crate this commit
refactors dealing with exported symbols and such into various queries.

The new queries are largely based on existing queries with filled out
implementations for the local crate in addition to external crates, but the main
idea is that while translating codegen untis no unit needs the entire set of
exported symbols, instead they only need queries about particulare `DefId`
instances every now and then.

The linking stage, however, still generates a full list of all exported symbols
from all crates, but that's going to always happen unconditionally anyway, so no
news there!
2017-09-17 09:41:43 -07:00
Alex Crichton
8821affd15 rustc: Move some attr methods to queries
Otherwise we may emit double errors related to the `#[export_name]` attribute,
for example, and using a query should ensure that it's only emitted at most
once.
2017-09-17 09:41:43 -07:00
Alex Crichton
132bde7cf1 rustc: Make trans collect/partition a query
This commit moves the `collect_and_partition_translation_items` function into a
query on `TyCtxt` instead of a free function in trans, allowing us to track
dependencies and such of the function.
2017-09-17 09:41:43 -07:00
Alex Crichton
dba3ddd8d4 rustc: Calculate ExportedSymbols in a query
This commit moves the definition of the `ExportedSymbols` structure to the
`rustc` crate and then creates a query that'll be used to construct the
`ExportedSymbols` set. This in turn uses the reachablity query exposed in the
previous commit.
2017-09-17 09:41:43 -07:00
Alex Crichton
baca9a6240 rustc: Use reachablility through a query
Turns out this was already set up as a query, just wasn't using it yet!
2017-09-17 09:41:43 -07:00
Alex Crichton
a97ad6ae50 rustc: Refactor trans paritioning to use tcx
This commit refactors the the `partitioning::partition` function to operate with
a `TyCtxt` instead of a `SharedCrateContext` in preparation for making it a
query.
2017-09-17 09:41:43 -07:00
Alex Crichton
c72240acf7 rustc_trans: Refactor collection to use tcx
This commit refactors the `collect_crate_translation_items` function to only
require the `TyCtxt` instead of a `SharedCrateContext` in preparation for
query-ifying this portion of trans.
2017-09-17 09:41:43 -07:00
Alex Crichton
4857bb7ffa rustbuild: Don't pass -j if called by make
In these situations Cargo just prints out a warning about ignoring the flag
anyway, so let `make` take care of jobs and whatnot instead of getting warnings
printed.
2017-09-17 09:29:11 -07:00
Ixrec
38fa340ba2 missed a 'mut' 2017-09-17 17:11:42 +01:00
leonardo.yvens
0741645230 Remove unused str_eq lang item
It's not a lang item anymore. Also remove outdated note.
2017-09-17 13:04:49 -03:00
Ixrec
2633b85ab2 Replace str's transmute() calls with pointer casts
After the following conversation in #rust-lang:
```
[14:43:50] <Ixrec> TIL the implementation of from_utf_unchecked is literally just "mem::transmute(x)"
[14:43:59] <Ixrec> no wonder people keep saying transmute is overpowered
[15:15:30] <eddyb> Ixrec: it should be a pointer cast lol
[15:15:46] <eddyb> unless it doesn't let you
[16:50:34] <Ixrec> https://play.rust-lang.org/?gist=d1e6b629ad9ec1baf64ce261c63845e6&version=stable seems like it does let me
[16:52:35] <eddyb> Ixrec: yeah that's the preferred impl
[16:52:46] <eddyb> Ixrec: it just wasn't in 1.0
[16:52:50] <eddyb> IIRC
[16:53:00] <eddyb> (something something fat pointers)
```
Since I already wrote half of the preferred impls in the playground, might as well make an actual PR.
2017-09-17 17:03:56 +01:00
bors
1cdd68922d Auto merge of #44654 - TimNN:rollup, r=TimNN
Rollup of 17 pull requests

- Successful merges: #44073, #44088, #44381, #44397, #44509, #44533, #44549, #44553, #44562, #44567, #44595, #44604, #44617, #44622, #44630, #44639, #44647
- Failed merges:
2017-09-17 11:19:56 +00:00
Tim Neumann
7aefb6c3ef Rollup merge of #44647 - tmerr:fix-44645, r=dtolnay
Ensure tcp test case passes when disconnected from network

net::tcp::tests::connect_timeout_unroutable fails when the network
is unreachable, like on a laptop disconnected from wifi. Check for
this error and allow the test to pass.

Closes #44645
2017-09-17 13:19:15 +02:00
Tim Neumann
d046421743 Rollup merge of #44639 - budziq:stabilize_needs_drop, r=dtolnay
stabilized needs_drop (fixes #41890)

fixes #41890
2017-09-17 13:19:14 +02:00
Tim Neumann
6b1f0c8694 Rollup merge of #44630 - RalfJung:compiletest, r=Mark-Simulacrum
compiletest: print the correct basename of the src dir

See <https://github.com/laumann/compiletest-rs/issues/76>.

Fixes #40712
2017-09-17 13:19:13 +02:00
Tim Neumann
bbb89863a9 Rollup merge of #44622 - frewsxcv:frewsxcv-invalid-link, r=QuietMisdreavus
Fix incorrect `into_inner` link in docs.

Fixes https://github.com/rust-lang/rust/issues/42373.
2017-09-17 13:19:12 +02:00
Tim Neumann
80d7e76185 Rollup merge of #44617 - alexcrichton:download-from-us-west-1, r=aidanhs
ci: Upload/download from a new S3 bucket

Moving buckets from us-east-1 to us-west-1 because us-west-1 is where
rust-central-station itself runs and in general is where we have all our other
buckets.
2017-09-17 13:19:11 +02:00
Tim Neumann
fbee41b714 Rollup merge of #44604 - alexcrichton:update-cargo, r=Mark-Simulacrum
Update cargo submodule

Just a routine update
2017-09-17 13:19:10 +02:00
Tim Neumann
064f718247 Rollup merge of #44595 - budziq:stabilize_compiler_fences, r=alexcrichton
stabilized compiler_fences (fixes #41091)

I did not know what to proceed with "unstable-book" entry. The feature would no longer be unstable so I have deleted it. If it was the wrong call I'll revert it (unfortunately his case is not described in the CONTRIBUTING.md).
2017-09-17 13:19:09 +02:00
Tim Neumann
1437e53f9f Rollup merge of #44567 - budziq:stabilize_iterator_for_each, r=alexcrichton
stabilized iterator_for_each (closes #42986)

Also updated clippy and rls as these use the iterator_for_each

I've made my first PR's today so most likely I've done something wrong. Sorry about that!
2017-09-17 13:19:08 +02:00
Tim Neumann
4dc01c475f Rollup merge of #44562 - eddyb:ugh-rustdoc, r=nikomatsakis
rustdoc: pretty-print Unevaluated expressions in types.

Fixes #44555.

r? @nikomatsakis
2017-09-17 13:19:07 +02:00
Tim Neumann
eab164842a Rollup merge of #44553 - qmx:refactor-remove-overzealous-box-szero-optimization, r=arielb1
remove overzealous Box<ZeroSizeType> optimization
2017-09-17 13:19:06 +02:00