summary refs log tree commit diff
path: root/src/librustc/metadata/decoder.rs
AgeCommit message (Collapse)AuthorLines
2014-01-01syntax::codemap: Add static DUMMY_SPklutzy-1/+1
It replaces `dummy_sp()`.
2013-12-29Rename PkgId to CrateIdLuis de Bethencourt-1/+1
2013-12-29Rename pkgid variablesLuis de Bethencourt-1/+1
2013-12-26librustc: De-`@mut` the `cnum_map`Patrick Walton-3/+9
2013-12-26librustc: De-`@mut` several instances of `io::Writer`.Patrick Walton-3/+3
There are a few more related to pretty printing.
2013-12-26librustc: De-`@mut` `Rib::bindings`Patrick Walton-0/+1
2013-12-19Purge @-boxes from the reading half of EBMLAlex Crichton-58/+60
Now that the metadata is an owned value with a lifetime of a borrowed byte slice, it's possible to have future optimizations where the metadata doesn't need to be copied around (very expensive operation).
2013-12-11Make 'self lifetime illegal.Erik Price-2/+2
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-10Make crate hash stable and externally computable.Jack Moffitt-5/+3
This replaces the link meta attributes with a pkgid attribute and uses a hash of this as the crate hash. This makes the crate hash computable by things other than the Rust compiler. It also switches the hash function ot SHA1 since that is much more likely to be available in shell, Python, etc than SipHash. Fixes #10188, #8523.
2013-12-08Remove dead codesKiet Tran-272/+0
2013-12-04std::str: remove from_utf8.Huon Wilson-2/+2
This function had type &[u8] -> ~str, i.e. it allocates a string internally, even though the non-allocating version that take &[u8] -> &str and ~[u8] -> ~str are all that is necessary in most circumstances.
2013-11-30Support OSX frameworksAlex Crichton-2/+7
This adds support to link to OSX frameworks via the new link attribute when using `kind = "framework"`. It is a compiler error to request linkage to a framework when the target is not macos because other platforms don't support frameworks. Closes #2023
2013-11-30Test fixes and merge conflictsAlex Crichton-2/+2
2013-11-29Add generation of static libraries to rustcAlex Crichton-0/+10
This commit implements the support necessary for generating both intermediate and result static rust libraries. This is an implementation of my thoughts in https://mail.mozilla.org/pipermail/rust-dev/2013-November/006686.html. When compiling a library, we still retain the "lib" option, although now there are "rlib", "staticlib", and "dylib" as options for crate_type (and these are stackable). The idea of "lib" is to generate the "compiler default" instead of having too choose (although all are interchangeable). For now I have left the "complier default" to be a dynamic library for size reasons. Of the rust libraries, lib{std,extra,rustuv} will bootstrap with an rlib/dylib pair, but lib{rustc,syntax,rustdoc,rustpkg} will only be built as a dynamic object. I chose this for size reasons, but also because you're probably not going to be embedding the rustc compiler anywhere any time soon. Other than the options outlined above, there are a few defaults/preferences that are now opinionated in the compiler: * If both a .dylib and .rlib are found for a rust library, the compiler will prefer the .rlib variant. This is overridable via the -Z prefer-dynamic option * If generating a "lib", the compiler will generate a dynamic library. This is overridable by explicitly saying what flavor you'd like (rlib, staticlib, dylib). * If no options are passed to the command line, and no crate_type is found in the destination crate, then an executable is generated With this change, you can successfully build a rust program with 0 dynamic dependencies on rust libraries. There is still a dynamic dependency on librustrt, but I plan on removing that in a subsequent commit. This change includes no tests just yet. Our current testing infrastructure/harnesses aren't very amenable to doing flavorful things with linking, so I'm planning on adding a new mode of testing which I believe belongs as a separate commit. Closes #552
2013-11-28Register new snapshotsAlex Crichton-1/+1
2013-11-26auto merge of #10670 : eddyb/rust/node-u32, r=alexcrichtonbors-6/+6
### Rationale There is no reason to support more than 2³² nodes or names at this moment, as compiling something that big (even without considering the quadratic space usage of some analysis passes) would take at least **64GB**. Meanwhile, some can't (or barely can) compile rustc because it requires almost **1.5GB**. ### Potential problems Can someone confirm this doesn't affect metadata (de)serialization? I can't tell myself, I know nothing about it. ### Results Some structures have a size reduction of 25% to 50%: [before](https://gist.github.com/luqmana/3a82a51fa9c86d9191fa) - [after](https://gist.github.com/eddyb/5a75f8973d3d8018afd3). Sadly, there isn't a massive change in the memory used for compiling stage2 librustc (it doesn't go over **1.4GB** as [before](http://huonw.github.io/isrustfastyet/mem/), but I can barely see the difference). However, my own testcase (previously peaking at **1.6GB** in typeck) shows a reduction of **200**-**400MB**.
2013-11-27Shink NodeId, CrateNum, Name and Mrk down to 32 bits on x64.Eduard Burtescu-6/+6
2013-11-26librustc: Remove non-procedure uses of `do` from librustc, librustdoc,Patrick Walton-96/+95
and librustpkg.
2013-11-26librustc: Remove remaining uses of `&fn()` in favor of `||`.Patrick Walton-7/+7
2013-11-19librustc: Change most uses of `&fn()` to `||`.Patrick Walton-13/+14
2013-11-11Move std::rt::io to std::ioAlex Crichton-2/+2
2013-11-08Introduce new variance inference pass that replaces (and generalizes) oldNiko Matsakis-0/+8
region-parameterization/variance inference. We now compute variance for type parameters but do not make use of it (most of the way towards #3598).
2013-11-08Generalize AST and ty::Generics to accept multiple lifetimes.Niko Matsakis-24/+34
2013-11-01Stop propagating link arguments across cratesAlex Crichton-10/+0
This is a fairly brittle modle that doesn't scale well across many crates. It's unlikely that all of the downstream crates will have all of the original native dependencies of all the upstream crates. In the case that FFI functions are reachable, then it should be the responsibility of the downstream crate to link against the correct library, or the upstream crate should prevent the functions from being reachable.
2013-10-24Remove std::io once and for all!Alex Crichton-4/+5
2013-10-24Remove even more of std::ioAlex Crichton-19/+17
Big fish fried here: extra::json most of the compiler extra::io_util removed extra::fileinput removed Fish left to fry extra::ebml
2013-10-22libsyntax/librustc: Allow specifying mut on ~self.Luqman Aden-1/+1
2013-10-22libsyntax/librustc: Allow specifying mut on by-value self.Luqman Aden-1/+1
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-17/+17
Who doesn't like a massive renaming?
2013-10-09option: rewrite the API to use compositionDaniel Micay-4/+4
2013-10-07Extract privacy checking from name resolutionAlex Crichton-2/+3
This commit is the culmination of my recent effort to refine Rust's notion of privacy and visibility among crates. The major goals of this commit were to remove privacy checking from resolve for the sake of sane error messages, and to attempt a much more rigid and well-tested implementation of visibility throughout rust. The implemented rules for name visibility are: 1. Everything pub from the root namespace is visible to anyone 2. You may access any private item of your ancestors. "Accessing a private item" depends on what the item is, so for a function this means that you can call it, but for a module it means that you can look inside of it. Once you look inside a private module, any accessed item must be "pub from the root" where the new root is the private module that you looked into. These rules required some more analysis results to get propagated from trans to privacy in the form of a few hash tables. I added a new test in which my goal was to showcase all of the privacy nuances of the language, and I hope to place any new bugs into this file to prevent regressions. Overall, I was unable to completely remove the notion of privacy from resolve. One use of privacy is for dealing with glob imports. Essentially a glob import can only import *public* items from the destination, and because this must be done at namespace resolution time, resolve must maintain the notion of "what items are public in a module". There are some sad approximations of privacy, but I unfortunately can't see clear methods to extract them outside. The other use case of privacy in resolve now is one that must stick around regardless of glob imports. When dealing with privacy, checking a private path needs to know "what the last private thing was" when looking at a path. Resolve is the only compiler pass which knows the answer to this question, so it maintains the answer on a per-path resolution basis (works similarly to the def_map generated). Closes #8215
2013-09-30rustc: Remove usage of fmt!Alex Crichton-27/+27
2013-09-26Add 'continue' as a synonym for 'loop'Brian Anderson-11/+11
2013-09-24Correctly encode item visibility in metadataAlex Crichton-17/+26
This fixes private statics and functions from being usable cross-crates, along with some bad privacy error messages. This is a reopening of #8365 with all the privacy checks in privacy.rs instead of resolve.rs (where they should be anyway). These maps of exported items will hopefully get used for generating documentation by rustdoc Closes #8592
2013-09-12std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}Erick Tryzelaar-1/+1
2013-09-11ident->name cleanupJohn Clements-2/+3
2013-09-11Properly encode/decode structural variants.SiegeLord-7/+14
2013-09-05Rename str::from_bytes to str::from_utf8, closes #8985Florian Hahn-1/+1
2013-09-04auto merge of #8875 : alexcrichton/rust/fix-inner-static-library-bug, r=huonwbors-0/+9
These commits fix bugs related to identically named statics in functions of implementations in various situations. The commit messages have most of the information about what bugs are being fixed and why. As a bonus, while I was messing around with name mangling, I improved the backtraces we'll get in gdb by removing `__extensions__` for the trait/type being implemented and by adding the method name as well. Yay!
2013-09-03Modernized a few more types in syntax::astMarvin Löbel-47/+47
2013-09-02Remove __extensions__ in names for a "pretty name"Alex Crichton-0/+9
As with the previous commit, this is targeted at removing the possibility of collisions between statics. The main use case here is when there's a type-parametric function with an inner static that's compiled as a library. Before this commit, any impl would generate a path item of "__extensions__". This changes this identifier to be a "pretty name", which is either the last element of the path of the trait implemented or the last element of the type's path that's being implemented. That doesn't quite cut it though, so the (trait, type) pair is hashed and again used to append information to the symbol. Essentially, __extensions__ was removed for something nicer for debugging, and then some more information was added to symbol name by including a hash of the trait being implemented and type it's being implemented for. This should prevent colliding names for inner statics in regular functions with similar names.
2013-09-02Renamed syntax::ast::ident -> IdentMarvin Löbel-9/+9
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-78/+78
2013-08-27auto merge of #8805 : jfager/rust/remove-hashutil, r=alexcrichtonbors-1/+0
2013-08-27librustc: Fix problem with cross-crate reexported static methods.Patrick Walton-6/+50
2013-08-27librustc: Implement basic lazy implementation loading.Patrick Walton-1/+61
This is only for implementations defined in the same crate as the trait they implement.
2013-08-27librustc: Remove `each_path`.Patrick Walton-37/+103
This does not implement lazy symbol resolution yet.
2013-08-27librustc: Stop calling `each_path` in coherence.Patrick Walton-0/+10
10% win or so for small crates.
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-8/+12
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-27librustc: Remove `&const` and `*const` from the language.Patrick Walton-6/+3
They are still present as part of the borrow check.