Commit Graph

57766 Commits

Author SHA1 Message Date
Jeffrey Seyfried
85bfd82be6 Avoid reconstructing the BuildReducedGraphVisitor. 2016-09-22 07:18:16 +00:00
Jeffrey Seyfried
a344f14caa Refactor out BuildReducedGraphVisitor::visit_trait_item. 2016-09-22 07:17:23 +00:00
Jeffrey Seyfried
9a0e88a339 Refactor away ParentLink. 2016-09-22 07:13:54 +00:00
bors
6ad10844db Auto merge of #36585 - jonathandturner:misc_error_touchups, r=nrc
Add the ability to merge spans to codemap

This PR adds the ability to merge Spans.  To do so, it builds on the Codemap's ability to verify the locations of spans, namely that following can be verified:

* the expn_id of both spans much match
* the lhs span needs to end on the same line the rhs span begins
* the lhs span must start at or before the rhs span

If all of these are met, a new span is returned that is min(lo), max(hi) of the two spans.

This PR also removes an older Span merge, as this new functionality subsumes it.

r? @nrc
2016-09-21 22:40:51 -07:00
bors
1cf592fa40 Auto merge of #36551 - eddyb:meta-games, r=nikomatsakis
Refactor away RBML from rustc_metadata.

RBML and `ty{en,de}code` have had their long-overdue purge. Summary of changes:
* Metadata is now a tree encoded in post-order and with relative backward references pointing to children nodes. With auto-deriving and type safety, this makes maintenance and adding new information to metadata painless and bug-free by default. It's also more compact and cache-friendly (cache misses should be proportional to the depth of the node being accessed, not the number of siblings as in EBML/RBML).
* Metadata sizes have been reduced, for `libcore` it went down 16% (`8.38MB` -> `7.05MB`) and for `libstd` 14% (`3.53MB` -> `3.03MB`), while encoding more or less the same information
* Specialization is used in the bundled `libserialize` (crates.io `rustc_serialize` remains unaffected) to customize the encoding (and more importantly, decoding) of various types, most notably those interned in the `TyCtxt`. Some of this abuses a soundness hole pending a fix (cc @aturon), but when that fix arrives, we'll move to macros 1.1 `#[derive]` and custom `TyCtxt`-aware serialization traits.
* Enumerating children of modules from other crates is now orthogonal to describing those items via `Def` - this is a step towards bridging crate-local HIR and cross-crate metadata
* `CrateNum` has been moved to `rustc` and both it and `NodeId` are now newtypes instead of `u32` aliases, for specializing their decoding. This is `[syntax-breaking]` (cc @Manishearth ).

cc @rust-lang/compiler
2016-09-21 19:17:24 -07:00
bors
4f9812a59a Auto merge of #36496 - pnkfelix:workaround-issue-34427, r=eddyb
Workaround #34427 by using memset of 0 on ARM to set the discriminant.

