about summary refs log tree commit diff
path: root/src/librustc/metadata
AgeCommit message (Collapse)AuthorLines
2013-09-04auto merge of #8875 : alexcrichton/rust/fix-inner-static-library-bug, r=huonwbors-6/+28
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-04stop treating char as an integer typeDaniel Micay-1/+1
Closes #7609
2013-09-04Implement support for indicating the stability of items.Huon Wilson-0/+1
There are 6 new compiler recognised attributes: deprecated, experimental, unstable, stable, frozen, locked (these levels are taken directly from Node's "stability index"[1]). These indicate the stability of the item to which they are attached; e.g. `#[deprecated] fn foo() { .. }` says that `foo` is deprecated. This comes with 3 lints for the first 3 levels (with matching names) that will detect the use of items marked with them (the `unstable` lint includes items with no stability attribute). The attributes can be given a short text note that will be displayed by the lint. An example: #[warn(unstable)]; // `allow` by default #[deprecated="use `bar`"] fn foo() { } #[stable] fn bar() { } fn baz() { } fn main() { foo(); // "warning: use of deprecated item: use `bar`" bar(); // all fine baz(); // "warning: use of unmarked item" } The lints currently only check the "edges" of the AST: i.e. functions, methods[2], structs and enum variants. Any stability attributes on modules, enums, traits and impls are not checked. [1]: http://nodejs.org/api/documentation.html [2]: the method check is currently incorrect and doesn't work.
2013-09-03Modernized a few more types in syntax::astMarvin Löbel-108/+108
2013-09-02Remove __extensions__ in names for a "pretty name"Alex Crichton-6/+28
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-25/+25
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-118/+118
2013-08-27auto merge of #8805 : jfager/rust/remove-hashutil, r=alexcrichtonbors-2/+0
2013-08-27librustc: Fix problem with cross-crate reexported static methods.Patrick Walton-8/+56
2013-08-27librustc: Implement basic lazy implementation loading.Patrick Walton-5/+158
This is only for implementations defined in the same crate as the trait they implement.
2013-08-27librustc: Remove `each_path`.Patrick Walton-43/+127
This does not implement lazy symbol resolution yet.
2013-08-27librustc: Stop calling `each_path` in coherence.Patrick Walton-1/+69
10% win or so for small crates.
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-9/+13
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: Add support for type parameters in the middle of paths.Patrick Walton-7/+16
For example, `foo::<T>::bar::<U>`. This doesn't enforce that the type parameters are in the right positions, however.
2013-08-27librustc: Remove `&const` and `*const` from the language.Patrick Walton-17/+5
They are still present as part of the borrow check.
2013-08-27Replace HashUtil w/ default method on HashJason Fager-2/+0
2013-08-26rustpkg: Test that different copies of the same package ID can exist in ↵Tim Chevalier-25/+42
multiple workspaces The test checks that rustpkg uses the first one, rather than complaining about multiple matches. Closes #7241
2013-08-26auto merge of #8758 : pnkfelix/rust/fsk-more-oldvisit-ports, r=pnkfelixbors-7/+15
Further followup on #7081. There still remains writeback.rs, but I want to wait to investigate that one because I've seen `make check` issues with it in the past.
2013-08-26Port creader.rs from oldvisit to <V:Visitor> trait API.Felix S. Klock II-7/+15
2013-08-25Revert "auto merge of #8745 : brson/rust/metadata, r=cmr"Brian Anderson-69/+64
This reverts commit 491bc3568c87dadaba4d342135bd308961c6e0ef, reversing changes made to 05f1bbba16912f63b562a7847801823872f89ec6.
2013-08-25auto merge of #8745 : brson/rust/metadata, r=cmrbors-64/+69
This does two things: 1) stops compressing metadata, 2) stops copying the metadata section, instead holding a reference to the buffer returned by the LLVM section iterator. Not compressing metadata requires something like 7x the storage space, but makes running tests about 9% faster. This has been a time improvement on all platforms I've tested, including windows. I considered leaving compression as an option but it doesn't seem to be worth the complexity since we don't currently have any use cases where we need to save that space. In order to avoid copying the metadata section I had to hack up extra::ebml a bit to support unsafe buffers. We should probably move it into librustc so that it can evolve to support the compiler without worrying about having a crummy interface. r? @graydon
2013-08-24Don't ever compress metadataBrian Anderson-37/+7
2013-08-24Make enum discriminants u64 instead of the host uint.Jed Davis-4/+4
2013-08-23Don't copy metadata after loadingBrian Anderson-59/+71
2013-08-23Allow metadata to be not compressedBrian Anderson-10/+33
2013-08-21auto merge of #8562 : bblum/rust/superkinds, r=nikomatsakisbors-1/+22
For #7083. The metadata issue with the old version is now fixed. Ready for review. This is also not the full solution to #7083, because this is not supported yet: ``` trait Foo : Send { } impl <T: Send> Foo for T { } fn foo<T: Foo>(val: T, chan: std::comm::Chan<T>) { chan.send(val); } ``` cc @nikomatsakis
2013-08-21auto merge of #8546 : jld/rust/discrim-symbol-rm, r=pcwaltonbors-9/+0
Given that bootstrapping and running the testsuite works without exporting discriminant values as global constants, I conclude that they're unused and can be removed.
2013-08-20rm obsolete integer to_str{,_radix} free functionsDaniel Micay-4/+2
2013-08-20Allow traits to use builtin kinds as supertraits for #7083.Ben Blum-1/+22
2013-08-19Remove discriminant symbols.Jed Davis-9/+0
Given that bootstrapping and running the testsuite works without exporting discriminant values as global constants, I conclude that they're unused and can be removed.
2013-08-16auto merge of #8532 : kballard/rust/cstr-cleanup, r=ericktbors-1/+1
Implement interior null checking in `.to_c_str()`, among other changes.
2013-08-16auto merge of #8526 : blake2-ppc/rust/either-result, r=catamorphismbors-11/+3
Retry of PR #8471 Replace the remaining functions marked for issue #8228 with similar functions that are iterator-based. Change `either::{lefts, rights}` to be iterator-filtering instead of returning a vector. Replace `map_vec`, `map_vec2`, `iter_vec2` in std::result with three functions: * `result::collect` gathers `Iterator<Result<V, U>>` to `Result<~[V], U>` * `result::fold` folds `Iterator<Result<T, E>>` to `Result<V, E>` * `result::fold_` folds `Iterator<Result<T, E>>` to `Result<(), E>`
2013-08-15Add ToCStr method .with_c_str()Kevin Ballard-1/+1
.with_c_str() is a replacement for the old .as_c_str(), to avoid unnecessary boilerplate. Replace all usages of .to_c_str().with_ref() with .with_c_str().
2013-08-15Switch metadata::encoder to <V:Visitor> trait.Felix S. Klock II-49/+81
placate make tidy. Remove dead code.
2013-08-15Update either::partitionblake2-ppc-11/+3
Remove the only use of either::partition since it was better accomplished with vector methods. Update either::partition so that it sizes the vectors correctly before it starts.
2013-08-12fix build with the new snapshot compilerDaniel Micay-10/+0
2013-08-11librustc: Convert from `@Object` to `@mut Object` as neededNiko Matsakis-8/+8
2013-08-10syntax and rustc: fix some warningsErick Tryzelaar-1/+0
2013-08-10std: Transform.find_ -> .findErick Tryzelaar-1/+1
2013-08-10std: Rename Iterator.transform -> .mapErick Tryzelaar-1/+1
cc #5898
2013-08-09Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-139/+192
remove-str-trailing-nulls
2013-08-09auto merge of #8176 : catamorphism/rust/rustpkg-extern-mod, r=catamorphismbors-112/+156
r? @graydon Also, notably, make rustpkgtest depend on the rustpkg executable (otherwise, tests that shell out to rustpgk might run when rustpkg doesn't exist).
2013-08-09std/rustc/rustpkg/syntax: Support the `extern mod = ...` formTim Chevalier-112/+156
This commit allows you to write: extern mod x = "a/b/c"; which means rustc will search in the RUST_PATH for a package with ID a/b/c, and bind it to the name `x` if it's found. Incidentally, move get_relative_to from back::rpath into std::path
2013-08-09auto merge of #8362 : sfackler/rust/env, r=alexcrichtonbors-1/+7
env! aborts compilation of the specified environment variable is not defined and takes an optional second argument containing a custom error message. option_env! creates an Option<&'static str> containing the value of the environment variable. There are no run-pass tests that check the behavior when the environment variable is defined since the test framework doesn't support setting environment variables at compile time as opposed to runtime. However, both env! and option_env! are used inside of rustc itself, which should act as a sufficient test. Fixes #2248.
2013-08-09auto merge of #8361 : alexcrichton/rust/fix-node-hashes-in-crates, r=thestingerbors-26/+29
When running rusti 32-bit tests from a 64-bit host, these errors came up frequently. My best idea as to what was happening is: 1. First, if you hash the same `int` value on 32-bit and 64-bit, you will get two different hashes. 2. In a cross-compile situation, let's say x86_64 is building an i686 library, all of the hashes will be 64-bit hashes. 3. Then let's say you use the i686 libraries and then attempt to link against the same i686 libraries, because you're calculating hashes with a 32-bit int instead of a 64-bit one, you'll have different hashes and you won't be able to find items in the metadata (the items were generated with a 64-bit int). This patch changes the items to always be hashed as an `i64` to preserve the hash value across architectures. Here's a nice before/after for this patch of the state of rusti tests ``` host target before after 64 64 yes yes 64 32 no no (llvm assertion) 32 64 no yes 32 32 no no (llvm assertion) ``` Basically one case started working, but currently when the target is 32-bit LLVM is having a lot of problems generating code. That's another separate issue though.
2013-08-08Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-7/+7
remove-str-trailing-nulls
2013-08-08env! syntax extension changesSteven Fackler-1/+7
env! aborts compilation of the specified environment variable is not defined and takes an optional second argument containing a custom error message. option_env! creates an Option<&'static str> containing the value of the environment variable. There are no run-pass tests that check the behavior when the environment variable is defined since the test framework doesn't support setting environment variables at compile time as opposed to runtime. However, both env! and option_env! are used inside of rustc itself, which should act as a sufficient test. Close #2248
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-7/+7
2013-08-06Fix node hashesAlex Crichton-26/+29
2013-08-06Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-3/+2
remove-str-trailing-nulls