Commit Graph

48420 Commits

Author SHA1 Message Date
Niko Matsakis
7926fa1ee9 Update unit tests in driver. 2015-11-18 19:23:30 -05:00
Niko Matsakis
f8f2e2bad5 minor fixes to #[cfg(test)] code 2015-11-18 19:23:29 -05:00
Niko Matsakis
cfe4c3567a ratchet down the recursion limit because, at least in my testing,
under some configurations this still causes a stack overflow and
hence a crash
2015-11-18 19:23:29 -05:00
Niko Matsakis
7c2ee5ed12 Patch graphviz tests to account for the fact that nested items are not
listed (an improvement, I think).
2015-11-18 19:23:29 -05:00
Niko Matsakis
bca026efb9 Fix two long lines. 2015-11-18 19:23:29 -05:00
Niko Matsakis
06f2d9da87 Modify trans to use an outer walk and ensure that we rotate as we
encounter each module. This is somewhat different than how it used to
work; it should ensure a more equitable distribution of work than
before. The reason is that, before, when we rotated, we would rotate
before we had seen the full contents of the current module. So e.g.  if
we have `mod a { mod b { .. } .. }`, then we rotate when we encounter
`b`, but we haven't processed the remainder of `a` yet. Unclear if this
makes any difference in practice, but it seemed suboptimal. Also, this
structure (with an outer walk over modules) is closer to what we will
want for an incremental setting.
2015-11-18 19:23:29 -05:00
Niko Matsakis
0bc61402a9 Remove rustc_data_structures from the deps of librustc_front now
that we no longer use FnvHashMap
2015-11-18 19:23:29 -05:00
Niko Matsakis
e303c250f1 Change to a BTreeMap rather than sorting the keys of a FnvHashMap. 2015-11-18 19:23:29 -05:00
Niko Matsakis
db97c93c99 Add comment explaining why it is called intravisit 2015-11-18 19:23:29 -05:00
Niko Matsakis
1e941f8e97 Port trans to use visit_all_items: this was mostly straight-forward, but
noteworthy because trans got mildly simpler, since it doesn't have to
ensure that we walk the contents of all things just to find all the
hidden items.
2015-11-18 19:23:29 -05:00
Niko Matsakis
98b046e16e Various straight-forward ports that override visit_nested_items
to do "in-situ" visits.
2015-11-18 19:23:29 -05:00
Niko Matsakis
ac38021da1 Port entry code to visit_all_items -- since this was tracking whether
the main fn appeared at the top level, if now consults the `DefPath` to
get this information
2015-11-18 19:22:18 -05:00
Niko Matsakis
e4ff9f71db Port a bunch of code new-visitor; all of these ports were
straightforward uses of `visit_all_items`. In some cases I had to remove
empty `visit_item` calls that were just to suppress visiting nested
items.
2015-11-18 19:22:18 -05:00
Niko Matsakis
e14562d515 Rework the IdVisitor so that it only visits item contents (and doesn't
visit nested items). This is what all clients wanted anyhow.
2015-11-18 19:22:18 -05:00
Niko Matsakis
25727d70d1 Port the map construction code to use the new visitor. 2015-11-18 19:22:18 -05:00
Niko Matsakis
767ee79c4c Refactor the HIR so that items are stored in a map in the Crate,
rather being stored inline. Refactor (and rename) the visitor so that
(by default) it only visits the interior content of an item not nested
items.

This is a [breaking-change] for anyone who uses the HIR visitor. Besides
changing `visit::` to `intravisit::`, you need to refactor your visitor
in one of two ways, depending on what it requires:

1. If you just want to visit all items (most common), you should call
   `krate.visit_all_items(&mut visitor)`.

2. If you need to visit nested items in the middle of the parent items,
   you should override `visit_nested_item` with something like:
   `self.visit_item(self.tcx.map.expect_item(item.id))`, presuming you
   have access to a tcx (or at least a HIR map).