Workaround #34427 by using memset of 0 on ARM to set the discriminant.
2016-09-21 15:58:39 -07:00
Jeffrey Seyfried
f4fa62f4f2 Add regression test. 2016-09-21 21:39:41 +00:00
Nick Cameron
6a2d2c9495 Adds a ProcMacro form of syntax extension
This commit adds syntax extension forms matching the types for procedural macros 2.0 (RFC #1566), these still require the usual syntax extension boiler plate, but this is a first step towards proper implementation and should be useful for macros 1.1 stuff too.

Supports both attribute-like and function-like macros.
2016-09-22 08:47:57 +12:00
Christopher Serr
e107c8b849 Fix outdated Doc Comment on BufReader::seek
A long time ago non-panicking `unwrap` methods were renamed to `into_inner` in this Pull Request: https://github.com/rust-lang/rust/pull/19149

Looks like this doc comment was not updated however.
2016-09-21 21:11:53 +02:00
Keegan McAllister
c316ae56e6 Tweak std::rc docs
Fixes #29372.
2016-09-21 10:25:01 -07:00
bors
53f9730291 Auto merge of #35074 - ashleygwilliams:assert_ne, r=steveklabnik
add debug_assert_ne + assert_ne

~~ work in progress, please do not merge ~~

fixes #35073
2016-09-21 08:12:37 -07:00
Ashley Williams
3d8d55787b add assert_ne and debug_assert_ne macros 2016-09-21 14:38:26 +02:00
Jeffrey Seyfried
4db157af71 Allow attribute macro invocations at the crate root. 2016-09-21 09:24:06 +00:00
bors
5cc6c6b1b7 Auto merge of #36524 - michaelwoerister:trans-inline-only-on-demand, r=nikomatsakis
trans: Only instantiate #[inline] functions in codegen units referencing them

This PR changes how `#[inline]` functions are translated. Before, there was one "master instance" of the function with `external` linkage and a number of on-demand instances with `available_externally` linkage in each codegen unit that referenced the function. This had two downsides:

* Public functions marked with `#[inline]` would be present in machine code of libraries unnecessarily (see #36280 for an example)
* LLVM would crash on `i686-pc-windows-msvc` due to what I suspect to be a bug in LLVM's Win32 exception handling code, because it doesn't like `available_externally` there (#36309).

This PR changes the behavior, so that there is no master instance and only on-demand instances with `internal` linkage. The downside of this is potential code-bloat if LLVM does not completely inline away the `internal` instances because then there'd be N instances of the function instead of 1. However, this can only become a problem when using more than one codegen unit per crate.

cc @rust-lang/compiler
2016-09-21 01:33:37 -07:00
Jonathan Turner
e4b18422ad Check for overlapping and simplify unit test 2016-09-20 15:39:05 -07:00
aclarry
23efc5453d Update E0560 to include label 2016-09-20 16:59:48 -04:00
Jorge Aparicio
adf85d35c7 libtest: add a --skip flag to the test runner
This flag takes a FILTER argument and instructs the test runner to skip
the tests whose names contain the word FILTER. --skip can be used
several times.
2016-09-20 14:27:48 -05:00
Eduard Burtescu
4ac30013c3 rustc_trans: don't do on-demand drop glue instantiation. 2016-09-20 20:30:55 +03:00
Eduard Burtescu
a2726f4a54 rustc: allow less and handle fn pointers in the type hashing algorithm. 2016-09-20 20:30:55 +03:00
Eduard Burtescu
ade79d7609 rustc_trans: simplify vtable and symbol handling. 2016-09-20 20:30:52 +03:00
Eduard Burtescu
521d3ea193 rustc_resolve: bring back "struct called like a function" cross-crate. 2016-09-20 20:08:07 +03:00
Eduard Burtescu
564f2ee33c rustc_metadata: don't die with --test because CFG_VERSION is missing. 2016-09-20 20:08:07 +03:00
Eduard Burtescu
a23b8cafec rustc: don't hash the --extern crate name, but the original one, in DefPath. 2016-09-20 20:08:06 +03:00
Eduard Burtescu
221d1a97e5 serialize: allow specifying the default behavior for specializations. 2016-09-20 20:08:06 +03:00
Eduard Burtescu
b01d4891e2 rustc: don't recurse through nested items in decoded HIR fragments. 2016-09-20 20:08:06 +03:00
Eduard Burtescu
f2283a7be0 rustc_metadata: fix for the new ? ambiguity around collect. 2016-09-20 20:08:06 +03:00
Eduard Burtescu
dadbaa48ac rustc_metadata: move opt_item_name to TyCtxt::item_name. 2016-09-20 20:08:06 +03:00
Eduard Burtescu
dc26a23301 rustc_metadata: reduce Lazy{,Seq} overhead by using a relative encoding. 2016-09-20 20:08:05 +03:00
Eduard Burtescu
a96abca2a4 rustc_metadata: replace RBML with a simple and type-safe scheme. 2016-09-20 20:08:05 +03:00
Eduard Burtescu
24aef24e1a rustc_metadata: split the Def description of a DefId from item_children. 2016-09-20 20:08:05 +03:00
Eduard Burtescu
adddfccf2b rustc_metadata: move all encoding/decoding helpers to methods. 2016-09-20 20:08:05 +03:00
Eduard Burtescu
6890354f3b rustc_metadata: use the shorthand encoding for predicates also. 2016-09-20 20:08:04 +03:00
Eduard Burtescu
cc47dc5c6e rustc_metadata: store dense indexes in little-endian instead of big. 2016-09-20 20:08:04 +03:00
Eduard Burtescu
ef4352fba6 rustc_metadata: group information into less tags. 2016-09-20 20:08:04 +03:00
Eduard Burtescu
6742b239ac rustc_metadata: remove all unnecessary tables from astencode. 2016-09-20 20:08:03 +03:00
Eduard Burtescu
d2ea3daad1 rustc_metadata: group the tags into root tags and item tags. 2016-09-20 20:08:03 +03:00
Eduard Burtescu
89736e8671 rustc: remove ImplOrTraitItemId and TraitDef's associated_type_names. 2016-09-20 20:08:03 +03:00
Eduard Burtescu
8734aaa33e rustc_metadata: move more RBML tags to auto-serialization. 2016-09-20 20:08:02 +03:00
Eduard Burtescu
88c5679c4e rustc_metadata: remove ty{en,de}code and move to auto-derived serialization. 2016-09-20 20:08:01 +03:00
Eduard Burtescu
bcbb4107a1 rustc_metadata: side-step ty{en,de}code for everything but Ty. 2016-09-20 20:08:01 +03:00
Eduard Burtescu
0863012fb9 Remove librbml and the RBML-tagged auto-encoder/decoder. 2016-09-20 20:08:01 +03:00
Eduard Burtescu
2ce0e6d4e7 rustc_trans: use the TypeId hashing mechanism instead of metadata. 2016-09-20 20:08:00 +03:00
Eduard Burtescu
02c4155d2c rustc: remove hir::fold. 2016-09-20 20:08:00 +03:00
Eduard Burtescu
ed593bed88 rustc_metadata: go back to not using the opaque format. 2016-09-20 20:08:00 +03:00
Eduard Burtescu
903ec52ba9 rustc: replace uses of NodeId in Def, other than closures and labels. 2016-09-20 20:08:00 +03:00
Eduard Burtescu
fc363cb482 rustc_metadata: go only through rustc_serialize in astencode. 2016-09-20 20:07:54 +03:00
Eduard Burtescu
91e7239db4 rustc_metadata: combine DecodeContext and rbml::reader::Decoder. 2016-09-20 20:07:16 +03:00
mcarton
726c2b6e9b
Don't ICE when a float can't be parsed 2016-09-20 18:25:00 +02:00
Eduard Burtescu
97864d41a6 rustc_metadata: encode miscellaneous information opaquely. 2016-09-20 19:21:33 +03:00
Eduard Burtescu
3cbe4b8bce rustc_metadata: sign-extend when decoding signed integers. 2016-09-20 19:21:33 +03:00