Commit Graph

67753 Commits

Author SHA1 Message Date
Alex Crichton
0b7e0aaba5 rustc: Classify two more CrateStore methods untracked
These are only called pre-TyCtxt (e.g. lowering/resolve), so make it explicit in
the name that they're untracked and therefore unsuitable to called elsewhere.
2017-09-05 07:37:58 -07:00
Alex Crichton
88399a985a rustc: Migrate visible_parent_map to a query
Turns out it was basically already a query if you squinted hard enough!
2017-09-05 07:37:58 -07:00
Alex Crichton
84ae4b75be rustc: Migrate CrateStore::item_body to a query
This commit migrates the `item_body` method on `CrateStore` to a query instead
to enable better tracking of dependencies and whatnot.
2017-09-05 07:37:58 -07:00
Alex Crichton
953490ddfa rustc: Remove lang item methods from CrateStore
Given the previous commit, these are now trivially representable as queries!
2017-09-05 07:37:58 -07:00
Alex Crichton
a2e2aba07d rustc: Migrate lang items to a query
This commit moves the calculation of the `LanguageItems` structure into a
query rather than being calculated before the `TyCtxt` exists, with the eventual
end goal of removing some `CrateStore` methods.
2017-09-05 07:37:57 -07:00
Alex Crichton
43ae380191 rustc: Flag some CrateStore methods as "untracked"
The main use of `CrateStore` *before* the `TyCtxt` is created is during
resolution, but we want to be sure that any methods used before resolution are
not used after the `TyCtxt` is created. This commit starts moving the methods
used by resolve to all be named `{name}_untracked` where the rest of the
compiler uses just `{name}` as a query.

During this transition a number of new queries were added to account for
post-resolve usage of these methods.
2017-09-05 07:37:39 -07:00
Alex Crichton
fd61fa5aef rustc: Hide the named_region_map behind queries
This commit makes the `named_region_map` field of `GlobalCtxt` private by
encapsulating the fields behind new queries, and the new queries are also
targeted at particular `HirId` nodes instead of accessing the entire map.
2017-09-05 07:37:39 -07:00
Alex Crichton
64a70342e6 rustc: Remove a number of mutable fields in cstore
This commit started by moving methods from `CrateStore` to queries, but it ended
up necessitating some deeper refactorings to move more items in general to
queries.

Before this commit the *resolver* would walk over the AST and process foreign
modules (`extern { .. }` blocks) and collect `#[link]` annotations. It would
then also process the command line `-l` directives and such. This information
was then stored as precalculated lists in the `CrateStore` object for iterating
over later.

After this, commit, however, this pass no longer happens during resolution but
now instead happens through queries. A query for the linked libraries of a crate
will crawl the crate for `extern` blocks and then process the linkage
annotations at that time.
2017-09-05 07:37:28 -07:00
Alex Crichton
87ea0a19bf Ignore failing tests harder 2017-09-05 07:37:28 -07:00
Alex Crichton
1c7294eb54 rustc: Move implementations_of_trait to a query
While we're at it, make it two separate queries so one's for rustdoc and one's
for the compiler, hopefully being a bit more targeted.
2017-09-05 07:37:28 -07:00
Alex Crichton
4dec2a8f81 rustc: Fix a borrow mut error with debug assertions 2017-09-05 07:37:28 -07:00
Alex Crichton
4af1284053 Ignore failing incremental tests
These should hopefully get fixed with red/green, but until that time alas!
2017-09-05 07:37:27 -07:00
Alex Crichton
52b67f988d rustc: Move original_crate_name to a query 2017-09-05 07:37:27 -07:00
Alex Crichton
d6c88f4936 rustc: Move crate_hash to a query 2017-09-05 07:37:27 -07:00
Alex Crichton
ebc1fd321d rustc: Move crate_disambiguator to queries 2017-09-05 07:37:11 -07:00
Alex Crichton
2d4445f784 rustc: Move {plugin,derive}_registrar_fn to queries 2017-09-05 07:37:11 -07:00
Alex Crichton
205bc9a80a rustc: Migrate CStore::native_libraries to a query 2017-09-05 07:37:11 -07:00
Alex Crichton
98b74c580f rustc: Migrate CStore::expored_symbols to a query 2017-09-05 07:37:11 -07:00
Alex Crichton
ed6f868bf7 rustc: Move impl_defaultness to a query 2017-09-05 07:37:11 -07:00
Alex Crichton
dff0c074e4 rustc: Move a few more cstore methods to queries
This comit applies the following changes:

* Deletes the `is_allocator` query as it's no longer used
* Moves the `is_sanitizer_runtime` method to a query
* Moves the `is_profiler_runtime` method to a query
* Moves the `panic_strategy` method to a query
* Moves the `is_no_builtins` method to a query
* Deletes the cstore method of `is_compiler_builtins`. The query was added in
  #42588 but the `CrateStore` method was not deleted

A good bit of these methods were used late in linking during trans so a new
dedicated structure was created to ship a calculated form of this information
over to the linker rather than having to ship the whole of `TyCtxt` over to
linking.
2017-09-05 07:37:11 -07:00
Felix S. Klock II
f2892ad281 Emit EndRegion statements when given -Z mir-emit-validate=N (for N > 0).
This way the miri test suite does not have to be updated to explcitly
request `-Z emit-end-regions`.
2017-09-05 15:28:08 +02:00
Felix S. Klock II
c11f3e36c8 Update regression test to explicit enable EndRegion emission. 2017-09-05 15:19:55 +02:00
Felix S. Klock II
8da717daa4 Update mir-opt/end_region_*.rs tests to explicit enable EndRegion emission. 2017-09-05 15:19:55 +02:00
Felix S. Klock II
f1c721caa7 Skip EndRegion emission by default. Use -Z emit-end-regions to reenable it.
The main intent is to fix cases where EndRegion emission is believed
to be causing excess peak memory pressure.