2015-11-18 19:22:18 -05:00
Niko Matsakis
66326bc665 refactorings of lowering that make it more amenable to using &mut
instead of `Cell` (but stop short of actualling switching to `&mut`)
2015-11-18 19:22:17 -05:00
Niko Matsakis
6ccd390dbd rename _lctx to lctx where appropriate 2015-11-18 19:22:17 -05:00
Niko Matsakis
6913ed0f3c Remove seemingly pointless case -- this customized variant avoided
walking the patterns in a type fn decl, but those patterns are ignored
by this visitor anyway.
2015-11-18 19:22:17 -05:00
bors
2978af09d3 Auto merge of #29910 - tbu-:pr_env_revert_mingw_weirdness, r=alexcrichton 2015-11-18 23:17:30 +00:00
bors
edcfeb7996 Auto merge of #29878 - wthrowe:libdir2, r=brson
Rather than modifying the installer to disable directory rewriting,
this patch modifies the directory structure passed to the installer so
that the rewriting gives the correct results.  This means that if a
non-standard --libdir is passed to configure then the same --libdir
option (relative to the --prefix) must be passed to the install
script.  In the `make install` case this is handled automatically.
Binary distributions are generally generated using the default
--libdir and then have paths optionally rewritten by the installer,
which should continue to work.

This has the advantage of not complicating the installer interface
intended for end-user use.

Fixes #29561
2015-11-18 21:33:34 +00:00
Joshua Holmer
51c35dbd30 Fix unpredictable ordering of sidebar boxes in rustdoc
A race condition in Javascript was causing unpredictable ordering
of the sidebar boxes when loading documentation generated by
rustdoc, due to the script that adds the Crates box being executed
asynchronously. Disabling the asynchronous execution and deferring
this script should ensure that the Crates box always appears last
in the sidebox (this seemed to be the more common ordering prior
to this change).

