Commit Graph

48198 Commits

Author SHA1 Message Date
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
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
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
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
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
bors
841e36eb21 Auto merge of #29797 - oli-obk:remove-fromb, r=nikomatsakis
the const evaluator has a bool constant value, no need to use integers

the `fromb` function is very old. It took me a while of git-blame until i found where it was created. I think it was just a hack. All tests still pass.

I also forbade `&&` and `||` on integral types
2015-11-17 22:12:07 +00:00
Alex Crichton
33353668fc std: Use join() in Process::wait_with_output
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-17 13:37:44 -08:00
Devon Hollowood
0823ee6940 Add changes to liblibc 2015-11-17 13:16:09 -08:00
bors
b2f539375a Auto merge of #29887 - sanxiyn:match-ref-pats, r=sfackler 2015-11-17 20:10:25 +00:00
bors
b31cc644d1 Auto merge of #29766 - oli-obk:impl_item, r=nikomatsakis
[breaking change]

I'm not sure if those renames are ok. [TokenType::Tt* to TokenType::*](https://github.com/rust-lang/rust/pull/29582) was obvious, but for all those Item-enums it's less obvious to me what the right way forward is due to the underscore.
2015-11-17 18:24:19 +00:00
Steve Klabnik
9ca257a5b6 Fix up escapes in the reference
Fixes #29470
2015-11-17 11:54:20 -05:00
Steve Klabnik
dcf7e4da69 Clarify comment about structs and lifetimes
FIxes #29742
2015-11-17 11:42:17 -05:00
Steve Klabnik
0f5ba5459b Mention libc from crates.io in TRPL: FFI
Fixes #29762
2015-11-17 11:12:57 -05:00
bors
8809a33c34 Auto merge of #29531 - bltavares:issue-28586, r=sanxiyn
Cloases #28586
2015-11-17 15:39:10 +00:00
Seo Sanghyeon
95f6ea920d Fix match_ref_pats flagged by Clippy 2015-11-17 23:24:49 +09:00
bors
c61e8fd61a Auto merge of #29883 - Manishearth:rollup, r=Manishearth
- Successful merges: #29868, #29873, #29874, #29875, #29876, #29880, #29881
- Failed merges:
2015-11-17 09:42:31 +00:00
Manish Goregaokar
e81c72e78e Rollup merge of #29881 - jeanm:patch-1, r=Manishearth
Change conditional perfect to past perfect.
2015-11-17 15:12:15 +05:30
Manish Goregaokar
c063c521ec Rollup merge of #29880 - dignati:fix-freebsd-libc, r=alexcrichton
With this change the build on FreeBSD is almost working again.
2015-11-17 15:12:15 +05:30
Manish Goregaokar
3d1f3c9d38 Rollup merge of #29876 - cardoe:i586-build-fix, r=alexcrichton
On distros that use i486 or i586 in their CHOST, Rust will fail to build
because it is not handling i486 or i586 like i686 is handled. This
changes the match to do work for all instances of i?86 instead of just
i686. The Yocto Project still uses i586 as a target.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2015-11-17 15:12:15 +05:30