about summary refs log tree commit diff
path: root/src/librustc/metadata/common.rs
AgeCommit message (Collapse)AuthorLines
2015-11-26split the metadata code into rustc_metadataAriel Ben-Yehuda-253/+0
tests & rustdoc still broken
2015-10-02unify the 2 impl indexesAriel Ben-Yehuda-13/+7
2015-10-02Merge branch 'master' into metadietAriel Ben-Yehuda-7/+10
rlib sizes: 1445222 liballoc_jemalloc-bb943c5a.rlib 10664 liballoc_system-bb943c5a.rlib 143592 libarena-bb943c5a.rlib 3639102 libcollections-bb943c5a.rlib 16316910 libcore-bb943c5a.rlib 214154 libflate-bb943c5a.rlib 231440 libfmt_macros-bb943c5a.rlib 536976 libgetopts-bb943c5a.rlib 209672 libgraphviz-bb943c5a.rlib 408008 liblibc-bb943c5a.rlib 189610 liblog-bb943c5a.rlib 662184 librand-bb943c5a.rlib 605112 librbml-bb943c5a.rlib 1397820 librustc_back-bb943c5a.rlib 38383772 librustc-bb943c5a.rlib 12842 librustc_bitflags-bb943c5a.rlib 2297822 librustc_borrowck-bb943c5a.rlib 571064 librustc_data_structures-bb943c5a.rlib 9356542 librustc_driver-bb943c5a.rlib 9477226 librustc_front-bb943c5a.rlib 1605698 librustc_lint-bb943c5a.rlib 77111720 librustc_llvm-bb943c5a.rlib 4783848 librustc_mir-bb943c5a.rlib 3534256 librustc_platform_intrinsics-bb943c5a.rlib 593038 librustc_privacy-bb943c5a.rlib 3122202 librustc_resolve-bb943c5a.rlib 14185212 librustc_trans-bb943c5a.rlib 11940328 librustc_typeck-bb943c5a.rlib 1634264 librustc_unicode-bb943c5a.rlib 15564160 librustdoc-bb943c5a.rlib 8153964 libstd-bb943c5a.rlib 30589338 libsyntax-bb943c5a.rlib 897110 libterm-bb943c5a.rlib 1360662 libtest-bb943c5a.rlib
2015-10-01remove the code that encodes type parameter defsAriel Ben-Yehuda-3/+1
there are no type parameter defs in the relevant range
2015-10-01don't store method_ftyAriel Ben-Yehuda-2/+1
It is redundant with the item type. This is not much of a win, as there are really not *that* many methods, but it makes the code uglier.
2015-10-01don't duplicate item types between encoder <-> astencodeAriel Ben-Yehuda-1/+1
a 5% win on libcore 512576 liballoc-bb943c5a.rlib 1425106 liballoc_jemalloc-bb943c5a.rlib 10070 liballoc_system-bb943c5a.rlib 141332 libarena-bb943c5a.rlib 3611586 libcollections-bb943c5a.rlib 16293400 libcore-bb943c5a.rlib 195018 libflate-bb943c5a.rlib 231940 libfmt_macros-bb943c5a.rlib 532704 libgetopts-bb943c5a.rlib 208094 libgraphviz-bb943c5a.rlib 383522 liblibc-bb943c5a.rlib 183786 liblog-bb943c5a.rlib 658332 librand-bb943c5a.rlib 567676 librbml-bb943c5a.rlib 1376114 librustc_back-bb943c5a.rlib 37134688 librustc-bb943c5a.rlib 12826 librustc_bitflags-bb943c5a.rlib 2241942 librustc_borrowck-bb943c5a.rlib 513598 librustc_data_structures-bb943c5a.rlib 9340348 librustc_driver-bb943c5a.rlib 8880472 librustc_front-bb943c5a.rlib 1590548 librustc_lint-bb943c5a.rlib 79149202 librustc_llvm-bb943c5a.rlib 4536740 librustc_mir-bb943c5a.rlib 3528866 librustc_platform_intrinsics-bb943c5a.rlib 588514 librustc_privacy-bb943c5a.rlib 3068562 librustc_resolve-bb943c5a.rlib 13982508 librustc_trans-bb943c5a.rlib 11799790 librustc_typeck-bb943c5a.rlib 1637532 librustc_unicode-bb943c5a.rlib 15611582 librustdoc-bb943c5a.rlib 2649520 libserialize-bb943c5a.rlib 8095050 libstd-bb943c5a.rlib 29391260 libsyntax-bb943c5a.rlib 891210 libterm-bb943c5a.rlib
2015-10-01share stored predicatesAriel Ben-Yehuda-3/+3
while most of the duplication in predicates was caused by stubs, this is still a 5% win on libcore. 567924 liballoc-bb943c5a.rlib 1425564 liballoc_jemalloc-bb943c5a.rlib 10520 liballoc_system-bb943c5a.rlib 154842 libarena-bb943c5a.rlib 4113790 libcollections-bb943c5a.rlib 18513674 libcore-bb943c5a.rlib 199466 libflate-bb943c5a.rlib 249548 libfmt_macros-bb943c5a.rlib 560488 libgetopts-bb943c5a.rlib 226772 libgraphviz-bb943c5a.rlib 442966 liblibc-bb943c5a.rlib 189884 liblog-bb943c5a.rlib 736764 librand-bb943c5a.rlib 609874 librbml-bb943c5a.rlib 1411678 librustc_back-bb943c5a.rlib 38770354 librustc-bb943c5a.rlib 12868 librustc_bitflags-bb943c5a.rlib 2327196 librustc_borrowck-bb943c5a.rlib 582178 librustc_data_structures-bb943c5a.rlib 9379344 librustc_driver-bb943c5a.rlib 9540324 librustc_front-bb943c5a.rlib 1614996 librustc_lint-bb943c5a.rlib 79217876 librustc_llvm-bb943c5a.rlib 4833518 librustc_mir-bb943c5a.rlib 3535794 librustc_platform_intrinsics-bb943c5a.rlib 603190 librustc_privacy-bb943c5a.rlib 3158032 librustc_resolve-bb943c5a.rlib 14300126 librustc_trans-bb943c5a.rlib 12024054 librustc_typeck-bb943c5a.rlib 1834852 librustc_unicode-bb943c5a.rlib 15611582 librustdoc-bb943c5a.rlib 2926594 libserialize-bb943c5a.rlib 8780060 libstd-bb943c5a.rlib 30772000 libsyntax-bb943c5a.rlib 917984 libterm-bb943c5a.rlib 1369754 libtest-bb943c5a.rlib
2015-10-01add a cross-reference indexAriel Ben-Yehuda-2/+4
it still does not *do* anything
2015-10-01remove unneeded tags from metadataAriel Ben-Yehuda-19/+7
stage1 release rlib sizes: 580890 liballoc-bb943c5a.rlib 1425558 liballoc_jemalloc-bb943c5a.rlib 10514 liballoc_system-bb943c5a.rlib 157192 libarena-bb943c5a.rlib 4316234 libcollections-bb943c5a.rlib 19580128 libcore-bb943c5a.rlib 199498 libflate-bb943c5a.rlib 249328 libfmt_macros-bb943c5a.rlib 560406 libgetopts-bb943c5a.rlib 233620 libgraphviz-bb943c5a.rlib 442964 liblibc-bb943c5a.rlib 190178 liblog-bb943c5a.rlib 778488 librand-bb943c5a.rlib 621972 librbml-bb943c5a.rlib 1415040 librustc_back-bb943c5a.rlib 38849082 librustc-bb943c5a.rlib 12862 librustc_bitflags-bb943c5a.rlib 2331690 librustc_borrowck-bb943c5a.rlib 616880 librustc_data_structures-bb943c5a.rlib 9386582 librustc_driver-bb943c5a.rlib 9600440 librustc_front-bb943c5a.rlib 1615058 librustc_lint-bb943c5a.rlib 79218480 librustc_llvm-bb943c5a.rlib 5020974 librustc_mir-bb943c5a.rlib 3535448 librustc_platform_intrinsics-bb943c5a.rlib 603640 librustc_privacy-bb943c5a.rlib 3163628 librustc_resolve-bb943c5a.rlib 14326646 librustc_trans-bb943c5a.rlib 12033174 librustc_typeck-bb943c5a.rlib 1838202 librustc_unicode-bb943c5a.rlib 15611582 librustdoc-bb943c5a.rlib 3056280 libserialize-bb943c5a.rlib 8954312 libstd-bb943c5a.rlib 30906736 libsyntax-bb943c5a.rlib 925480 libterm-bb943c5a.rlib 1377952 libtest-bb943c5a.rlib
2015-10-01Convert DefId to use DefIndex, which is an index into a list ofNiko Matsakis-7/+12
paths, and construct paths for all definitions. Also, stop rewriting DefIds for closures, and instead just load the closure data from the original def-id, which may be in another crate.
2015-10-01kill the fake provided method stubsAriel Ben-Yehuda-1/+1
this simplifies the code while reducing the size of libcore.rlib by 3.3 MiB (~1M of which is bloat a separate patch of mine removes too), while reducing rustc memory usage on small crates by 18MiB. This also simplifies the code considerably.
2015-09-29store the rustc version in metadata and check itAriel Ben-Yehuda-0/+8
This prevents ICEs when old crates are used with a new version of rustc. Currently, the linking of crates compiled with different versions of rustc is completely unsupported. Fixes #28700
2015-09-03rewrite metadata indexingAriel Ben-Yehuda-7/+1
this improves the compilation time for small crates by ~20%
2015-08-14rustc: Allow changing the default allocatorAlex Crichton-3/+4
This commit is an implementation of [RFC 1183][rfc] which allows swapping out the default allocator on nightly Rust. No new stable surface area should be added as a part of this commit. [rfc]: https://github.com/rust-lang/rfcs/pull/1183 Two new attributes have been added to the compiler: * `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to indicate that it requires an allocator crate to be in scope. * `#![allocator]` - this is a indicator that the crate is an allocator which can satisfy the `needs_allocator` attribute above. The ABI of the allocator crate is defined to be a set of symbols that implement the standard Rust allocation/deallocation functions. The symbols are not currently checked for exhaustiveness or typechecked. There are also a number of restrictions on these crates: * An allocator crate cannot transitively depend on a crate that is flagged as needing an allocator (e.g. allocator crates can't depend on liballoc). * There can only be one explicitly linked allocator in a final image. * If no allocator is explicitly requested one will be injected on behalf of the compiler. Binaries and Rust dylibs will use jemalloc by default where available and staticlibs/other dylibs will use the system allocator by default. Two allocators are provided by the distribution by default, `alloc_system` and `alloc_jemalloc` which operate as advertised. Closes #27389
2015-08-10trans: Stop informing LLVM about dllexportAlex Crichton-2/+2
Rust's current compilation model makes it impossible on Windows to generate one object file with a complete and final set of dllexport annotations. This is because when an object is generated the compiler doesn't actually know if it will later be included in a dynamic library or not. The compiler works around this today by flagging *everything* as dllexport, but this has the drawback of exposing too much. Thankfully there are alternate methods of specifying the exported surface area of a dll on Windows, one of which is passing a `*.def` file to the linker which lists all public symbols of the dynamic library. This commit removes all locations that add `dllexport` to LLVM variables and instead dynamically generates a `*.def` file which is passed to the linker. This file will include all the public symbols of the current object file as well as all upstream libraries, and the crucial aspect is that it's only used when generating a dynamic library. When generating an executable this file isn't generated, so all the symbols aren't exported from an executable. To ensure that statically included native libraries are reexported correctly, the previously added support for the `#[linked_from]` attribute is used to determine the set of FFI symbols that are exported from a dynamic library, and this is required to get the compiler to link correctly.
2015-05-26Remove ObjectCastMapAriel Ben-Yehuda-1/+1
2015-05-21rustc: const-qualify `const fn` function and method calls.Eduard Burtescu-0/+2
2015-05-19Overhaul cast semantics and make them follow RFC401Ariel Ben-Yehuda-0/+1
This should hopefully fix all cast-related ICEs once and for all. I managed to make diagnostics hate me and give me spurious "decoder error" - removing $build/tmp/extended-errors seems to fix it.
2015-05-13eddyb's changes for DST coercionsNick Cameron-0/+2
+ lots of rebasing
2015-05-12Fix ty::populate_implementations_for_trait_if_necessary to load the trait's ↵Eduard Burtescu-0/+1
impls from all the crates.
2015-04-21std: Remove deprecated/unstable num functionalityAlex Crichton-31/+33
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change]
2015-04-01Fallout out rustcNiko Matsakis-1/+1
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-109/+109
Now that support has been removed, all lingering use cases are renamed.
2015-03-06Change the data structures for tracking defaulted traits. In the tcx, weNiko Matsakis-0/+2
now have a simple set of trait def-ids. During coherence, we use a separate table to track the default impls for any given trait so that we can report a nice error. This fixes various bugs in the metadata encoding that led to `ty::trait_has_default_impl` yielding the wrong values in the cross-crate case. (In particular, default impl def-ids were not included in the list of all impl def-ids; I debated fixing just that, but this approach seemed cleaner overall, since we usually treat the "defaulted" bit on traits as being a property of the trait, and now iterating over a list of impls doesn't intermingle default impls with normal impls.)
2015-03-04Separate supertrait collection from processing a `TraitDef`. This allowsNiko Matsakis-3/+2
us to construct trait-references and do other things without forcing a full evaluation of the supertraits. One downside of this scheme is that we must invoke `ensure_super_predicates` before using any construct that might require knowing about the super-predicates.
2015-03-04Encode codemap and span information in crate metadata.Michael Woerister-0/+3
This allows to create proper debuginfo line information for items inlined from other crates (e.g. instantiations of generics). Only the codemap's 'metadata' is stored in a crate's metadata. That is, just filename, line-beginnings, etc. but not the actual source code itself. We are thus missing the opportunity of making Rust the first "open-source-only" programming language out there. Pity.
2015-03-03metadata: Flatten `tag_table_id` and `tag_table_val` tags.Kang Seonghoon-2/+1
This avoids a biggish eight-byte `tag_table_id` tag in favor of autoserialized integer tags, which are smaller and can be later used to encode them in the optimal number of bytes. `NodeId` was u32 after all. Previously: <------------- len1 --------------> tag_table_* <len1> tag_table_id 88 <nodeid in 8 bytes> tag_table_val <len2> <actual data> <-- len2 ---> Now: <--------------- len ---------------> tag_table_* <len> U32 <nodeid in 4 bytes> <actual data>
2015-03-03metadata: New tag encoding scheme.Kang Seonghoon-141/+140
EBML tags are encoded in a variable-length unsigned int (vuint), which is clever but causes some tags to be encoded in two bytes while there are really about 180 tags or so. Assuming that there wouldn't be, say, over 1,000 tags in the future, we can use much more efficient encoding scheme. The new scheme should support at most 4,096 tags anyway. This also flattens a scattered tag namespace (did you know that 0xa9 is followed by 0xb0?) and makes a room for autoserialized tags in 0x00 through 0x1f.
2015-02-16rustc: qualify expressions in check_const for potential promotion.Eduard Burtescu-0/+1
2015-02-16rustc: use FromPrimitive for decoding astencode_tag.Eduard Burtescu-13/+1
2015-02-01Separate out the unboxed closure table into two tables, so that we canNiko Matsakis-8/+6
generate the closure type and closure kind separately.
2015-01-30Use `#[rustc_paren_sugar]` as a more extensible way of deciding whenNiko Matsakis-0/+2
paren sugar is legal.
2015-01-30Remove the capture mode map and just store the capture mode for individual ↵Niko Matsakis-1/+1
variables. Also add test. Fixes #16749.
2015-01-29s/Show/Debug/gJorge Aparicio-1/+1
2015-01-26Remove "unboxed" attribute in code referring to new closures.Eduard Burtescu-5/+5
2015-01-05Reformat metadata for exported macrosKeegan McAllister-2/+6
Instead of copy-pasting the whole macro_rules! item from the original .rs file, we serialize a separate name, attributes list, and body, the latter as pretty-printed TTs. The compilation of macro_rules! macros is decoupled somewhat from the expansion of macros in item position. This filters out comments, and facilitates selective imports.
2015-01-04Add syntax for negative implementations of traitsFlavio Percoco-0/+2
This commit introduces the syntax for negative implmenetations of traits as shown below: `impl !Trait for Type {}` cc #13231 Part of RFC #3
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-2/+2
2014-12-30Implement associated type projection and normalization.Niko Matsakis-0/+3
2014-12-19librustc: use `#[deriving(Copy)]`Jorge Aparicio-2/+1
2014-12-14Parse `unsafe trait` but do not do anything with it beyond parsing and ↵Niko Matsakis-0/+2
integrating into rustdoc etc.
2014-12-12Switch to using predicates to drive checking. Correct various tests --Niko Matsakis-0/+4
in most cases, just the error message changed, but in some cases we are reporting new errors that OUGHT to have been reported before but we're overlooked (mostly involving the `'static` bound on `Send`).
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-0/+2
This change makes the compiler no longer infer whether types (structures and enumerations) implement the `Copy` trait (and thus are implicitly copyable). Rather, you must implement `Copy` yourself via `impl Copy for MyType {}`. A new warning has been added, `missing_copy_implementations`, to warn you if a non-generic public type has been added that could have implemented `Copy` but didn't. For convenience, you may *temporarily* opt out of this behavior by using `#![feature(opt_out_copy)]`. Note though that this feature gate will never be accepted and will be removed by the time that 1.0 is released, so you should transition your code away from using it. This breaks code like: #[deriving(Show)] struct Point2D { x: int, y: int, } fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } Change this code to: #[deriving(Show)] struct Point2D { x: int, y: int, } impl Copy for Point2D {} fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } This is the backwards-incompatible part of #13231. Part of RFC #3. [breaking-change]
2014-11-17Switch to purely namespaced enumsSteven Fackler-0/+2
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-11-03Clean-up transmutes in librustcAriel Ben-Yehuda-2/+1
None of them would break by implementation-defined struct layout, but one would break with strict lifetime aliasing, and the rest are just ugly code.
2014-10-28Update code with new lint namesAaron Turon-1/+1
2014-10-09rustc: Convert statics to constantsAlex Crichton-101/+101
2014-10-03Set the `non_uppercase_statics` lint to warn by defaultP1start-1/+1
2014-09-30librustc: Stop looking in metadata in type contents.Patrick Walton-0/+2
4x improvement in pre-trans compile time for rustc.
2014-09-15trans -- stop tracking vtables precisely, instead recompute as needed.Niko Matsakis-1/+2