Fixes #29698
2015-11-18 16:21:19 -05:00
Manish Goregaokar
c23cbae0cb Add long error diagnostics for E0401 2015-11-19 02:01:19 +05:30
bors
22e31f10c2 Auto merge of #29083 - petrochenkov:stability3, r=alexcrichton
What this patch does:
- Stability annotations are now based on "exported items" supplied by rustc_privacy and not "public items". Exported items are as accessible for external crates as directly public items and should be annotated with stability attributes.
- Trait impls require annotations now.
- Reexports require annotations now.
- Crates themselves didn't require annotations, now they do.
- Exported macros are annotated now, but these annotations are not used yet.
- Some useless annotations are detected and result in errors
- Finally, some small bugs are fixed - deprecation propagates from stable deprecated parents, items in blocks are traversed correctly (fixes https://github.com/rust-lang/rust/issues/29034) + some code cleanup.
2015-11-18 19:49:33 +00:00
Vadim Petrochenkov
64b90f81c3 Fix buildbot failures 2015-11-18 21:16:20 +03:00
bors
3c68f646e9 Auto merge of #29886 - michaelwoerister:mir-erase-regions, r=nikomatsakis
This change adds a `MirPass` erasing all early-bound regions from MIR, right before storing it in the MIR map. I've added some assertions at neuralgic points in `trans::mir` doing cheap checks whether region have actually been erased.

Here are some assumptions that I worked under:
- AdtDef references stay untouched. It's the `Substs` accompanying them that need to be handled (e.g. in `AggregateKind::Adt`).
- We can't really get rid of late-bound regions at this point because there is no version `BareFnTy` (for example) that comes without one. These still have to be handled on demand in trans.

Are this assumptions right?

r? @nikomatsakis
2015-11-18 18:06:30 +00:00
Michael Woerister
c533902285 MIR: Add pass that erases all regions right before trans 2015-11-18 17:26:24 +01:00
bors
64a65692a2 Auto merge of #29906 - ranma42:doc-typo, r=steveklabnik 2015-11-18 15:54:28 +00:00
Tobias Bucher
2731c822ae Revert not-ignoring weird environment variables for MinGW 2015-11-18 14:09:54 +00:00
bors
28f6b88978 Auto merge of #29902 - huonw:smart-quotes, r=alexcrichton
cc https://github.com/rust-lang/rust/pull/29837#issuecomment-157540449
2015-11-18 10:58:04 +00:00
Andrea Canciani
64555321ce Fix typo in libcore documentation 2015-11-18 11:35:29 +01:00
bors
1715f1cf7f Auto merge of #29904 - Zoxc:ar_json, r=alexcrichton
This allows targets to drop the dependency on AR.
2015-11-18 07:13:39 +00:00
Huon Wilson
41f7f0c341 Add some unicode aliases for ". 2015-11-18 17:16:32 +11:00
bors
8ed8679b2e Auto merge of #29897 - alexcrichton:process-wait-with-output, r=brson
Previously this function used channels but this isn't necessary any more now
that threads have return values. This also has the added bonus of appropriately
waiting for the thread to exit to ensure that the function doesn't still have
running threads once it returns.
2015-11-18 04:00:43 +00:00
bors
50b969d3b2 Auto merge of #29882 - devonhollowood:master, r=Manishearth
Implement #14615
2015-11-18 02:02:00 +00:00
John Kåre Alsaker
9e1d9e4884 Expose archive_format to target specifications 2015-11-18 02:39:46 +01:00
Jeffrey Seyfried
6a6e1dba55 Refactor away get_module_if_available and get_module and reformat one-liners 2015-11-18 01:22:32 +00:00
bors
277416edcd Auto merge of #29900 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #29612, #29888, #29889, #29890, #29891, #29892
- Failed merges:
2015-11-17 23:55:53 +00:00
Steve Klabnik
5c99fb78c6 Rollup merge of #29892 - steveklabnik:doc_fromiterator, r=alexcrichton
And modifying IntoIterator for consisntency with it.

Part of #29360
2015-11-17 18:13:06 -05:00
Steve Klabnik
6e4f6c8f5f Rollup merge of #29891 - steveklabnik:gh29470, r=alexcrichton
Fixes #29470
2015-11-17 18:13:06 -05:00
Steve Klabnik
370b793969 Rollup merge of #29890 - steveklabnik:gh29742, r=Manishearth
FIxes #29742
2015-11-17 18:13:06 -05:00
Steve Klabnik
8adfcf1b7c Rollup merge of #29889 - steveklabnik:gh29801, r=manishearth
First, re-word the section on if let/while let to be more clear.

Second, actually call them let statements in the statement section

Fixes #29801
2015-11-17 18:13:05 -05:00
Steve Klabnik
fb6687150c Rollup merge of #29888 - steveklabnik:gh29762, r=sanxiyn
Fixes #29762
2015-11-17 18:13:05 -05:00
Steve Klabnik
cffd88110c Rollup merge of #29612 - steveklabnik:gh29502, r=alexcrichton
libcore does have a few deps, like noted in https://github.com/rust-lang/rust/issues/29390

Fixes #29502

r? @alexcrichton
2015-11-17 18:13:05 -05:00
Steve Klabnik
9d663a3e4a More docs for FromIterator
And modifying IntoIterator for consisntency with it.

Part of #29360
2015-11-17 18:12:50 -05:00
Steve Klabnik
60c84eed42 Remove claims of dependency-free libcore
libcore does have a few deps, like noted in https://github.com/rust-lang/rust/issues/29390

Fixes #29502
2015-11-17 18:04:36 -05:00
Steve Klabnik
cf384c21ea Clear up the reference around let
First, re-word the section on if let/while let to be more clear.

Second, actually call them let statements in the statement section

Fixes #29801
2015-11-17 17:41:26 -05:00
Vadim Petrochenkov
5cdfd8401b Review fixes 2015-11-18 01:24:22 +03:00
Vadim Petrochenkov
7e2ffc7090 Add missing annotations and some tests 2015-11-18 01:24:21 +03:00
Vadim Petrochenkov
52acc05f63 Rework stability annotation pass 2015-11-18 01:24:20 +03:00