It may also be a welcome change to people inspecting the MIR output
who find the EndRegions to be a distraction.
2017-09-05 15:19:55 +02:00
Ariel Ben-Yehuda
d14ed92f6b Avoid hashing when creating a DepNode from a HirId
Instead, combine the already-present DefPathHash with the 32-bit
ItemLocalIndex.

Should fix #44323.
2017-09-05 15:19:07 +03:00
Wonwoo Choi
258ec30116 Expect pipe symbol after closure parameter lists 2017-09-05 18:25:42 +09:00
bors
2f1ef9ef11 Auto merge of #44308 - eddyb:local-index, r=arielb1
[MIR] Restrict ProjectionElem::Index and Storage{Live,Dead} to Local.

(see #44285)

r? @nikomatsakis
2017-09-05 04:56:03 +00:00
Wangshan Lu
280e6d8f17 Fix link typo in 1.20.0 release notes 2017-09-05 12:27:14 +08:00
Jacob Kiesel
b762283e57 Add panic unit tests 2017-09-04 21:39:46 -06:00
bors
2f681bf602 Auto merge of #44248 - oli-obk:spans, r=jseyfried
Produce expansion info for more builtin macros

r? @jseyfried

fixes #43268
2017-09-05 02:21:02 +00:00
Max Comstock
7d94ca618c Removed the incorrect documentation for from_str 2017-09-04 22:16:15 -04:00
kennytm
aa6bd117bb
Fix missing line numbers on i686. 2017-09-05 08:41:43 +08:00
Alexander von Gluck IV
1c5bf2468b std/time: Give an example to get UNIX_EPOCH in seconds 2017-09-04 19:21:58 -05:00
Eh2406
b88ec735aa #12808 is closed remove the FIXME 2017-09-04 20:06:39 -04:00
Eh2406
e90f4236e0 #33490 is closed remove the FIXME 2017-09-04 19:59:16 -04:00
bors
22d65983b9 Auto merge of #43067 - pornel:libdeps, r=nrc
Compact display of static lib dependencies

Fixes #33173

Instead of displaying one dependency per line, I've changed the format to display them all in one line.

As a bonus they're in format of linker flags (`-lfoo`), so the output can be copy&pasted if one is actually going to link as suggested.
2017-09-04 23:06:59 +00:00
est31
76fae7197b Fix tests 2017-09-05 00:23:34 +02:00
Niels Egberts
69c472897f Make slice::split_at_mut example demonstrate mutability
Moved the examples from split_at_mut to split_at so the example at
split_at_mut can just demonstrate mutability.
2017-09-04 22:59:34 +01:00
est31
b8cf07ee1f Improve DefIndex formatting to be more semantic 2017-09-04 22:57:22 +02:00
Jonathan A. Kollasch
fcefe36ce7 bootstrap: only include docs in extended distribution if enabled
Issue #44163
2017-09-04 15:42:11 -05:00
Evgeniy A. Dushistov
49f1fc5bb7 Add test for #22706
Closes #22706
2017-09-04 19:24:19 +03:00
Simon Sapin
9412fd7371 Only include git-commit-hash in tarballs when available
… instead of writing an empty file.
2017-09-04 16:30:36 +02:00
Ralf Jung
adbb820352 rustbook: remove dead test functions 2017-09-04 13:04:53 +02:00
bors
088216fb99 Auto merge of #44194 - QuietMisdreavus:hey-how-do-i-use-this-new-fangled-thing, r=aturon
expand on using rustup custom toolchains in CONTRIBUTING.md

fixes #42484

Should i include more notes about how to use a local build *without* rustup? It can kinda feel like a cop-out otherwise. Other means that come to mind are setting `$RUSTC` directly and fully installing it.

cc @rust-lang/docs
2017-09-04 10:33:53 +00:00
Lance Roy
94301c405c Additional traits for std::mem::ManuallyDrop
Add pass-through implementations for all of the derivable traits. These
cannot be derived since ManuallyDrop is a union.
2017-09-04 02:29:16 -07:00
Oliver Schneider
c4d5a1e17b
Produce expansion info for more builtin macros 2017-09-04 11:03:19 +02:00
Lance Roy
6276dbd953 Derive std::mem::ManuallyDrop from Clone and Copy.
Although types that don't implement Drop can't be Copyable, this can
still be useful when ManuallyDrop is used inside a generic type. This
doesn't derive from Copy as that would require T: Copy + Clone, instead
it provides an impl of Clone for T: Clone.
2017-09-04 01:00:15 -07:00
bors
a36d93d383 Auto merge of #44300 - Manishearth:clippyup, r=oli-obk
Resync clippy to v0.0.156

None
2017-09-04 07:12:42 +00:00
Eduard-Mihai Burtescu
4e2be14986 Make the LocalKey facade of thread_local! inlineable cross-crate. 2017-09-04 08:24:06 +03:00
Eduard-Mihai Burtescu
e74f96e43f rustc_mir: use Local instead of Lvalue in Storage{Live,Dead}. 2017-09-04 08:01:46 +03:00