about summary refs log tree commit diff
path: root/src/test/codegen-units
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-09-21 19:17:24 -0700
committerGitHub <noreply@github.com>2016-09-21 19:17:24 -0700
commit1cf592fa40ca4104b59b867817881ca056f408ad (patch)
tree19a912a724e96de8d4bf50a02407ef592d21459e /src/test/codegen-units
parent4f9812a59ab7247f0f52b01ca89b0793a2d289c3 (diff)
parent4ac30013c3402d9349f83888a9d0903f0a68746e (diff)
downloadrust-1cf592fa40ca4104b59b867817881ca056f408ad.tar.gz
rust-1cf592fa40ca4104b59b867817881ca056f408ad.zip
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
Diffstat (limited to 'src/test/codegen-units')
-rw-r--r--src/test/codegen-units/item-collection/instantiation-through-vtable.rs1
-rw-r--r--src/test/codegen-units/item-collection/unsizing.rs1
-rw-r--r--src/test/codegen-units/partitioning/vtable-through-const.rs1
3 files changed, 3 insertions, 0 deletions
diff --git a/src/test/codegen-units/item-collection/instantiation-through-vtable.rs b/src/test/codegen-units/item-collection/instantiation-through-vtable.rs
index b7725251220..ad466671cf7 100644
--- a/src/test/codegen-units/item-collection/instantiation-through-vtable.rs
+++ b/src/test/codegen-units/item-collection/instantiation-through-vtable.rs
@@ -31,6 +31,7 @@ impl<T> Trait for Struct<T> {
 fn main() {
     let s1 = Struct { _a: 0u32 };
 
+    //~ TRANS_ITEM drop-glue i8
     //~ TRANS_ITEM fn instantiation_through_vtable::{{impl}}[0]::foo[0]<u32>
     //~ TRANS_ITEM fn instantiation_through_vtable::{{impl}}[0]::bar[0]<u32>
     let _ = &s1 as &Trait;
diff --git a/src/test/codegen-units/item-collection/unsizing.rs b/src/test/codegen-units/item-collection/unsizing.rs
index 45ba441bc8b..cd4cc258f7a 100644
--- a/src/test/codegen-units/item-collection/unsizing.rs
+++ b/src/test/codegen-units/item-collection/unsizing.rs
@@ -57,6 +57,7 @@ fn main()
 {
     // simple case
     let bool_sized = &true;
+    //~ TRANS_ITEM drop-glue i8
     //~ TRANS_ITEM fn unsizing::{{impl}}[0]::foo[0]
     let _bool_unsized = bool_sized as &Trait;
 
diff --git a/src/test/codegen-units/partitioning/vtable-through-const.rs b/src/test/codegen-units/partitioning/vtable-through-const.rs
index ee5e97cd9c2..0007eaae289 100644
--- a/src/test/codegen-units/partitioning/vtable-through-const.rs
+++ b/src/test/codegen-units/partitioning/vtable-through-const.rs
@@ -69,6 +69,7 @@ mod mod1 {
 
 //~ TRANS_ITEM fn vtable_through_const::main[0] @@ vtable_through_const[External]
 fn main() {
+    //~ TRANS_ITEM drop-glue i8 @@ vtable_through_const[Internal]
 
     // Since Trait1::do_something() is instantiated via its default implementation,
     // it is considered a generic and is instantiated here only because it is